gui-utilities 1.0.1__py3-none-any.whl → 1.1.0__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.

@@ -18,6 +18,94 @@ def create_window(title, background_color = "#1e1e1e"):
18
18
  window.setLayout(main_layout)
19
19
  return window
20
20
 
21
+ def create_form(
22
+ ui_instance,
23
+ buttons,
24
+ title,
25
+ title_font_family = "Segoe UI",
26
+ title_font_size = 36,
27
+ title_font_color = "#ffffff",
28
+ title_background_color = "#1e1e1e",
29
+ title_padding = 15,
30
+ title_border_width = 0,
31
+ title_border_color = "#ffffff",
32
+ title_border_radius = 0
33
+ ):
34
+ main_layout = QVBoxLayout()
35
+ main_layout.setContentsMargins(25, 25, 25, 25)
36
+ main_layout.addLayout(create_title(
37
+ text = title,
38
+ font_family = title_font_family,
39
+ font_size = title_font_size,
40
+ font_color = title_font_color,
41
+ background_color = title_background_color,
42
+ padding = title_padding,
43
+ border_width = title_border_width,
44
+ border_color = title_border_color,
45
+ border_radius = title_border_radius
46
+ ))
47
+ body_layout = QHBoxLayout()
48
+ main_layout.addLayout(body_layout)
49
+ body_layout.setSpacing(25)
50
+ menu_layout = QVBoxLayout()
51
+ body_layout.addLayout(menu_layout)
52
+ menu_layout.setSpacing(10)
53
+ normal_buttons = []
54
+ special_buttons = []
55
+ for button_properties in buttons:
56
+ if button_properties.get("text") in ["Atrás", "Salir"]: special_buttons.append(button_properties)
57
+ else: normal_buttons.append(button_properties)
58
+ for button_properties in normal_buttons:
59
+ button_properties_copy = button_properties.copy()
60
+ callback = button_properties_copy.pop("callback", None)
61
+ button = create_button(**button_properties_copy)
62
+ if callback: button.clicked.connect(callback)
63
+ menu_layout.addWidget(button)
64
+ menu_layout.addStretch()
65
+ for button_properties in special_buttons:
66
+ button_properties_copy = button_properties.copy()
67
+ callback = button_properties_copy.pop("callback", None)
68
+ button_properties_copy.setdefault("font_size", 16)
69
+ button = create_button(**button_properties_copy)
70
+ if callback: button.clicked.connect(callback)
71
+ menu_layout.addWidget(button)
72
+ ui_instance.form_widget = QWidget()
73
+ ui_instance.form_widget.setLayout(QVBoxLayout())
74
+ body_layout.addWidget(ui_instance.form_widget)
75
+ ui_instance.form_widget.setStyleSheet("background-color: #333333;")
76
+ body_layout.setStretch(0, 1)
77
+ body_layout.setStretch(1, 4)
78
+ return main_layout
79
+
80
+ def create_title(
81
+ text,
82
+ font_family = "Segoe UI",
83
+ font_size = 36,
84
+ font_color = "#ffffff",
85
+ background_color = "#1e1e1e",
86
+ padding = 15,
87
+ border_width = 0,
88
+ border_color = "#ffffff",
89
+ border_radius = 0
90
+ ):
91
+ title_layout = QHBoxLayout()
92
+ title_layout.setContentsMargins(0, 0, 0, 25)
93
+ title_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
94
+ title_label = create_label(
95
+ text = text,
96
+ font_family = font_family,
97
+ font_size = font_size,
98
+ font_color = font_color,
99
+ font_weight = "bold",
100
+ background_color = background_color,
101
+ padding = padding,
102
+ border_width = border_width,
103
+ border_color = border_color,
104
+ border_radius = border_radius
105
+ )
106
+ title_layout.addWidget(title_label)
107
+ return title_layout
108
+
21
109
  def create_label(
22
110
  text,
23
111
  font_family = "Segoe UI",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gui_utilities
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Librería de utilidades gráficas en PyQt6
5
5
  Author-email: Guido Iván Gross <grossguidoivan@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -1,11 +1,11 @@
1
- gui_utilities/gui_utilities.py,sha256=mKebLU7HxW_KURVMzt3xfg-TeTHIBJM6a5QQCyCjR2E,25075
1
+ gui_utilities/gui_utilities.py,sha256=EfG8zxrwFWc-cmfCwB9tEFoRKh7OK2vVjg-4QaMN3lg,28165
2
2
  gui_utilities/icons/focused_hide_text_icon.png,sha256=0Ysx7vC-mEVfuSBWx1Zw-UhpqvrTCcIvnQ926wFmuK4,13084
3
3
  gui_utilities/icons/focused_show_text_icon.png,sha256=gmZU7RR4FN-9VSzpD00ZkQ8UGbihO2y808Kh3b_TaEg,6739
4
4
  gui_utilities/icons/hide_text_icon.png,sha256=f5jq6KaAygWNjzP_Ah6dw6eu8q5ml3m56JTeNSTSgEU,7207
5
5
  gui_utilities/icons/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
6
6
  gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
7
- gui_utilities-1.0.1.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
8
- gui_utilities-1.0.1.dist-info/METADATA,sha256=ix5Q7NZLQmn_BqkuRJSr6BUZo_PQDj6qijYYRXMyHlM,265
9
- gui_utilities-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- gui_utilities-1.0.1.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
11
- gui_utilities-1.0.1.dist-info/RECORD,,
7
+ gui_utilities-1.1.0.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
8
+ gui_utilities-1.1.0.dist-info/METADATA,sha256=AHfq2NN6eQi8jEq8k2u2DHcmQpw4YIiTa-tnl7rHsBQ,265
9
+ gui_utilities-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ gui_utilities-1.1.0.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
11
+ gui_utilities-1.1.0.dist-info/RECORD,,