gui-utilities 1.1.2__py3-none-any.whl → 1.2.19__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 +302 -42
- {gui_utilities-1.1.2.dist-info → gui_utilities-1.2.19.dist-info}/METADATA +1 -1
- gui_utilities-1.2.19.dist-info/RECORD +11 -0
- gui_utilities/icons/check.svg +0 -1
- gui_utilities-1.1.2.dist-info/RECORD +0 -12
- {gui_utilities-1.1.2.dist-info → gui_utilities-1.2.19.dist-info}/WHEEL +0 -0
- {gui_utilities-1.1.2.dist-info → gui_utilities-1.2.19.dist-info}/licenses/LICENSE +0 -0
- {gui_utilities-1.1.2.dist-info → gui_utilities-1.2.19.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
|
|
@@ -27,6 +27,10 @@ def create_form(
|
|
|
27
27
|
title_font_color = "#ffffff",
|
|
28
28
|
title_background_color = "#1e1e1e",
|
|
29
29
|
title_padding = 15,
|
|
30
|
+
title_padding_top = None,
|
|
31
|
+
title_padding_right = None,
|
|
32
|
+
title_padding_bottom = None,
|
|
33
|
+
title_padding_left = None,
|
|
30
34
|
title_border_width = 0,
|
|
31
35
|
title_border_color = "#ffffff",
|
|
32
36
|
title_border_radius = 0
|
|
@@ -40,6 +44,10 @@ def create_form(
|
|
|
40
44
|
font_color = title_font_color,
|
|
41
45
|
background_color = title_background_color,
|
|
42
46
|
padding = title_padding,
|
|
47
|
+
padding_top = title_padding_top,
|
|
48
|
+
padding_right = title_padding_right,
|
|
49
|
+
padding_bottom = title_padding_bottom,
|
|
50
|
+
padding_left = title_padding_left,
|
|
43
51
|
border_width = title_border_width,
|
|
44
52
|
border_color = title_border_color,
|
|
45
53
|
border_radius = title_border_radius
|
|
@@ -84,6 +92,10 @@ def create_title(
|
|
|
84
92
|
font_color = "#ffffff",
|
|
85
93
|
background_color = "#1e1e1e",
|
|
86
94
|
padding = 15,
|
|
95
|
+
padding_top = None,
|
|
96
|
+
padding_right = None,
|
|
97
|
+
padding_bottom = None,
|
|
98
|
+
padding_left = None,
|
|
87
99
|
border_width = 0,
|
|
88
100
|
border_color = "#ffffff",
|
|
89
101
|
border_radius = 0
|
|
@@ -99,6 +111,10 @@ def create_title(
|
|
|
99
111
|
font_weight = "bold",
|
|
100
112
|
background_color = background_color,
|
|
101
113
|
padding = padding,
|
|
114
|
+
padding_top = padding_top,
|
|
115
|
+
padding_right = padding_right,
|
|
116
|
+
padding_bottom = padding_bottom,
|
|
117
|
+
padding_left = padding_left,
|
|
102
118
|
border_width = border_width,
|
|
103
119
|
border_color = border_color,
|
|
104
120
|
border_radius = border_radius
|
|
@@ -114,18 +130,29 @@ def create_label(
|
|
|
114
130
|
font_weight = "normal",
|
|
115
131
|
background_color = "#1e1e1e",
|
|
116
132
|
padding = 15,
|
|
133
|
+
padding_top = None,
|
|
134
|
+
padding_right = None,
|
|
135
|
+
padding_bottom = None,
|
|
136
|
+
padding_left = None,
|
|
117
137
|
border_width = 0,
|
|
118
138
|
border_color = "#ffffff",
|
|
119
139
|
border_radius = 0
|
|
120
140
|
):
|
|
121
141
|
label = QLabel(text)
|
|
142
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
143
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
144
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
145
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
122
146
|
style = f"""
|
|
123
147
|
font-family: {font_family};
|
|
124
148
|
font-size: {font_size}px;
|
|
125
149
|
color: {font_color};
|
|
126
150
|
font-weight: {font_weight};
|
|
127
151
|
background-color: {background_color};
|
|
128
|
-
padding: {
|
|
152
|
+
padding-top: {padding_top_value}px;
|
|
153
|
+
padding-right: {padding_right_value}px;
|
|
154
|
+
padding-bottom: {padding_bottom_value}px;
|
|
155
|
+
padding-left: {padding_left_value}px;
|
|
129
156
|
border: {border_width}px solid {border_color};
|
|
130
157
|
border-radius: {border_radius}px;
|
|
131
158
|
"""
|
|
@@ -140,6 +167,10 @@ def create_button(
|
|
|
140
167
|
font_weight = "bold",
|
|
141
168
|
background_color = "#1e1e1e",
|
|
142
169
|
padding = 15,
|
|
170
|
+
padding_top = None,
|
|
171
|
+
padding_right = None,
|
|
172
|
+
padding_bottom = None,
|
|
173
|
+
padding_left = None,
|
|
143
174
|
border_width = 2,
|
|
144
175
|
border_color = "#5c5c5c",
|
|
145
176
|
border_radius = 0,
|
|
@@ -155,6 +186,10 @@ def create_button(
|
|
|
155
186
|
disabled_border_color = "#4a4a4a"
|
|
156
187
|
):
|
|
157
188
|
button = QPushButton(text)
|
|
189
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
190
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
191
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
192
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
158
193
|
style_sheet = f"""
|
|
159
194
|
QPushButton {{
|
|
160
195
|
font-family: {font_family};
|
|
@@ -162,7 +197,10 @@ def create_button(
|
|
|
162
197
|
color: {font_color};
|
|
163
198
|
font-weight: {font_weight};
|
|
164
199
|
background-color: {background_color};
|
|
165
|
-
padding: {
|
|
200
|
+
padding-top: {padding_top_value}px;
|
|
201
|
+
padding-right: {padding_right_value}px;
|
|
202
|
+
padding-bottom: {padding_bottom_value}px;
|
|
203
|
+
padding-left: {padding_left_value}px;
|
|
166
204
|
border: {border_width}px solid {border_color};
|
|
167
205
|
border-radius: {border_radius}px;
|
|
168
206
|
}}
|
|
@@ -191,6 +229,10 @@ def create_text_box(
|
|
|
191
229
|
font_weight = "normal",
|
|
192
230
|
background_color = "#1e1e1e",
|
|
193
231
|
padding = 15,
|
|
232
|
+
padding_top = None,
|
|
233
|
+
padding_right = None,
|
|
234
|
+
padding_bottom = None,
|
|
235
|
+
padding_left = None,
|
|
194
236
|
border_width = 2,
|
|
195
237
|
border_color = "#5c5c5c",
|
|
196
238
|
border_radius = 0,
|
|
@@ -204,10 +246,18 @@ def create_text_box(
|
|
|
204
246
|
disabled_background_color = "#2d2d2d",
|
|
205
247
|
disabled_border_width = 2,
|
|
206
248
|
disabled_border_color = "#4a4a4a",
|
|
249
|
+
show_text_icon_url = str(icons_dir / "show_text_icon.png"),
|
|
250
|
+
hide_text_icon_url = str(icons_dir / "hide_text_icon.png"),
|
|
251
|
+
focused_show_text_icon_url = str(icons_dir / "focused_show_text_icon.png"),
|
|
252
|
+
focused_hide_text_icon_url = str(icons_dir / "focused_hide_text_icon.png"),
|
|
207
253
|
hide_text = False
|
|
208
254
|
):
|
|
209
255
|
text_box = QLineEdit()
|
|
210
256
|
text_box.setPlaceholderText(placeholder_text)
|
|
257
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
258
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
259
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
260
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
211
261
|
style_sheet = f"""
|
|
212
262
|
QLineEdit {{
|
|
213
263
|
font-family: {font_family};
|
|
@@ -215,7 +265,10 @@ def create_text_box(
|
|
|
215
265
|
color: {font_color};
|
|
216
266
|
font-weight: {font_weight};
|
|
217
267
|
background-color: {background_color};
|
|
218
|
-
padding: {
|
|
268
|
+
padding-top: {padding_top_value}px;
|
|
269
|
+
padding-right: {padding_right_value}px;
|
|
270
|
+
padding-bottom: {padding_bottom_value}px;
|
|
271
|
+
padding-left: {padding_left_value}px;
|
|
219
272
|
border: {border_width}px solid {border_color};
|
|
220
273
|
border-radius: {border_radius}px;
|
|
221
274
|
}}
|
|
@@ -235,10 +288,10 @@ def create_text_box(
|
|
|
235
288
|
"""
|
|
236
289
|
text_box.setStyleSheet(style_sheet)
|
|
237
290
|
if hide_text:
|
|
238
|
-
show_text_icon = QIcon(
|
|
239
|
-
hide_text_icon = QIcon(
|
|
240
|
-
focused_show_text_icon = QIcon(
|
|
241
|
-
focused_hide_text_icon = QIcon(
|
|
291
|
+
show_text_icon = QIcon(show_text_icon_url)
|
|
292
|
+
hide_text_icon = QIcon(hide_text_icon_url)
|
|
293
|
+
focused_show_text_icon = QIcon(focused_show_text_icon_url)
|
|
294
|
+
focused_hide_text_icon = QIcon(focused_hide_text_icon_url)
|
|
242
295
|
text_box.setEchoMode(QLineEdit.EchoMode.Password)
|
|
243
296
|
toggle_text_visibility_button = QToolButton(text_box)
|
|
244
297
|
toggle_text_visibility_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
@@ -249,12 +302,9 @@ def create_text_box(
|
|
|
249
302
|
toggle_text_visibility_action.setDefaultWidget(toggle_text_visibility_button)
|
|
250
303
|
style_sheet = f"""
|
|
251
304
|
QToolButton {{
|
|
252
|
-
border: none;
|
|
253
|
-
margin-right: 10px;
|
|
254
|
-
}}
|
|
255
|
-
QToolButton:hover, QToolButton:pressed {{
|
|
256
305
|
background-color: transparent;
|
|
257
306
|
border: none;
|
|
307
|
+
margin-right: 10px;
|
|
258
308
|
}}
|
|
259
309
|
"""
|
|
260
310
|
toggle_text_visibility_button.setStyleSheet(style_sheet)
|
|
@@ -293,6 +343,10 @@ def create_combo_box(
|
|
|
293
343
|
font_color = "#ffffff",
|
|
294
344
|
background_color = "#1e1e1e",
|
|
295
345
|
padding = 15,
|
|
346
|
+
padding_top = None,
|
|
347
|
+
padding_right = None,
|
|
348
|
+
padding_bottom = None,
|
|
349
|
+
padding_left = None,
|
|
296
350
|
border_width = 2,
|
|
297
351
|
border_color = "#5c5c5c",
|
|
298
352
|
border_radius = 0,
|
|
@@ -314,6 +368,11 @@ def create_combo_box(
|
|
|
314
368
|
combo_box.addItems(items)
|
|
315
369
|
combo_box.setCurrentIndex(-1)
|
|
316
370
|
|
|
371
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
372
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
373
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
374
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
375
|
+
|
|
317
376
|
def get_stylesheet(font_color):
|
|
318
377
|
return f"""
|
|
319
378
|
QComboBox {{
|
|
@@ -321,7 +380,10 @@ def create_combo_box(
|
|
|
321
380
|
font-size: {font_size}px;
|
|
322
381
|
color: {font_color};
|
|
323
382
|
background-color: {background_color};
|
|
324
|
-
padding: {
|
|
383
|
+
padding-top: {padding_top_value}px;
|
|
384
|
+
padding-right: {padding_right_value}px;
|
|
385
|
+
padding-bottom: {padding_bottom_value}px;
|
|
386
|
+
padding-left: {padding_left_value}px;
|
|
325
387
|
border: {border_width}px solid {border_color};
|
|
326
388
|
border-radius: {border_radius}px;
|
|
327
389
|
}}
|
|
@@ -359,48 +421,75 @@ def create_checkbox(
|
|
|
359
421
|
font_size = 14,
|
|
360
422
|
font_color = "#ffffff",
|
|
361
423
|
background_color = "#1e1e1e",
|
|
362
|
-
padding =
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
424
|
+
padding = 5,
|
|
425
|
+
padding_top = None,
|
|
426
|
+
padding_right = None,
|
|
427
|
+
padding_bottom = None,
|
|
428
|
+
padding_left = None,
|
|
429
|
+
indicator_background_color = "#1e1e1e",
|
|
430
|
+
indicator_border_width = 1,
|
|
431
|
+
indicator_border_color = "#5c5c5c",
|
|
432
|
+
indicator_border_radius = 8,
|
|
433
|
+
hover_indicator_background_color = "#333333",
|
|
434
|
+
hover_indicator_border_width = 2,
|
|
435
|
+
hover_indicator_border_color = "#777777",
|
|
436
|
+
pressed_indicator_background_color = "#4a4a4a",
|
|
437
|
+
pressed_indicator_border_width = 2,
|
|
438
|
+
pressed_indicator_border_color = "#0078d7",
|
|
439
|
+
checked_indicator_background_color = "#ffffff",
|
|
440
|
+
checked_indicator_border_width = 1,
|
|
441
|
+
checked_indicator_border_color = "#5c5c5c",
|
|
372
442
|
disabled_font_color = "#888888",
|
|
373
443
|
disabled_background_color = "#2d2d2d",
|
|
374
|
-
disabled_border_width =
|
|
444
|
+
disabled_border_width = 1,
|
|
375
445
|
disabled_border_color = "#4a4a4a"
|
|
376
446
|
):
|
|
377
|
-
|
|
447
|
+
check_box = QCheckBox(text)
|
|
448
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
449
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
450
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
451
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
378
452
|
style_sheet = f"""
|
|
379
453
|
QCheckBox {{
|
|
380
454
|
font-family: {font_family};
|
|
381
455
|
font-size: {font_size}px;
|
|
382
456
|
color: {font_color};
|
|
383
457
|
background-color: {background_color};
|
|
384
|
-
padding: {
|
|
385
|
-
|
|
386
|
-
|
|
458
|
+
padding-top: {padding_top_value}px;
|
|
459
|
+
padding-right: {padding_right_value}px;
|
|
460
|
+
padding-bottom: {padding_bottom_value}px;
|
|
461
|
+
padding-left: {padding_left_value}px;
|
|
387
462
|
}}
|
|
388
|
-
QCheckBox
|
|
389
|
-
|
|
390
|
-
|
|
463
|
+
QCheckBox::indicator {{
|
|
464
|
+
image: none;
|
|
465
|
+
width: {font_size}px;
|
|
466
|
+
height: {font_size}px;
|
|
467
|
+
background-color: {indicator_background_color};
|
|
468
|
+
border: {indicator_border_width}px solid {indicator_border_color};
|
|
469
|
+
border-radius: {indicator_border_radius}px;
|
|
391
470
|
}}
|
|
392
|
-
QCheckBox:
|
|
393
|
-
background-color: {
|
|
394
|
-
border: {
|
|
471
|
+
QCheckBox::indicator:hover {{
|
|
472
|
+
background-color: {hover_indicator_background_color};
|
|
473
|
+
border: {hover_indicator_border_width}px solid {hover_indicator_border_color};
|
|
474
|
+
}}
|
|
475
|
+
QCheckBox::indicator:pressed {{
|
|
476
|
+
background-color: {pressed_indicator_background_color};
|
|
477
|
+
border: {pressed_indicator_border_width}px solid {pressed_indicator_border_color};
|
|
478
|
+
}}
|
|
479
|
+
QCheckBox::indicator:checked {{
|
|
480
|
+
background-color: {checked_indicator_background_color};
|
|
481
|
+
border: {checked_indicator_border_width}px solid {checked_indicator_border_color};
|
|
395
482
|
}}
|
|
396
483
|
QCheckBox:disabled {{
|
|
397
484
|
color: {disabled_font_color};
|
|
485
|
+
}}
|
|
486
|
+
QCheckBox::indicator:disabled {{
|
|
398
487
|
background-color: {disabled_background_color};
|
|
399
488
|
border: {disabled_border_width}px solid {disabled_border_color};
|
|
400
489
|
}}
|
|
401
490
|
"""
|
|
402
|
-
|
|
403
|
-
return
|
|
491
|
+
check_box.setStyleSheet(style_sheet)
|
|
492
|
+
return check_box
|
|
404
493
|
|
|
405
494
|
def create_information_message_box(
|
|
406
495
|
text,
|
|
@@ -417,6 +506,10 @@ def create_information_message_box(
|
|
|
417
506
|
label_font_size = 14,
|
|
418
507
|
label_font_color = "#ffffff",
|
|
419
508
|
label_padding = 15,
|
|
509
|
+
label_padding_top = None,
|
|
510
|
+
label_padding_right = None,
|
|
511
|
+
label_padding_bottom = None,
|
|
512
|
+
label_padding_left = None,
|
|
420
513
|
label_border_width = 0,
|
|
421
514
|
label_border_color = "#ffffff",
|
|
422
515
|
label_border_radius = 0,
|
|
@@ -426,6 +519,10 @@ def create_information_message_box(
|
|
|
426
519
|
button_font_color = "#ffffff",
|
|
427
520
|
button_background_color = "#1e1e1e",
|
|
428
521
|
button_padding = 15,
|
|
522
|
+
button_padding_top = None,
|
|
523
|
+
button_padding_right = None,
|
|
524
|
+
button_padding_bottom = None,
|
|
525
|
+
button_padding_left = None,
|
|
429
526
|
button_border_width = 2,
|
|
430
527
|
button_border_color = "#5c5c5c",
|
|
431
528
|
button_border_radius = 0,
|
|
@@ -463,12 +560,15 @@ def create_information_message_box(
|
|
|
463
560
|
font_color= label_font_color,
|
|
464
561
|
background_color = "transparent",
|
|
465
562
|
padding = label_padding,
|
|
563
|
+
padding_top = label_padding_top,
|
|
564
|
+
padding_right = label_padding_right,
|
|
565
|
+
padding_bottom = label_padding_bottom,
|
|
566
|
+
padding_left = label_padding_left,
|
|
466
567
|
border_width = label_border_width,
|
|
467
568
|
border_color = label_border_color,
|
|
468
569
|
border_radius = label_border_radius
|
|
469
570
|
)
|
|
470
571
|
main_layout.addWidget(text_label)
|
|
471
|
-
|
|
472
572
|
accept_button = create_button(
|
|
473
573
|
text = button_text,
|
|
474
574
|
font_family = button_font_family,
|
|
@@ -476,6 +576,10 @@ def create_information_message_box(
|
|
|
476
576
|
font_color = button_font_color,
|
|
477
577
|
background_color = button_background_color,
|
|
478
578
|
padding = button_padding,
|
|
579
|
+
padding_top = button_padding_top,
|
|
580
|
+
padding_right = button_padding_right,
|
|
581
|
+
padding_bottom = button_padding_bottom,
|
|
582
|
+
padding_left = button_padding_left,
|
|
479
583
|
border_width = button_border_width,
|
|
480
584
|
border_color = button_border_color,
|
|
481
585
|
border_radius = button_border_radius,
|
|
@@ -510,6 +614,10 @@ def create_confirmation_message_box(
|
|
|
510
614
|
label_font_size = 14,
|
|
511
615
|
label_font_color = "#ffffff",
|
|
512
616
|
label_padding = 15,
|
|
617
|
+
label_padding_top = None,
|
|
618
|
+
label_padding_right = None,
|
|
619
|
+
label_padding_bottom = None,
|
|
620
|
+
label_padding_left = None,
|
|
513
621
|
label_border_width = 0,
|
|
514
622
|
label_border_color = "#ffffff",
|
|
515
623
|
label_border_radius = 0,
|
|
@@ -518,6 +626,10 @@ def create_confirmation_message_box(
|
|
|
518
626
|
button_font_color = "#ffffff",
|
|
519
627
|
button_background_color = "#1e1e1e",
|
|
520
628
|
button_padding = 15,
|
|
629
|
+
button_padding_top = None,
|
|
630
|
+
button_padding_right = None,
|
|
631
|
+
button_padding_bottom = None,
|
|
632
|
+
button_padding_left = None,
|
|
521
633
|
button_border_width = 2,
|
|
522
634
|
button_border_color = "#5c5c5c",
|
|
523
635
|
button_border_radius = 0,
|
|
@@ -548,8 +660,6 @@ def create_confirmation_message_box(
|
|
|
548
660
|
confirm_message_box.setLayout(main_layout)
|
|
549
661
|
main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
|
|
550
662
|
main_layout.setSpacing(main_spacing)
|
|
551
|
-
text_layout = QHBoxLayout()
|
|
552
|
-
main_layout.addLayout(text_layout)
|
|
553
663
|
text_label = create_label(
|
|
554
664
|
text = text,
|
|
555
665
|
font_family = label_font_family,
|
|
@@ -557,11 +667,15 @@ def create_confirmation_message_box(
|
|
|
557
667
|
font_color = label_font_color,
|
|
558
668
|
background_color = "transparent",
|
|
559
669
|
padding = label_padding,
|
|
670
|
+
padding_top = label_padding_top,
|
|
671
|
+
padding_right = label_padding_right,
|
|
672
|
+
padding_bottom = label_padding_bottom,
|
|
673
|
+
padding_left = label_padding_left,
|
|
560
674
|
border_width = label_border_width,
|
|
561
675
|
border_color = label_border_color,
|
|
562
676
|
border_radius = label_border_radius
|
|
563
677
|
)
|
|
564
|
-
|
|
678
|
+
main_layout.addWidget(text_label)
|
|
565
679
|
buttons_layout = QHBoxLayout()
|
|
566
680
|
main_layout.addLayout(buttons_layout)
|
|
567
681
|
buttons_layout.setSpacing(button_spacing)
|
|
@@ -572,6 +686,10 @@ def create_confirmation_message_box(
|
|
|
572
686
|
font_color = button_font_color,
|
|
573
687
|
background_color = button_background_color,
|
|
574
688
|
padding = button_padding,
|
|
689
|
+
padding_top = button_padding_top,
|
|
690
|
+
padding_right = button_padding_right,
|
|
691
|
+
padding_bottom = button_padding_bottom,
|
|
692
|
+
padding_left = button_padding_left,
|
|
575
693
|
border_width = button_border_width,
|
|
576
694
|
border_color = button_border_color,
|
|
577
695
|
border_radius = button_border_radius,
|
|
@@ -595,6 +713,10 @@ def create_confirmation_message_box(
|
|
|
595
713
|
font_color = button_font_color,
|
|
596
714
|
background_color = button_background_color,
|
|
597
715
|
padding = button_padding,
|
|
716
|
+
padding_top = button_padding_top,
|
|
717
|
+
padding_right = button_padding_right,
|
|
718
|
+
padding_bottom = button_padding_bottom,
|
|
719
|
+
padding_left = button_padding_left,
|
|
598
720
|
border_width = button_border_width,
|
|
599
721
|
border_color = button_border_color,
|
|
600
722
|
border_radius = button_border_radius,
|
|
@@ -613,6 +735,122 @@ def create_confirmation_message_box(
|
|
|
613
735
|
decline_button.clicked.connect(confirm_message_box.reject)
|
|
614
736
|
return confirm_message_box
|
|
615
737
|
|
|
738
|
+
def create_list_table(
|
|
739
|
+
items_data,
|
|
740
|
+
column_headers,
|
|
741
|
+
column_proportions,
|
|
742
|
+
row_populator_function,
|
|
743
|
+
font_family = "Segoe UI",
|
|
744
|
+
font_size = 14,
|
|
745
|
+
font_color = "#ffffff",
|
|
746
|
+
background_color = "#1e1e1e",
|
|
747
|
+
border_width = 2,
|
|
748
|
+
border_color = "#5c5c5c",
|
|
749
|
+
item_font_color = "#ffffff",
|
|
750
|
+
item_background_color = "#1e1e1e",
|
|
751
|
+
selected_item_background_color = "#0078d7",
|
|
752
|
+
header_font_family = "Segoe UI",
|
|
753
|
+
header_font_size = 14,
|
|
754
|
+
header_font_color = "#ffffff",
|
|
755
|
+
header_font_weight = "bold",
|
|
756
|
+
header_background_color = "#1e1e1e",
|
|
757
|
+
header_border_width = 1,
|
|
758
|
+
header_border_color = "#191919",
|
|
759
|
+
hover_header_background_color = "#333333",
|
|
760
|
+
hover_header_border_width = 3,
|
|
761
|
+
hover_header_border_color = "#777777",
|
|
762
|
+
pressed_header_background_color = "#4a4a4a",
|
|
763
|
+
pressed_header_border_width = 3,
|
|
764
|
+
pressed_header_border_color = "#0078d7",
|
|
765
|
+
scrollbar_background_color = "#1e1e1e",
|
|
766
|
+
scrollbar_handle_background_color = "#333333",
|
|
767
|
+
hover_scrollbar_handle_background_color = "#4a4a4a",
|
|
768
|
+
hover_scrollbar_handle_border_width = 3,
|
|
769
|
+
hover_scrollbar_handle_border_color = "#777777",
|
|
770
|
+
pressed_scrollbar_handle_background_color = "#4a4a4a",
|
|
771
|
+
pressed_scrollbar_handle_border_width = 3,
|
|
772
|
+
pressed_scrollbar_handle_border_color = "#0078d7"
|
|
773
|
+
):
|
|
774
|
+
list_table = QTableWidget()
|
|
775
|
+
list_table.verticalHeader().setVisible(False)
|
|
776
|
+
list_table.setColumnCount(len(column_headers))
|
|
777
|
+
list_table.setHorizontalHeaderLabels(column_headers)
|
|
778
|
+
header = list_table.horizontalHeader()
|
|
779
|
+
header.setSectionResizeMode(QHeaderView.ResizeMode.Interactive)
|
|
780
|
+
|
|
781
|
+
def resize_columns():
|
|
782
|
+
total_width = list_table.viewport().width()
|
|
783
|
+
if total_width == 0: return
|
|
784
|
+
for i, proportion in enumerate(column_proportions):
|
|
785
|
+
list_table.setColumnWidth(i, int(total_width * proportion))
|
|
786
|
+
|
|
787
|
+
resize_columns()
|
|
788
|
+
original_resize_event = list_table.resizeEvent
|
|
789
|
+
|
|
790
|
+
def on_resize(event):
|
|
791
|
+
resize_columns()
|
|
792
|
+
if original_resize_event: original_resize_event(event)
|
|
793
|
+
|
|
794
|
+
list_table.resizeEvent = on_resize
|
|
795
|
+
style_sheet = f"""
|
|
796
|
+
QTableWidget {{
|
|
797
|
+
color: {font_color};
|
|
798
|
+
background-color: {background_color};
|
|
799
|
+
font-family: {font_family};
|
|
800
|
+
font-size: {font_size}px;
|
|
801
|
+
border: {border_width}px solid {border_color};
|
|
802
|
+
}}
|
|
803
|
+
QTableWidget::item {{
|
|
804
|
+
color: {item_font_color};
|
|
805
|
+
background-color: {item_background_color};
|
|
806
|
+
border: none;
|
|
807
|
+
}}
|
|
808
|
+
QTableWidget::item:selected {{
|
|
809
|
+
background-color: {selected_item_background_color};
|
|
810
|
+
}}
|
|
811
|
+
QHeaderView::section {{
|
|
812
|
+
color: {header_font_color};
|
|
813
|
+
background-color: {header_background_color};
|
|
814
|
+
font-family: {header_font_family};
|
|
815
|
+
font-size: {header_font_size}px;
|
|
816
|
+
font-weight: {header_font_weight};
|
|
817
|
+
border: {header_border_width}px solid {header_border_color};
|
|
818
|
+
}}
|
|
819
|
+
QHeaderView::section:hover {{
|
|
820
|
+
background-color: {hover_header_background_color};
|
|
821
|
+
border: {hover_header_border_width}px solid {hover_header_border_color};
|
|
822
|
+
}}
|
|
823
|
+
QHeaderView::section:pressed {{
|
|
824
|
+
background-color: {pressed_header_background_color};
|
|
825
|
+
border: {pressed_header_border_width}px solid {pressed_header_border_color};
|
|
826
|
+
}}
|
|
827
|
+
QScrollBar:vertical {{
|
|
828
|
+
background-color: {scrollbar_background_color};
|
|
829
|
+
border: none;
|
|
830
|
+
}}
|
|
831
|
+
QScrollBar::handle:vertical {{
|
|
832
|
+
background-color: {scrollbar_handle_background_color};
|
|
833
|
+
border: none;
|
|
834
|
+
}}
|
|
835
|
+
QScrollBar::handle:vertical:hover {{
|
|
836
|
+
background-color: {hover_scrollbar_handle_background_color};
|
|
837
|
+
border: {hover_scrollbar_handle_border_width}px solid {hover_scrollbar_handle_border_color};
|
|
838
|
+
}}
|
|
839
|
+
QScrollBar::handle:vertical:pressed {{
|
|
840
|
+
background-color: {pressed_scrollbar_handle_background_color};
|
|
841
|
+
border: {pressed_scrollbar_handle_border_width}px solid {pressed_scrollbar_handle_border_color};
|
|
842
|
+
}}
|
|
843
|
+
"""
|
|
844
|
+
list_table.setStyleSheet(style_sheet)
|
|
845
|
+
list_table.setRowCount(len(items_data))
|
|
846
|
+
for row, item_data in enumerate(items_data):
|
|
847
|
+
items = row_populator_function(item_data)
|
|
848
|
+
for item in items:
|
|
849
|
+
item.setTextAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
850
|
+
for column, item in enumerate(items):
|
|
851
|
+
list_table.setItem(row, column, item)
|
|
852
|
+
return list_table
|
|
853
|
+
|
|
616
854
|
def confirm_exit(
|
|
617
855
|
window,
|
|
618
856
|
background_color = "#1e1e1e",
|
|
@@ -623,6 +861,10 @@ def confirm_exit(
|
|
|
623
861
|
label_font_size = 14,
|
|
624
862
|
label_font_color = "#ffffff",
|
|
625
863
|
label_padding = 15,
|
|
864
|
+
label_padding_top = None,
|
|
865
|
+
label_padding_right = None,
|
|
866
|
+
label_padding_bottom = None,
|
|
867
|
+
label_padding_left = None,
|
|
626
868
|
label_border_width = 0,
|
|
627
869
|
label_border_color = "#ffffff",
|
|
628
870
|
label_border_radius = 0,
|
|
@@ -631,6 +873,10 @@ def confirm_exit(
|
|
|
631
873
|
button_font_color = "#ffffff",
|
|
632
874
|
button_background_color = "#1e1e1e",
|
|
633
875
|
button_padding = 15,
|
|
876
|
+
button_padding_top = None,
|
|
877
|
+
button_padding_right = None,
|
|
878
|
+
button_padding_bottom = None,
|
|
879
|
+
button_padding_left = None,
|
|
634
880
|
button_border_width = 2,
|
|
635
881
|
button_border_color = "#5c5c5c",
|
|
636
882
|
button_border_radius = 0,
|
|
@@ -655,6 +901,10 @@ def confirm_exit(
|
|
|
655
901
|
label_font_size = label_font_size,
|
|
656
902
|
label_font_color = label_font_color,
|
|
657
903
|
label_padding = label_padding,
|
|
904
|
+
label_padding_top = label_padding_top,
|
|
905
|
+
label_padding_right = label_padding_right,
|
|
906
|
+
label_padding_bottom = label_padding_bottom,
|
|
907
|
+
label_padding_left = label_padding_left,
|
|
658
908
|
label_border_width = label_border_width,
|
|
659
909
|
label_border_color = label_border_color,
|
|
660
910
|
label_border_radius = label_border_radius,
|
|
@@ -663,6 +913,10 @@ def confirm_exit(
|
|
|
663
913
|
button_font_color = button_font_color,
|
|
664
914
|
button_background_color = button_background_color,
|
|
665
915
|
button_padding = button_padding,
|
|
916
|
+
button_padding_top = button_padding_top,
|
|
917
|
+
button_padding_right = button_padding_right,
|
|
918
|
+
button_padding_bottom = button_padding_bottom,
|
|
919
|
+
button_padding_left = button_padding_left,
|
|
666
920
|
button_border_width = button_border_width,
|
|
667
921
|
button_border_color = button_border_color,
|
|
668
922
|
button_border_radius = button_border_radius,
|
|
@@ -795,7 +1049,13 @@ def format_id(id_string):
|
|
|
795
1049
|
elif len(clean_id) == 7: return f"{clean_id[0:1]}.{clean_id[1:4]}.{clean_id[4:7]}"
|
|
796
1050
|
return id_string
|
|
797
1051
|
|
|
798
|
-
def
|
|
1052
|
+
def format_cellphone_number(cellphone_number):
|
|
799
1053
|
clean_number = "".join(filter(str.isdigit, cellphone_number))
|
|
800
1054
|
if len(clean_number) == 10: return f"{clean_number[0:4]} - {clean_number[4:10]}"
|
|
801
|
-
return cellphone_number
|
|
1055
|
+
return cellphone_number
|
|
1056
|
+
|
|
1057
|
+
def format_date(date):
|
|
1058
|
+
day = f"{date.day:02d}"
|
|
1059
|
+
month = f"{date.month:02d}"
|
|
1060
|
+
year = f"{date.year:,}".replace(",", ".")
|
|
1061
|
+
return f"{day}/{month}/{year}"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
gui_utilities/gui_utilities.py,sha256=OzysHZaH_OligFDbUh2OG-81IYU8iiC45qpGeNjQ8Fc,41927
|
|
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.19.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
|
|
8
|
+
gui_utilities-1.2.19.dist-info/METADATA,sha256=DG5CC35YB33yDUO96ZpmuO9W2P_9ceLRsbUD45DTT4U,266
|
|
9
|
+
gui_utilities-1.2.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
gui_utilities-1.2.19.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
|
|
11
|
+
gui_utilities-1.2.19.dist-info/RECORD,,
|
gui_utilities/icons/check.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,12 +0,0 @@
|
|
|
1
|
-
gui_utilities/gui_utilities.py,sha256=-f9hOL1M4xy7n-qpKGEyTRuONH0bXhPrG5D005QEtNQ,30685
|
|
2
|
-
gui_utilities/icons/check.svg,sha256=HHTjePt4C7XcmrMGZMBTyRTzR580bZ4IF82kEY0Y5Gw,232
|
|
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/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
|
|
7
|
-
gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
|
|
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
|