gui-utilities 1.1.10__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 +267 -22
- {gui_utilities-1.1.10.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/checked_verification_mark_icon.png +0 -0
- gui_utilities/icons/hover_verification_mark_icon.png +0 -0
- gui_utilities-1.1.10.dist-info/RECORD +0 -13
- {gui_utilities-1.1.10.dist-info → gui_utilities-1.2.19.dist-info}/WHEEL +0 -0
- {gui_utilities-1.1.10.dist-info → gui_utilities-1.2.19.dist-info}/licenses/LICENSE +0 -0
- {gui_utilities-1.1.10.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,
|
|
@@ -212,6 +254,10 @@ def create_text_box(
|
|
|
212
254
|
):
|
|
213
255
|
text_box = QLineEdit()
|
|
214
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
|
|
215
261
|
style_sheet = f"""
|
|
216
262
|
QLineEdit {{
|
|
217
263
|
font-family: {font_family};
|
|
@@ -219,7 +265,10 @@ def create_text_box(
|
|
|
219
265
|
color: {font_color};
|
|
220
266
|
font-weight: {font_weight};
|
|
221
267
|
background-color: {background_color};
|
|
222
|
-
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;
|
|
223
272
|
border: {border_width}px solid {border_color};
|
|
224
273
|
border-radius: {border_radius}px;
|
|
225
274
|
}}
|
|
@@ -253,12 +302,9 @@ def create_text_box(
|
|
|
253
302
|
toggle_text_visibility_action.setDefaultWidget(toggle_text_visibility_button)
|
|
254
303
|
style_sheet = f"""
|
|
255
304
|
QToolButton {{
|
|
256
|
-
border: none;
|
|
257
|
-
margin-right: 10px;
|
|
258
|
-
}}
|
|
259
|
-
QToolButton:hover, QToolButton:pressed {{
|
|
260
305
|
background-color: transparent;
|
|
261
306
|
border: none;
|
|
307
|
+
margin-right: 10px;
|
|
262
308
|
}}
|
|
263
309
|
"""
|
|
264
310
|
toggle_text_visibility_button.setStyleSheet(style_sheet)
|
|
@@ -297,6 +343,10 @@ def create_combo_box(
|
|
|
297
343
|
font_color = "#ffffff",
|
|
298
344
|
background_color = "#1e1e1e",
|
|
299
345
|
padding = 15,
|
|
346
|
+
padding_top = None,
|
|
347
|
+
padding_right = None,
|
|
348
|
+
padding_bottom = None,
|
|
349
|
+
padding_left = None,
|
|
300
350
|
border_width = 2,
|
|
301
351
|
border_color = "#5c5c5c",
|
|
302
352
|
border_radius = 0,
|
|
@@ -318,6 +368,11 @@ def create_combo_box(
|
|
|
318
368
|
combo_box.addItems(items)
|
|
319
369
|
combo_box.setCurrentIndex(-1)
|
|
320
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
|
+
|
|
321
376
|
def get_stylesheet(font_color):
|
|
322
377
|
return f"""
|
|
323
378
|
QComboBox {{
|
|
@@ -325,7 +380,10 @@ def create_combo_box(
|
|
|
325
380
|
font-size: {font_size}px;
|
|
326
381
|
color: {font_color};
|
|
327
382
|
background-color: {background_color};
|
|
328
|
-
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;
|
|
329
387
|
border: {border_width}px solid {border_color};
|
|
330
388
|
border-radius: {border_radius}px;
|
|
331
389
|
}}
|
|
@@ -363,35 +421,49 @@ def create_checkbox(
|
|
|
363
421
|
font_size = 14,
|
|
364
422
|
font_color = "#ffffff",
|
|
365
423
|
background_color = "#1e1e1e",
|
|
366
|
-
padding =
|
|
424
|
+
padding = 5,
|
|
425
|
+
padding_top = None,
|
|
426
|
+
padding_right = None,
|
|
427
|
+
padding_bottom = None,
|
|
428
|
+
padding_left = None,
|
|
367
429
|
indicator_background_color = "#1e1e1e",
|
|
368
430
|
indicator_border_width = 1,
|
|
369
431
|
indicator_border_color = "#5c5c5c",
|
|
370
|
-
indicator_border_radius =
|
|
432
|
+
indicator_border_radius = 8,
|
|
371
433
|
hover_indicator_background_color = "#333333",
|
|
372
434
|
hover_indicator_border_width = 2,
|
|
373
435
|
hover_indicator_border_color = "#777777",
|
|
374
436
|
pressed_indicator_background_color = "#4a4a4a",
|
|
375
437
|
pressed_indicator_border_width = 2,
|
|
376
438
|
pressed_indicator_border_color = "#0078d7",
|
|
377
|
-
checked_indicator_background_color = "#
|
|
378
|
-
checked_indicator_border_width =
|
|
379
|
-
checked_indicator_border_color = "#
|
|
439
|
+
checked_indicator_background_color = "#ffffff",
|
|
440
|
+
checked_indicator_border_width = 1,
|
|
441
|
+
checked_indicator_border_color = "#5c5c5c",
|
|
380
442
|
disabled_font_color = "#888888",
|
|
381
443
|
disabled_background_color = "#2d2d2d",
|
|
382
444
|
disabled_border_width = 1,
|
|
383
445
|
disabled_border_color = "#4a4a4a"
|
|
384
446
|
):
|
|
385
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
|
|
386
452
|
style_sheet = f"""
|
|
387
453
|
QCheckBox {{
|
|
388
454
|
font-family: {font_family};
|
|
389
455
|
font-size: {font_size}px;
|
|
390
456
|
color: {font_color};
|
|
391
457
|
background-color: {background_color};
|
|
392
|
-
padding: {
|
|
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;
|
|
393
462
|
}}
|
|
394
463
|
QCheckBox::indicator {{
|
|
464
|
+
image: none;
|
|
465
|
+
width: {font_size}px;
|
|
466
|
+
height: {font_size}px;
|
|
395
467
|
background-color: {indicator_background_color};
|
|
396
468
|
border: {indicator_border_width}px solid {indicator_border_color};
|
|
397
469
|
border-radius: {indicator_border_radius}px;
|
|
@@ -408,8 +480,10 @@ def create_checkbox(
|
|
|
408
480
|
background-color: {checked_indicator_background_color};
|
|
409
481
|
border: {checked_indicator_border_width}px solid {checked_indicator_border_color};
|
|
410
482
|
}}
|
|
411
|
-
QCheckBox
|
|
483
|
+
QCheckBox:disabled {{
|
|
412
484
|
color: {disabled_font_color};
|
|
485
|
+
}}
|
|
486
|
+
QCheckBox::indicator:disabled {{
|
|
413
487
|
background-color: {disabled_background_color};
|
|
414
488
|
border: {disabled_border_width}px solid {disabled_border_color};
|
|
415
489
|
}}
|
|
@@ -432,6 +506,10 @@ def create_information_message_box(
|
|
|
432
506
|
label_font_size = 14,
|
|
433
507
|
label_font_color = "#ffffff",
|
|
434
508
|
label_padding = 15,
|
|
509
|
+
label_padding_top = None,
|
|
510
|
+
label_padding_right = None,
|
|
511
|
+
label_padding_bottom = None,
|
|
512
|
+
label_padding_left = None,
|
|
435
513
|
label_border_width = 0,
|
|
436
514
|
label_border_color = "#ffffff",
|
|
437
515
|
label_border_radius = 0,
|
|
@@ -441,6 +519,10 @@ def create_information_message_box(
|
|
|
441
519
|
button_font_color = "#ffffff",
|
|
442
520
|
button_background_color = "#1e1e1e",
|
|
443
521
|
button_padding = 15,
|
|
522
|
+
button_padding_top = None,
|
|
523
|
+
button_padding_right = None,
|
|
524
|
+
button_padding_bottom = None,
|
|
525
|
+
button_padding_left = None,
|
|
444
526
|
button_border_width = 2,
|
|
445
527
|
button_border_color = "#5c5c5c",
|
|
446
528
|
button_border_radius = 0,
|
|
@@ -478,12 +560,15 @@ def create_information_message_box(
|
|
|
478
560
|
font_color= label_font_color,
|
|
479
561
|
background_color = "transparent",
|
|
480
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,
|
|
481
567
|
border_width = label_border_width,
|
|
482
568
|
border_color = label_border_color,
|
|
483
569
|
border_radius = label_border_radius
|
|
484
570
|
)
|
|
485
571
|
main_layout.addWidget(text_label)
|
|
486
|
-
|
|
487
572
|
accept_button = create_button(
|
|
488
573
|
text = button_text,
|
|
489
574
|
font_family = button_font_family,
|
|
@@ -491,6 +576,10 @@ def create_information_message_box(
|
|
|
491
576
|
font_color = button_font_color,
|
|
492
577
|
background_color = button_background_color,
|
|
493
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,
|
|
494
583
|
border_width = button_border_width,
|
|
495
584
|
border_color = button_border_color,
|
|
496
585
|
border_radius = button_border_radius,
|
|
@@ -525,6 +614,10 @@ def create_confirmation_message_box(
|
|
|
525
614
|
label_font_size = 14,
|
|
526
615
|
label_font_color = "#ffffff",
|
|
527
616
|
label_padding = 15,
|
|
617
|
+
label_padding_top = None,
|
|
618
|
+
label_padding_right = None,
|
|
619
|
+
label_padding_bottom = None,
|
|
620
|
+
label_padding_left = None,
|
|
528
621
|
label_border_width = 0,
|
|
529
622
|
label_border_color = "#ffffff",
|
|
530
623
|
label_border_radius = 0,
|
|
@@ -533,6 +626,10 @@ def create_confirmation_message_box(
|
|
|
533
626
|
button_font_color = "#ffffff",
|
|
534
627
|
button_background_color = "#1e1e1e",
|
|
535
628
|
button_padding = 15,
|
|
629
|
+
button_padding_top = None,
|
|
630
|
+
button_padding_right = None,
|
|
631
|
+
button_padding_bottom = None,
|
|
632
|
+
button_padding_left = None,
|
|
536
633
|
button_border_width = 2,
|
|
537
634
|
button_border_color = "#5c5c5c",
|
|
538
635
|
button_border_radius = 0,
|
|
@@ -563,8 +660,6 @@ def create_confirmation_message_box(
|
|
|
563
660
|
confirm_message_box.setLayout(main_layout)
|
|
564
661
|
main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
|
|
565
662
|
main_layout.setSpacing(main_spacing)
|
|
566
|
-
text_layout = QHBoxLayout()
|
|
567
|
-
main_layout.addLayout(text_layout)
|
|
568
663
|
text_label = create_label(
|
|
569
664
|
text = text,
|
|
570
665
|
font_family = label_font_family,
|
|
@@ -572,11 +667,15 @@ def create_confirmation_message_box(
|
|
|
572
667
|
font_color = label_font_color,
|
|
573
668
|
background_color = "transparent",
|
|
574
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,
|
|
575
674
|
border_width = label_border_width,
|
|
576
675
|
border_color = label_border_color,
|
|
577
676
|
border_radius = label_border_radius
|
|
578
677
|
)
|
|
579
|
-
|
|
678
|
+
main_layout.addWidget(text_label)
|
|
580
679
|
buttons_layout = QHBoxLayout()
|
|
581
680
|
main_layout.addLayout(buttons_layout)
|
|
582
681
|
buttons_layout.setSpacing(button_spacing)
|
|
@@ -587,6 +686,10 @@ def create_confirmation_message_box(
|
|
|
587
686
|
font_color = button_font_color,
|
|
588
687
|
background_color = button_background_color,
|
|
589
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,
|
|
590
693
|
border_width = button_border_width,
|
|
591
694
|
border_color = button_border_color,
|
|
592
695
|
border_radius = button_border_radius,
|
|
@@ -610,6 +713,10 @@ def create_confirmation_message_box(
|
|
|
610
713
|
font_color = button_font_color,
|
|
611
714
|
background_color = button_background_color,
|
|
612
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,
|
|
613
720
|
border_width = button_border_width,
|
|
614
721
|
border_color = button_border_color,
|
|
615
722
|
border_radius = button_border_radius,
|
|
@@ -628,6 +735,122 @@ def create_confirmation_message_box(
|
|
|
628
735
|
decline_button.clicked.connect(confirm_message_box.reject)
|
|
629
736
|
return confirm_message_box
|
|
630
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
|
+
|
|
631
854
|
def confirm_exit(
|
|
632
855
|
window,
|
|
633
856
|
background_color = "#1e1e1e",
|
|
@@ -638,6 +861,10 @@ def confirm_exit(
|
|
|
638
861
|
label_font_size = 14,
|
|
639
862
|
label_font_color = "#ffffff",
|
|
640
863
|
label_padding = 15,
|
|
864
|
+
label_padding_top = None,
|
|
865
|
+
label_padding_right = None,
|
|
866
|
+
label_padding_bottom = None,
|
|
867
|
+
label_padding_left = None,
|
|
641
868
|
label_border_width = 0,
|
|
642
869
|
label_border_color = "#ffffff",
|
|
643
870
|
label_border_radius = 0,
|
|
@@ -646,6 +873,10 @@ def confirm_exit(
|
|
|
646
873
|
button_font_color = "#ffffff",
|
|
647
874
|
button_background_color = "#1e1e1e",
|
|
648
875
|
button_padding = 15,
|
|
876
|
+
button_padding_top = None,
|
|
877
|
+
button_padding_right = None,
|
|
878
|
+
button_padding_bottom = None,
|
|
879
|
+
button_padding_left = None,
|
|
649
880
|
button_border_width = 2,
|
|
650
881
|
button_border_color = "#5c5c5c",
|
|
651
882
|
button_border_radius = 0,
|
|
@@ -670,6 +901,10 @@ def confirm_exit(
|
|
|
670
901
|
label_font_size = label_font_size,
|
|
671
902
|
label_font_color = label_font_color,
|
|
672
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,
|
|
673
908
|
label_border_width = label_border_width,
|
|
674
909
|
label_border_color = label_border_color,
|
|
675
910
|
label_border_radius = label_border_radius,
|
|
@@ -678,6 +913,10 @@ def confirm_exit(
|
|
|
678
913
|
button_font_color = button_font_color,
|
|
679
914
|
button_background_color = button_background_color,
|
|
680
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,
|
|
681
920
|
button_border_width = button_border_width,
|
|
682
921
|
button_border_color = button_border_color,
|
|
683
922
|
button_border_radius = button_border_radius,
|
|
@@ -810,7 +1049,13 @@ def format_id(id_string):
|
|
|
810
1049
|
elif len(clean_id) == 7: return f"{clean_id[0:1]}.{clean_id[1:4]}.{clean_id[4:7]}"
|
|
811
1050
|
return id_string
|
|
812
1051
|
|
|
813
|
-
def
|
|
1052
|
+
def format_cellphone_number(cellphone_number):
|
|
814
1053
|
clean_number = "".join(filter(str.isdigit, cellphone_number))
|
|
815
1054
|
if len(clean_number) == 10: return f"{clean_number[0:4]} - {clean_number[4:10]}"
|
|
816
|
-
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,,
|
|
Binary file
|
|
Binary file
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
gui_utilities/gui_utilities.py,sha256=kLXT5eyDbUapBLTUxWtXVMGRjpz_RcLu1FCpsOaXjPQ,31616
|
|
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.10.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
|
|
10
|
-
gui_utilities-1.1.10.dist-info/METADATA,sha256=96LGNAh-CYxL0Jf7eaw2AmiJ3dk0183ILKvtGrzd4jI,266
|
|
11
|
-
gui_utilities-1.1.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
gui_utilities-1.1.10.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
|
|
13
|
-
gui_utilities-1.1.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|