gui-utilities 1.1.15__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gui-utilities might be problematic. Click here for more details.
- gui_utilities/gui_utilities.py +122 -2
- {gui_utilities-1.1.15.dist-info → gui_utilities-1.2.1.dist-info}/METADATA +1 -1
- gui_utilities-1.2.1.dist-info/RECORD +11 -0
- gui_utilities/icons/checked_verification_mark_icon.png +0 -0
- gui_utilities/icons/hover_verification_mark_icon.png +0 -0
- gui_utilities-1.1.15.dist-info/RECORD +0 -13
- {gui_utilities-1.1.15.dist-info → gui_utilities-1.2.1.dist-info}/WHEEL +0 -0
- {gui_utilities-1.1.15.dist-info → gui_utilities-1.2.1.dist-info}/licenses/LICENSE +0 -0
- {gui_utilities-1.1.15.dist-info → gui_utilities-1.2.1.dist-info}/top_level.txt +0 -0
gui_utilities/gui_utilities.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from PyQt6.QtCore import Qt, QObject, QEvent, QSize
|
|
2
|
-
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QComboBox, QDialog, QToolButton, QWidgetAction, QCheckBox
|
|
2
|
+
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QComboBox, QDialog, QToolButton, QWidgetAction, QCheckBox, QTableWidget, QHeaderView
|
|
3
3
|
from PyQt6.QtGui import QIcon
|
|
4
4
|
import re
|
|
5
5
|
import requests
|
|
@@ -411,8 +411,10 @@ def create_checkbox(
|
|
|
411
411
|
background-color: {checked_indicator_background_color};
|
|
412
412
|
border: {checked_indicator_border_width}px solid {checked_indicator_border_color};
|
|
413
413
|
}}
|
|
414
|
-
QCheckBox
|
|
414
|
+
QCheckBox:disabled {{
|
|
415
415
|
color: {disabled_font_color};
|
|
416
|
+
}}
|
|
417
|
+
QCheckBox::indicator:disabled {{
|
|
416
418
|
background-color: {disabled_background_color};
|
|
417
419
|
border: {disabled_border_width}px solid {disabled_border_color};
|
|
418
420
|
}}
|
|
@@ -461,6 +463,7 @@ def create_information_message_box(
|
|
|
461
463
|
message_box = QDialog()
|
|
462
464
|
message_box.setObjectName("message_box")
|
|
463
465
|
message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
466
|
+
message_box.setMinimumWidth(240)
|
|
464
467
|
message_box.setMaximumWidth(480)
|
|
465
468
|
style_sheet = f"""
|
|
466
469
|
QDialog#message_box {{
|
|
@@ -553,6 +556,7 @@ def create_confirmation_message_box(
|
|
|
553
556
|
confirm_message_box = QDialog()
|
|
554
557
|
confirm_message_box.setObjectName("confirm_message_box")
|
|
555
558
|
confirm_message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
559
|
+
confirm_message_box.setMinimumWidth(240)
|
|
556
560
|
confirm_message_box.setMaximumWidth(480)
|
|
557
561
|
style_sheet = f"""
|
|
558
562
|
QDialog#confirm_message_box {{
|
|
@@ -631,6 +635,122 @@ def create_confirmation_message_box(
|
|
|
631
635
|
decline_button.clicked.connect(confirm_message_box.reject)
|
|
632
636
|
return confirm_message_box
|
|
633
637
|
|
|
638
|
+
def create_list_table(
|
|
639
|
+
items_data,
|
|
640
|
+
column_headers,
|
|
641
|
+
column_proportions,
|
|
642
|
+
row_populator_function,
|
|
643
|
+
font_family = "Segoe UI",
|
|
644
|
+
font_size = 14,
|
|
645
|
+
font_color = "#ffffff",
|
|
646
|
+
background_color = "#1e1e1e",
|
|
647
|
+
border_width = 2,
|
|
648
|
+
border_color = "#5c5c5c",
|
|
649
|
+
item_font_color = "#ffffff",
|
|
650
|
+
item_background_color = "#1e1e1e",
|
|
651
|
+
selected_item_background_color = "#0078d7",
|
|
652
|
+
header_font_family = "Segoe UI",
|
|
653
|
+
header_font_size = 14,
|
|
654
|
+
header_font_color = "#ffffff",
|
|
655
|
+
header_font_weight = "bold",
|
|
656
|
+
header_background_color = "#1e1e1e",
|
|
657
|
+
header_border_width = 0,
|
|
658
|
+
header_border_color = "#5c5c5c",
|
|
659
|
+
hover_header_background_color = "#333333",
|
|
660
|
+
hover_header_border_width = 3,
|
|
661
|
+
hover_header_border_color = "#777777",
|
|
662
|
+
pressed_header_background_color = "#4a4a4a",
|
|
663
|
+
pressed_header_border_width = 3,
|
|
664
|
+
pressed_header_border_color = "#0078d7",
|
|
665
|
+
scrollbar_background_color = "#1e1e1e",
|
|
666
|
+
scrollbar_handle_background_color = "#333333",
|
|
667
|
+
hover_scrollbar_handle_background_color = "#4a4a4a",
|
|
668
|
+
hover_scrollbar_handle_border_width = 3,
|
|
669
|
+
hover_scrollbar_handle_border_color = "#777777",
|
|
670
|
+
pressed_scrollbar_handle_background_color = "#4a4a4a",
|
|
671
|
+
pressed_scrollbar_handle_border_width = 3,
|
|
672
|
+
pressed_scrollbar_handle_border_color = "#0078d7"
|
|
673
|
+
):
|
|
674
|
+
list_table = QTableWidget()
|
|
675
|
+
list_table.verticalHeader().setVisible(False)
|
|
676
|
+
list_table.setColumnCount(len(column_headers))
|
|
677
|
+
list_table.setHorizontalHeaderLabels(column_headers)
|
|
678
|
+
header = list_table.horizontalHeader()
|
|
679
|
+
header.setSectionResizeMode(QHeaderView.ResizeMode.Interactive)
|
|
680
|
+
|
|
681
|
+
def resize_columns():
|
|
682
|
+
total_width = list_table.viewport().width()
|
|
683
|
+
if total_width == 0: return
|
|
684
|
+
for i, proportion in enumerate(column_proportions):
|
|
685
|
+
list_table.setColumnWidth(i, int(total_width * proportion))
|
|
686
|
+
|
|
687
|
+
resize_columns()
|
|
688
|
+
original_resize_event = list_table.resizeEvent
|
|
689
|
+
|
|
690
|
+
def on_resize(event):
|
|
691
|
+
resize_columns()
|
|
692
|
+
if original_resize_event: original_resize_event(event)
|
|
693
|
+
|
|
694
|
+
list_table.resizeEvent = on_resize
|
|
695
|
+
style_sheet = f"""
|
|
696
|
+
QTableWidget {{
|
|
697
|
+
color: {font_color};
|
|
698
|
+
background-color: {background_color};
|
|
699
|
+
font-family: {font_family};
|
|
700
|
+
font-size: {font_size}px;
|
|
701
|
+
border: {border_width}px solid {border_color};
|
|
702
|
+
}}
|
|
703
|
+
QTableWidget::item {{
|
|
704
|
+
color: {item_font_color};
|
|
705
|
+
background-color: {item_background_color};
|
|
706
|
+
border: none;
|
|
707
|
+
}}
|
|
708
|
+
QTableWidget::item:selected {{
|
|
709
|
+
background-color: {selected_item_background_color};
|
|
710
|
+
}}
|
|
711
|
+
QHeaderView::section {{
|
|
712
|
+
color: {header_font_color};
|
|
713
|
+
background-color: {header_background_color};
|
|
714
|
+
font-family: {header_font_family};
|
|
715
|
+
font-size: {header_font_size}px;
|
|
716
|
+
font-weight: {header_font_weight};
|
|
717
|
+
border: {header_border_width}px solid {header_border_color};
|
|
718
|
+
}}
|
|
719
|
+
QHeaderView::section:hover {{
|
|
720
|
+
background-color: {hover_header_background_color};
|
|
721
|
+
border: {hover_header_border_width}px solid {hover_header_border_color};
|
|
722
|
+
}}
|
|
723
|
+
QHeaderView::section:pressed {{
|
|
724
|
+
background-color: {pressed_header_background_color};
|
|
725
|
+
border: {pressed_header_border_width}px solid {pressed_header_border_color};
|
|
726
|
+
}}
|
|
727
|
+
QScrollBar:vertical {{
|
|
728
|
+
background-color: {scrollbar_background_color};
|
|
729
|
+
border: none;
|
|
730
|
+
}}
|
|
731
|
+
QScrollBar::handle:vertical {{
|
|
732
|
+
background-color: {scrollbar_handle_background_color};
|
|
733
|
+
border: none;
|
|
734
|
+
}}
|
|
735
|
+
QScrollBar::handle:vertical:hover {{
|
|
736
|
+
background-color: {hover_scrollbar_handle_background_color};
|
|
737
|
+
border: {hover_scrollbar_handle_border_width}px solid {hover_scrollbar_handle_border_color};
|
|
738
|
+
}}
|
|
739
|
+
QScrollBar::handle:vertical:pressed {{
|
|
740
|
+
background-color: {pressed_scrollbar_handle_background_color};
|
|
741
|
+
border: {pressed_scrollbar_handle_border_width}px solid {pressed_scrollbar_handle_border_color};
|
|
742
|
+
}}
|
|
743
|
+
"""
|
|
744
|
+
list_table.setStyleSheet(style_sheet)
|
|
745
|
+
list_table.setRowCount(len(items_data))
|
|
746
|
+
for row, item_data in enumerate(items_data):
|
|
747
|
+
items = row_populator_function(item_data)
|
|
748
|
+
for item in items:
|
|
749
|
+
item.setTextAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
750
|
+
for column, item in enumerate(items):
|
|
751
|
+
list_table.setItem(row, column, item)
|
|
752
|
+
return list_table
|
|
753
|
+
|
|
634
754
|
def confirm_exit(
|
|
635
755
|
window,
|
|
636
756
|
background_color = "#1e1e1e",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
gui_utilities/gui_utilities.py,sha256=qG-ey3CoxsuWRECynxqQsgWzWQggxkndpEvJLwVBw7s,36404
|
|
2
|
+
gui_utilities/icons/focused_hide_text_icon.png,sha256=0Ysx7vC-mEVfuSBWx1Zw-UhpqvrTCcIvnQ926wFmuK4,13084
|
|
3
|
+
gui_utilities/icons/focused_show_text_icon.png,sha256=gmZU7RR4FN-9VSzpD00ZkQ8UGbihO2y808Kh3b_TaEg,6739
|
|
4
|
+
gui_utilities/icons/hide_text_icon.png,sha256=f5jq6KaAygWNjzP_Ah6dw6eu8q5ml3m56JTeNSTSgEU,7207
|
|
5
|
+
gui_utilities/icons/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
|
|
6
|
+
gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
|
|
7
|
+
gui_utilities-1.2.1.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
|
|
8
|
+
gui_utilities-1.2.1.dist-info/METADATA,sha256=2RtnKYlEEDvAvpQGohSa5REqXmZ1ALf3Sllj98iTyOM,265
|
|
9
|
+
gui_utilities-1.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
gui_utilities-1.2.1.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
|
|
11
|
+
gui_utilities-1.2.1.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
gui_utilities/gui_utilities.py,sha256=gGsyPlRuoGyh8cY7UIithZXPhrLZTlybLa-GQkoZmAk,31707
|
|
2
|
-
gui_utilities/icons/checked_verification_mark_icon.png,sha256=io3pvAu8cYugk5mmVGtGCKKzTSNLIINGMJcTySKv8e8,6587
|
|
3
|
-
gui_utilities/icons/focused_hide_text_icon.png,sha256=0Ysx7vC-mEVfuSBWx1Zw-UhpqvrTCcIvnQ926wFmuK4,13084
|
|
4
|
-
gui_utilities/icons/focused_show_text_icon.png,sha256=gmZU7RR4FN-9VSzpD00ZkQ8UGbihO2y808Kh3b_TaEg,6739
|
|
5
|
-
gui_utilities/icons/hide_text_icon.png,sha256=f5jq6KaAygWNjzP_Ah6dw6eu8q5ml3m56JTeNSTSgEU,7207
|
|
6
|
-
gui_utilities/icons/hover_verification_mark_icon.png,sha256=V--qmtXpVl1LNCusQEgRcJk8RU6pfzCqYCRNOoeZR5c,7382
|
|
7
|
-
gui_utilities/icons/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
|
|
8
|
-
gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
|
|
9
|
-
gui_utilities-1.1.15.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
|
|
10
|
-
gui_utilities-1.1.15.dist-info/METADATA,sha256=0PnI0tjtz2wXSQc2WugYWrIgjUPk2LeMWQMMJzzz7Ww,266
|
|
11
|
-
gui_utilities-1.1.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
gui_utilities-1.1.15.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
|
|
13
|
-
gui_utilities-1.1.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|