gui-utilities 1.1.0__py3-none-any.whl → 1.1.2__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.
- gui_utilities/gui_utilities.py +76 -5
- gui_utilities/icons/check.svg +1 -0
- {gui_utilities-1.1.0.dist-info → gui_utilities-1.1.2.dist-info}/METADATA +1 -1
- {gui_utilities-1.1.0.dist-info → gui_utilities-1.1.2.dist-info}/RECORD +7 -6
- {gui_utilities-1.1.0.dist-info → gui_utilities-1.1.2.dist-info}/WHEEL +0 -0
- {gui_utilities-1.1.0.dist-info → gui_utilities-1.1.2.dist-info}/licenses/LICENSE +0 -0
- {gui_utilities-1.1.0.dist-info → gui_utilities-1.1.2.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
|
|
2
|
+
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QComboBox, QDialog, QToolButton, QWidgetAction, QCheckBox
|
|
3
3
|
from PyQt6.QtGui import QIcon
|
|
4
4
|
import re
|
|
5
5
|
import requests
|
|
@@ -69,10 +69,10 @@ def create_form(
|
|
|
69
69
|
button = create_button(**button_properties_copy)
|
|
70
70
|
if callback: button.clicked.connect(callback)
|
|
71
71
|
menu_layout.addWidget(button)
|
|
72
|
-
ui_instance.
|
|
73
|
-
ui_instance.
|
|
74
|
-
body_layout.addWidget(ui_instance.
|
|
75
|
-
ui_instance.
|
|
72
|
+
ui_instance.content_widget = QWidget()
|
|
73
|
+
ui_instance.content_widget.setLayout(QVBoxLayout())
|
|
74
|
+
body_layout.addWidget(ui_instance.content_widget)
|
|
75
|
+
ui_instance.content_widget.setStyleSheet("background-color: #333333;")
|
|
76
76
|
body_layout.setStretch(0, 1)
|
|
77
77
|
body_layout.setStretch(1, 4)
|
|
78
78
|
return main_layout
|
|
@@ -353,6 +353,55 @@ def create_combo_box(
|
|
|
353
353
|
change_color(-1)
|
|
354
354
|
return combo_box
|
|
355
355
|
|
|
356
|
+
def create_checkbox(
|
|
357
|
+
text,
|
|
358
|
+
font_family = "Segoe UI",
|
|
359
|
+
font_size = 14,
|
|
360
|
+
font_color = "#ffffff",
|
|
361
|
+
background_color = "#1e1e1e",
|
|
362
|
+
padding = 15,
|
|
363
|
+
border_width = 2,
|
|
364
|
+
border_color = "#5c5c5c",
|
|
365
|
+
border_radius = 0,
|
|
366
|
+
hover_background_color = "#333333",
|
|
367
|
+
hover_border_width = 3,
|
|
368
|
+
hover_border_color = "#777777",
|
|
369
|
+
pressed_background_color = "#4a4a4a",
|
|
370
|
+
pressed_border_width = 3,
|
|
371
|
+
pressed_border_color = "#0078d7",
|
|
372
|
+
disabled_font_color = "#888888",
|
|
373
|
+
disabled_background_color = "#2d2d2d",
|
|
374
|
+
disabled_border_width = 2,
|
|
375
|
+
disabled_border_color = "#4a4a4a"
|
|
376
|
+
):
|
|
377
|
+
checkbox = QCheckBox(text)
|
|
378
|
+
style_sheet = f"""
|
|
379
|
+
QCheckBox {{
|
|
380
|
+
font-family: {font_family};
|
|
381
|
+
font-size: {font_size}px;
|
|
382
|
+
color: {font_color};
|
|
383
|
+
background-color: {background_color};
|
|
384
|
+
padding: {padding}px;
|
|
385
|
+
border: {border_width}px solid {border_color};
|
|
386
|
+
border-radius: {border_radius}px;
|
|
387
|
+
}}
|
|
388
|
+
QCheckBox:hover {{
|
|
389
|
+
background-color: {hover_background_color};
|
|
390
|
+
border: {hover_border_width}px solid {hover_border_color};
|
|
391
|
+
}}
|
|
392
|
+
QCheckBox:pressed {{
|
|
393
|
+
background-color: {pressed_background_color};
|
|
394
|
+
border: {pressed_border_width}px solid {pressed_border_color};
|
|
395
|
+
}}
|
|
396
|
+
QCheckBox:disabled {{
|
|
397
|
+
color: {disabled_font_color};
|
|
398
|
+
background-color: {disabled_background_color};
|
|
399
|
+
border: {disabled_border_width}px solid {disabled_border_color};
|
|
400
|
+
}}
|
|
401
|
+
"""
|
|
402
|
+
checkbox.setStyleSheet(style_sheet)
|
|
403
|
+
return checkbox
|
|
404
|
+
|
|
356
405
|
def create_information_message_box(
|
|
357
406
|
text,
|
|
358
407
|
top_margin = 25,
|
|
@@ -641,6 +690,28 @@ def switch_instance(gui_instance, menu_function):
|
|
|
641
690
|
else: gui_instance.window.layout().addWidget(new_widget)
|
|
642
691
|
gui_instance.central_widget = new_widget
|
|
643
692
|
|
|
693
|
+
def switch_content_widget(content_widget):
|
|
694
|
+
def clear_layout(layout):
|
|
695
|
+
if layout is not None:
|
|
696
|
+
while layout.count():
|
|
697
|
+
item = layout.takeAt(0)
|
|
698
|
+
widget = item.widget()
|
|
699
|
+
child_layout = item.layout()
|
|
700
|
+
if widget is not None:
|
|
701
|
+
widget.setParent(None)
|
|
702
|
+
widget.deleteLater()
|
|
703
|
+
elif child_layout is not None:
|
|
704
|
+
clear_layout(child_layout)
|
|
705
|
+
child_layout.setParent(None)
|
|
706
|
+
|
|
707
|
+
if content_widget.layout() is not None: clear_layout(content_widget.layout())
|
|
708
|
+
for child in content_widget.findChildren(QWidget):
|
|
709
|
+
if child.parent() == content_widget: child.deleteLater()
|
|
710
|
+
main_layout = content_widget.layout()
|
|
711
|
+
main_layout.setContentsMargins(25, 25, 25, 25)
|
|
712
|
+
main_layout.setSpacing(10)
|
|
713
|
+
return main_layout
|
|
714
|
+
|
|
644
715
|
def get_responsive_width(window, fraction = 3.0):
|
|
645
716
|
screen_width = window.screen().size().width()
|
|
646
717
|
return round(screen_width / fraction)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path d="M13.822 3.322l-8.471 8.44a.75.75 0 01-1.06 0L1.535 8.982a.75.75 0 011.06-1.06l2.894 2.894 7.94-7.94a.75.75 0 011.06 0z"/></svg>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
gui_utilities/gui_utilities.py,sha256
|
|
1
|
+
gui_utilities/gui_utilities.py,sha256=-f9hOL1M4xy7n-qpKGEyTRuONH0bXhPrG5D005QEtNQ,30685
|
|
2
|
+
gui_utilities/icons/check.svg,sha256=HHTjePt4C7XcmrMGZMBTyRTzR580bZ4IF82kEY0Y5Gw,232
|
|
2
3
|
gui_utilities/icons/focused_hide_text_icon.png,sha256=0Ysx7vC-mEVfuSBWx1Zw-UhpqvrTCcIvnQ926wFmuK4,13084
|
|
3
4
|
gui_utilities/icons/focused_show_text_icon.png,sha256=gmZU7RR4FN-9VSzpD00ZkQ8UGbihO2y808Kh3b_TaEg,6739
|
|
4
5
|
gui_utilities/icons/hide_text_icon.png,sha256=f5jq6KaAygWNjzP_Ah6dw6eu8q5ml3m56JTeNSTSgEU,7207
|
|
5
6
|
gui_utilities/icons/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
|
|
6
7
|
gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
|
|
7
|
-
gui_utilities-1.1.
|
|
8
|
-
gui_utilities-1.1.
|
|
9
|
-
gui_utilities-1.1.
|
|
10
|
-
gui_utilities-1.1.
|
|
11
|
-
gui_utilities-1.1.
|
|
8
|
+
gui_utilities-1.1.2.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
|
|
9
|
+
gui_utilities-1.1.2.dist-info/METADATA,sha256=p9188bKy6TorlaCBLR9WS1dd338IvqduTLQTvSVas5k,265
|
|
10
|
+
gui_utilities-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
gui_utilities-1.1.2.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
|
|
12
|
+
gui_utilities-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|