gui-utilities 1.1.14__tar.gz → 1.3.6__tar.gz
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-1.1.14 → gui_utilities-1.3.6}/PKG-INFO +1 -1
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities/gui_utilities.py +319 -27
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities.egg-info/PKG-INFO +1 -1
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities.egg-info/SOURCES.txt +0 -2
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/pyproject.toml +1 -1
- gui_utilities-1.1.14/gui_utilities/icons/checked_verification_mark_icon.png +0 -0
- gui_utilities-1.1.14/gui_utilities/icons/hover_verification_mark_icon.png +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/LICENSE +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/README.md +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities/icons/focused_hide_text_icon.png +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities/icons/focused_show_text_icon.png +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities/icons/hide_text_icon.png +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities/icons/show_text_icon.png +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities/tlds/tlds_list.txt +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities.egg-info/dependency_links.txt +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities.egg-info/requires.txt +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/gui_utilities.egg-info/top_level.txt +0 -0
- {gui_utilities-1.1.14 → gui_utilities-1.3.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
3
|
-
from PyQt6.QtGui import QIcon
|
|
2
|
+
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QComboBox, QDialog, QToolButton, QWidgetAction, QCheckBox, QTableWidget, QHeaderView
|
|
3
|
+
from PyQt6.QtGui import QIcon, QFont, QFontMetrics
|
|
4
4
|
import re
|
|
5
5
|
import requests
|
|
6
6
|
import importlib.resources
|
|
@@ -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_left = None,
|
|
31
|
+
title_padding_top = None,
|
|
32
|
+
title_padding_right = None,
|
|
33
|
+
title_padding_bottom = 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_left = title_padding_left,
|
|
48
|
+
padding_top = title_padding_top,
|
|
49
|
+
padding_right = title_padding_right,
|
|
50
|
+
padding_bottom = title_padding_bottom,
|
|
43
51
|
border_width = title_border_width,
|
|
44
52
|
border_color = title_border_color,
|
|
45
53
|
border_radius = title_border_radius
|
|
@@ -77,6 +85,46 @@ def create_form(
|
|
|
77
85
|
body_layout.setStretch(1, 4)
|
|
78
86
|
return main_layout
|
|
79
87
|
|
|
88
|
+
def create_header(
|
|
89
|
+
title,
|
|
90
|
+
margin_left = 25,
|
|
91
|
+
margin_top = 25,
|
|
92
|
+
margin_right = 25,
|
|
93
|
+
margin_bottom = 25,
|
|
94
|
+
title_font_family = "Segoe UI",
|
|
95
|
+
title_font_size = 36,
|
|
96
|
+
title_font_color = "#ffffff",
|
|
97
|
+
title_background_color = "#1e1e1e",
|
|
98
|
+
title_padding = 15,
|
|
99
|
+
title_padding_left = None,
|
|
100
|
+
title_padding_top = None,
|
|
101
|
+
title_padding_right = None,
|
|
102
|
+
title_padding_bottom = None,
|
|
103
|
+
title_border_width = 0,
|
|
104
|
+
title_border_color = "#ffffff",
|
|
105
|
+
title_border_radius = 0
|
|
106
|
+
):
|
|
107
|
+
main_layout = QVBoxLayout()
|
|
108
|
+
main_layout.setContentsMargins(margin_left, margin_top, margin_right, margin_bottom)
|
|
109
|
+
title_layout = create_title(
|
|
110
|
+
text = title,
|
|
111
|
+
font_family = title_font_family,
|
|
112
|
+
font_size = title_font_size,
|
|
113
|
+
font_color = title_font_color,
|
|
114
|
+
background_color = title_background_color,
|
|
115
|
+
padding = title_padding,
|
|
116
|
+
padding_left = title_padding_left,
|
|
117
|
+
padding_top = title_padding_top,
|
|
118
|
+
padding_right = title_padding_right,
|
|
119
|
+
padding_bottom = title_padding_bottom,
|
|
120
|
+
border_width = title_border_width,
|
|
121
|
+
border_color = title_border_color,
|
|
122
|
+
border_radius = title_border_radius
|
|
123
|
+
)
|
|
124
|
+
main_layout.addLayout(title_layout)
|
|
125
|
+
main_layout.addStretch()
|
|
126
|
+
return main_layout
|
|
127
|
+
|
|
80
128
|
def create_title(
|
|
81
129
|
text,
|
|
82
130
|
font_family = "Segoe UI",
|
|
@@ -84,6 +132,10 @@ def create_title(
|
|
|
84
132
|
font_color = "#ffffff",
|
|
85
133
|
background_color = "#1e1e1e",
|
|
86
134
|
padding = 15,
|
|
135
|
+
padding_left = None,
|
|
136
|
+
padding_top = None,
|
|
137
|
+
padding_right = None,
|
|
138
|
+
padding_bottom = None,
|
|
87
139
|
border_width = 0,
|
|
88
140
|
border_color = "#ffffff",
|
|
89
141
|
border_radius = 0
|
|
@@ -99,6 +151,10 @@ def create_title(
|
|
|
99
151
|
font_weight = "bold",
|
|
100
152
|
background_color = background_color,
|
|
101
153
|
padding = padding,
|
|
154
|
+
padding_left = padding_left,
|
|
155
|
+
padding_top = padding_top,
|
|
156
|
+
padding_right = padding_right,
|
|
157
|
+
padding_bottom = padding_bottom,
|
|
102
158
|
border_width = border_width,
|
|
103
159
|
border_color = border_color,
|
|
104
160
|
border_radius = border_radius
|
|
@@ -114,18 +170,29 @@ def create_label(
|
|
|
114
170
|
font_weight = "normal",
|
|
115
171
|
background_color = "#1e1e1e",
|
|
116
172
|
padding = 15,
|
|
173
|
+
padding_left = None,
|
|
174
|
+
padding_top = None,
|
|
175
|
+
padding_right = None,
|
|
176
|
+
padding_bottom = None,
|
|
117
177
|
border_width = 0,
|
|
118
178
|
border_color = "#ffffff",
|
|
119
179
|
border_radius = 0
|
|
120
180
|
):
|
|
121
181
|
label = QLabel(text)
|
|
182
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
183
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
184
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
185
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
122
186
|
style = f"""
|
|
123
187
|
font-family: {font_family};
|
|
124
188
|
font-size: {font_size}px;
|
|
125
189
|
color: {font_color};
|
|
126
190
|
font-weight: {font_weight};
|
|
127
191
|
background-color: {background_color};
|
|
128
|
-
padding: {
|
|
192
|
+
padding-left: {padding_left_value}px;
|
|
193
|
+
padding-top: {padding_top_value}px;
|
|
194
|
+
padding-right: {padding_right_value}px;
|
|
195
|
+
padding-bottom: {padding_bottom_value}px;
|
|
129
196
|
border: {border_width}px solid {border_color};
|
|
130
197
|
border-radius: {border_radius}px;
|
|
131
198
|
"""
|
|
@@ -140,6 +207,10 @@ def create_button(
|
|
|
140
207
|
font_weight = "bold",
|
|
141
208
|
background_color = "#1e1e1e",
|
|
142
209
|
padding = 15,
|
|
210
|
+
padding_left = None,
|
|
211
|
+
padding_top = None,
|
|
212
|
+
padding_right = None,
|
|
213
|
+
padding_bottom = None,
|
|
143
214
|
border_width = 2,
|
|
144
215
|
border_color = "#5c5c5c",
|
|
145
216
|
border_radius = 0,
|
|
@@ -154,7 +225,17 @@ def create_button(
|
|
|
154
225
|
disabled_border_width = 2,
|
|
155
226
|
disabled_border_color = "#4a4a4a"
|
|
156
227
|
):
|
|
157
|
-
button = QPushButton(
|
|
228
|
+
button = QPushButton()
|
|
229
|
+
button.setMaximumWidth(360)
|
|
230
|
+
main_layout = QVBoxLayout(button)
|
|
231
|
+
label = create_label(text = text, font_size = 16, font_weight = "bold", padding = 0)
|
|
232
|
+
label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
233
|
+
label.setWordWrap(True)
|
|
234
|
+
main_layout.addWidget(label)
|
|
235
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
236
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
237
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
238
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
158
239
|
style_sheet = f"""
|
|
159
240
|
QPushButton {{
|
|
160
241
|
font-family: {font_family};
|
|
@@ -162,7 +243,10 @@ def create_button(
|
|
|
162
243
|
color: {font_color};
|
|
163
244
|
font-weight: {font_weight};
|
|
164
245
|
background-color: {background_color};
|
|
165
|
-
padding: {
|
|
246
|
+
padding-left: {padding_left_value}px;
|
|
247
|
+
padding-top: {padding_top_value}px;
|
|
248
|
+
padding-right: {padding_right_value}px;
|
|
249
|
+
padding-bottom: {padding_bottom_value}px;
|
|
166
250
|
border: {border_width}px solid {border_color};
|
|
167
251
|
border-radius: {border_radius}px;
|
|
168
252
|
}}
|
|
@@ -191,6 +275,10 @@ def create_text_box(
|
|
|
191
275
|
font_weight = "normal",
|
|
192
276
|
background_color = "#1e1e1e",
|
|
193
277
|
padding = 15,
|
|
278
|
+
padding_left = None,
|
|
279
|
+
padding_top = None,
|
|
280
|
+
padding_right = None,
|
|
281
|
+
padding_bottom = None,
|
|
194
282
|
border_width = 2,
|
|
195
283
|
border_color = "#5c5c5c",
|
|
196
284
|
border_radius = 0,
|
|
@@ -212,6 +300,10 @@ def create_text_box(
|
|
|
212
300
|
):
|
|
213
301
|
text_box = QLineEdit()
|
|
214
302
|
text_box.setPlaceholderText(placeholder_text)
|
|
303
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
304
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
305
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
306
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
215
307
|
style_sheet = f"""
|
|
216
308
|
QLineEdit {{
|
|
217
309
|
font-family: {font_family};
|
|
@@ -219,7 +311,10 @@ def create_text_box(
|
|
|
219
311
|
color: {font_color};
|
|
220
312
|
font-weight: {font_weight};
|
|
221
313
|
background-color: {background_color};
|
|
222
|
-
padding: {
|
|
314
|
+
padding-left: {padding_left_value}px;
|
|
315
|
+
padding-top: {padding_top_value}px;
|
|
316
|
+
padding-right: {padding_right_value}px;
|
|
317
|
+
padding-bottom: {padding_bottom_value}px;
|
|
223
318
|
border: {border_width}px solid {border_color};
|
|
224
319
|
border-radius: {border_radius}px;
|
|
225
320
|
}}
|
|
@@ -253,12 +348,9 @@ def create_text_box(
|
|
|
253
348
|
toggle_text_visibility_action.setDefaultWidget(toggle_text_visibility_button)
|
|
254
349
|
style_sheet = f"""
|
|
255
350
|
QToolButton {{
|
|
256
|
-
border: none;
|
|
257
|
-
margin-right: 10px;
|
|
258
|
-
}}
|
|
259
|
-
QToolButton:hover, QToolButton:pressed {{
|
|
260
351
|
background-color: transparent;
|
|
261
352
|
border: none;
|
|
353
|
+
margin-right: 10px;
|
|
262
354
|
}}
|
|
263
355
|
"""
|
|
264
356
|
toggle_text_visibility_button.setStyleSheet(style_sheet)
|
|
@@ -297,6 +389,10 @@ def create_combo_box(
|
|
|
297
389
|
font_color = "#ffffff",
|
|
298
390
|
background_color = "#1e1e1e",
|
|
299
391
|
padding = 15,
|
|
392
|
+
padding_left = None,
|
|
393
|
+
padding_top = None,
|
|
394
|
+
padding_right = None,
|
|
395
|
+
padding_bottom = None,
|
|
300
396
|
border_width = 2,
|
|
301
397
|
border_color = "#5c5c5c",
|
|
302
398
|
border_radius = 0,
|
|
@@ -318,6 +414,11 @@ def create_combo_box(
|
|
|
318
414
|
combo_box.addItems(items)
|
|
319
415
|
combo_box.setCurrentIndex(-1)
|
|
320
416
|
|
|
417
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
418
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
419
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
420
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
421
|
+
|
|
321
422
|
def get_stylesheet(font_color):
|
|
322
423
|
return f"""
|
|
323
424
|
QComboBox {{
|
|
@@ -325,7 +426,10 @@ def create_combo_box(
|
|
|
325
426
|
font-size: {font_size}px;
|
|
326
427
|
color: {font_color};
|
|
327
428
|
background-color: {background_color};
|
|
328
|
-
padding: {
|
|
429
|
+
padding-left: {padding_left_value}px;
|
|
430
|
+
padding-top: {padding_top_value}px;
|
|
431
|
+
padding-right: {padding_right_value}px;
|
|
432
|
+
padding-bottom: {padding_bottom_value}px;
|
|
329
433
|
border: {border_width}px solid {border_color};
|
|
330
434
|
border-radius: {border_radius}px;
|
|
331
435
|
}}
|
|
@@ -364,6 +468,10 @@ def create_checkbox(
|
|
|
364
468
|
font_color = "#ffffff",
|
|
365
469
|
background_color = "#1e1e1e",
|
|
366
470
|
padding = 5,
|
|
471
|
+
padding_left = None,
|
|
472
|
+
padding_top = None,
|
|
473
|
+
padding_right = None,
|
|
474
|
+
padding_bottom = None,
|
|
367
475
|
indicator_background_color = "#1e1e1e",
|
|
368
476
|
indicator_border_width = 1,
|
|
369
477
|
indicator_border_color = "#5c5c5c",
|
|
@@ -376,20 +484,27 @@ def create_checkbox(
|
|
|
376
484
|
pressed_indicator_border_color = "#0078d7",
|
|
377
485
|
checked_indicator_background_color = "#ffffff",
|
|
378
486
|
checked_indicator_border_width = 1,
|
|
379
|
-
checked_indicator_border_color = "#
|
|
487
|
+
checked_indicator_border_color = "#5c5c5c",
|
|
380
488
|
disabled_font_color = "#888888",
|
|
381
489
|
disabled_background_color = "#2d2d2d",
|
|
382
490
|
disabled_border_width = 1,
|
|
383
491
|
disabled_border_color = "#4a4a4a"
|
|
384
492
|
):
|
|
385
493
|
check_box = QCheckBox(text)
|
|
494
|
+
padding_left_value = padding_left if padding_left is not None else padding
|
|
495
|
+
padding_top_value = padding_top if padding_top is not None else padding
|
|
496
|
+
padding_right_value = padding_right if padding_right is not None else padding
|
|
497
|
+
padding_bottom_value = padding_bottom if padding_bottom is not None else padding
|
|
386
498
|
style_sheet = f"""
|
|
387
499
|
QCheckBox {{
|
|
388
500
|
font-family: {font_family};
|
|
389
501
|
font-size: {font_size}px;
|
|
390
502
|
color: {font_color};
|
|
391
503
|
background-color: {background_color};
|
|
392
|
-
padding: {
|
|
504
|
+
padding-left: {padding_left_value}px;
|
|
505
|
+
padding-top: {padding_top_value}px;
|
|
506
|
+
padding-right: {padding_right_value}px;
|
|
507
|
+
padding-bottom: {padding_bottom_value}px;
|
|
393
508
|
}}
|
|
394
509
|
QCheckBox::indicator {{
|
|
395
510
|
image: none;
|
|
@@ -411,21 +526,23 @@ def create_checkbox(
|
|
|
411
526
|
background-color: {checked_indicator_background_color};
|
|
412
527
|
border: {checked_indicator_border_width}px solid {checked_indicator_border_color};
|
|
413
528
|
}}
|
|
414
|
-
QCheckBox
|
|
529
|
+
QCheckBox:disabled {{
|
|
415
530
|
color: {disabled_font_color};
|
|
531
|
+
}}
|
|
532
|
+
QCheckBox::indicator:disabled {{
|
|
416
533
|
background-color: {disabled_background_color};
|
|
417
534
|
border: {disabled_border_width}px solid {disabled_border_color};
|
|
418
535
|
}}
|
|
419
|
-
"""
|
|
536
|
+
"""
|
|
420
537
|
check_box.setStyleSheet(style_sheet)
|
|
421
538
|
return check_box
|
|
422
539
|
|
|
423
540
|
def create_information_message_box(
|
|
424
541
|
text,
|
|
425
|
-
top_margin = 25,
|
|
426
|
-
bottom_margin = 25,
|
|
427
542
|
left_margin = 25,
|
|
543
|
+
top_margin = 25,
|
|
428
544
|
right_margin = 25,
|
|
545
|
+
bottom_margin = 25,
|
|
429
546
|
spacing = 10,
|
|
430
547
|
background_color = "#1e1e1e",
|
|
431
548
|
border_width = 2,
|
|
@@ -435,6 +552,10 @@ def create_information_message_box(
|
|
|
435
552
|
label_font_size = 14,
|
|
436
553
|
label_font_color = "#ffffff",
|
|
437
554
|
label_padding = 15,
|
|
555
|
+
label_padding_left = None,
|
|
556
|
+
label_padding_top = None,
|
|
557
|
+
label_padding_right = None,
|
|
558
|
+
label_padding_bottom = None,
|
|
438
559
|
label_border_width = 0,
|
|
439
560
|
label_border_color = "#ffffff",
|
|
440
561
|
label_border_radius = 0,
|
|
@@ -444,6 +565,10 @@ def create_information_message_box(
|
|
|
444
565
|
button_font_color = "#ffffff",
|
|
445
566
|
button_background_color = "#1e1e1e",
|
|
446
567
|
button_padding = 15,
|
|
568
|
+
button_padding_left = None,
|
|
569
|
+
button_padding_top = None,
|
|
570
|
+
button_padding_right = None,
|
|
571
|
+
button_padding_bottom = None,
|
|
447
572
|
button_border_width = 2,
|
|
448
573
|
button_border_color = "#5c5c5c",
|
|
449
574
|
button_border_radius = 0,
|
|
@@ -461,7 +586,7 @@ def create_information_message_box(
|
|
|
461
586
|
message_box = QDialog()
|
|
462
587
|
message_box.setObjectName("message_box")
|
|
463
588
|
message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
464
|
-
message_box.
|
|
589
|
+
message_box.setFixedWidth(360)
|
|
465
590
|
style_sheet = f"""
|
|
466
591
|
QDialog#message_box {{
|
|
467
592
|
background-color: {background_color};
|
|
@@ -481,12 +606,17 @@ def create_information_message_box(
|
|
|
481
606
|
font_color= label_font_color,
|
|
482
607
|
background_color = "transparent",
|
|
483
608
|
padding = label_padding,
|
|
609
|
+
padding_left = label_padding_left,
|
|
610
|
+
padding_top = label_padding_top,
|
|
611
|
+
padding_right = label_padding_right,
|
|
612
|
+
padding_bottom = label_padding_bottom,
|
|
484
613
|
border_width = label_border_width,
|
|
485
614
|
border_color = label_border_color,
|
|
486
615
|
border_radius = label_border_radius
|
|
487
616
|
)
|
|
488
617
|
main_layout.addWidget(text_label)
|
|
489
|
-
|
|
618
|
+
text_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
619
|
+
text_label.setWordWrap(True)
|
|
490
620
|
accept_button = create_button(
|
|
491
621
|
text = button_text,
|
|
492
622
|
font_family = button_font_family,
|
|
@@ -494,6 +624,10 @@ def create_information_message_box(
|
|
|
494
624
|
font_color = button_font_color,
|
|
495
625
|
background_color = button_background_color,
|
|
496
626
|
padding = button_padding,
|
|
627
|
+
padding_left = button_padding_left,
|
|
628
|
+
padding_top = button_padding_top,
|
|
629
|
+
padding_right = button_padding_right,
|
|
630
|
+
padding_bottom = button_padding_bottom,
|
|
497
631
|
border_width = button_border_width,
|
|
498
632
|
border_color = button_border_color,
|
|
499
633
|
border_radius = button_border_radius,
|
|
@@ -514,10 +648,10 @@ def create_information_message_box(
|
|
|
514
648
|
|
|
515
649
|
def create_confirmation_message_box(
|
|
516
650
|
text,
|
|
517
|
-
top_margin = 25,
|
|
518
|
-
bottom_margin = 25,
|
|
519
651
|
left_margin = 25,
|
|
652
|
+
top_margin = 25,
|
|
520
653
|
right_margin = 25,
|
|
654
|
+
bottom_margin = 25,
|
|
521
655
|
main_spacing = 10,
|
|
522
656
|
button_spacing = 10,
|
|
523
657
|
background_color = "#1e1e1e",
|
|
@@ -528,6 +662,10 @@ def create_confirmation_message_box(
|
|
|
528
662
|
label_font_size = 14,
|
|
529
663
|
label_font_color = "#ffffff",
|
|
530
664
|
label_padding = 15,
|
|
665
|
+
label_padding_left = None,
|
|
666
|
+
label_padding_top = None,
|
|
667
|
+
label_padding_right = None,
|
|
668
|
+
label_padding_bottom = None,
|
|
531
669
|
label_border_width = 0,
|
|
532
670
|
label_border_color = "#ffffff",
|
|
533
671
|
label_border_radius = 0,
|
|
@@ -536,6 +674,10 @@ def create_confirmation_message_box(
|
|
|
536
674
|
button_font_color = "#ffffff",
|
|
537
675
|
button_background_color = "#1e1e1e",
|
|
538
676
|
button_padding = 15,
|
|
677
|
+
button_padding_left = None,
|
|
678
|
+
button_padding_top = None,
|
|
679
|
+
button_padding_right = None,
|
|
680
|
+
button_padding_bottom = None,
|
|
539
681
|
button_border_width = 2,
|
|
540
682
|
button_border_color = "#5c5c5c",
|
|
541
683
|
button_border_radius = 0,
|
|
@@ -553,7 +695,7 @@ def create_confirmation_message_box(
|
|
|
553
695
|
confirm_message_box = QDialog()
|
|
554
696
|
confirm_message_box.setObjectName("confirm_message_box")
|
|
555
697
|
confirm_message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
556
|
-
confirm_message_box.
|
|
698
|
+
confirm_message_box.setFixedWidth(360)
|
|
557
699
|
style_sheet = f"""
|
|
558
700
|
QDialog#confirm_message_box {{
|
|
559
701
|
background-color: {background_color};
|
|
@@ -566,8 +708,6 @@ def create_confirmation_message_box(
|
|
|
566
708
|
confirm_message_box.setLayout(main_layout)
|
|
567
709
|
main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
|
|
568
710
|
main_layout.setSpacing(main_spacing)
|
|
569
|
-
text_layout = QHBoxLayout()
|
|
570
|
-
main_layout.addLayout(text_layout)
|
|
571
711
|
text_label = create_label(
|
|
572
712
|
text = text,
|
|
573
713
|
font_family = label_font_family,
|
|
@@ -575,11 +715,17 @@ def create_confirmation_message_box(
|
|
|
575
715
|
font_color = label_font_color,
|
|
576
716
|
background_color = "transparent",
|
|
577
717
|
padding = label_padding,
|
|
718
|
+
padding_left = label_padding_left,
|
|
719
|
+
padding_top = label_padding_top,
|
|
720
|
+
padding_right = label_padding_right,
|
|
721
|
+
padding_bottom = label_padding_bottom,
|
|
578
722
|
border_width = label_border_width,
|
|
579
723
|
border_color = label_border_color,
|
|
580
724
|
border_radius = label_border_radius
|
|
581
725
|
)
|
|
582
|
-
|
|
726
|
+
main_layout.addWidget(text_label)
|
|
727
|
+
text_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
728
|
+
text_label.setWordWrap(True)
|
|
583
729
|
buttons_layout = QHBoxLayout()
|
|
584
730
|
main_layout.addLayout(buttons_layout)
|
|
585
731
|
buttons_layout.setSpacing(button_spacing)
|
|
@@ -590,6 +736,10 @@ def create_confirmation_message_box(
|
|
|
590
736
|
font_color = button_font_color,
|
|
591
737
|
background_color = button_background_color,
|
|
592
738
|
padding = button_padding,
|
|
739
|
+
padding_left = button_padding_left,
|
|
740
|
+
padding_top = button_padding_top,
|
|
741
|
+
padding_right = button_padding_right,
|
|
742
|
+
padding_bottom = button_padding_bottom,
|
|
593
743
|
border_width = button_border_width,
|
|
594
744
|
border_color = button_border_color,
|
|
595
745
|
border_radius = button_border_radius,
|
|
@@ -613,6 +763,10 @@ def create_confirmation_message_box(
|
|
|
613
763
|
font_color = button_font_color,
|
|
614
764
|
background_color = button_background_color,
|
|
615
765
|
padding = button_padding,
|
|
766
|
+
padding_left = button_padding_left,
|
|
767
|
+
padding_top = button_padding_top,
|
|
768
|
+
padding_right = button_padding_right,
|
|
769
|
+
padding_bottom = button_padding_bottom,
|
|
616
770
|
border_width = button_border_width,
|
|
617
771
|
border_color = button_border_color,
|
|
618
772
|
border_radius = button_border_radius,
|
|
@@ -631,6 +785,122 @@ def create_confirmation_message_box(
|
|
|
631
785
|
decline_button.clicked.connect(confirm_message_box.reject)
|
|
632
786
|
return confirm_message_box
|
|
633
787
|
|
|
788
|
+
def create_list_table(
|
|
789
|
+
items_data,
|
|
790
|
+
column_headers,
|
|
791
|
+
column_proportions,
|
|
792
|
+
row_populator_function,
|
|
793
|
+
font_family = "Segoe UI",
|
|
794
|
+
font_size = 14,
|
|
795
|
+
font_color = "#ffffff",
|
|
796
|
+
background_color = "#1e1e1e",
|
|
797
|
+
border_width = 2,
|
|
798
|
+
border_color = "#5c5c5c",
|
|
799
|
+
item_font_color = "#ffffff",
|
|
800
|
+
item_background_color = "#1e1e1e",
|
|
801
|
+
selected_item_background_color = "#0078d7",
|
|
802
|
+
header_font_family = "Segoe UI",
|
|
803
|
+
header_font_size = 14,
|
|
804
|
+
header_font_color = "#ffffff",
|
|
805
|
+
header_font_weight = "bold",
|
|
806
|
+
header_background_color = "#1e1e1e",
|
|
807
|
+
header_border_width = 1,
|
|
808
|
+
header_border_color = "#191919",
|
|
809
|
+
hover_header_background_color = "#333333",
|
|
810
|
+
hover_header_border_width = 3,
|
|
811
|
+
hover_header_border_color = "#777777",
|
|
812
|
+
pressed_header_background_color = "#4a4a4a",
|
|
813
|
+
pressed_header_border_width = 3,
|
|
814
|
+
pressed_header_border_color = "#0078d7",
|
|
815
|
+
scrollbar_background_color = "#1e1e1e",
|
|
816
|
+
scrollbar_handle_background_color = "#333333",
|
|
817
|
+
hover_scrollbar_handle_background_color = "#4a4a4a",
|
|
818
|
+
hover_scrollbar_handle_border_width = 3,
|
|
819
|
+
hover_scrollbar_handle_border_color = "#777777",
|
|
820
|
+
pressed_scrollbar_handle_background_color = "#4a4a4a",
|
|
821
|
+
pressed_scrollbar_handle_border_width = 3,
|
|
822
|
+
pressed_scrollbar_handle_border_color = "#0078d7"
|
|
823
|
+
):
|
|
824
|
+
list_table = QTableWidget()
|
|
825
|
+
list_table.verticalHeader().setVisible(False)
|
|
826
|
+
list_table.setColumnCount(len(column_headers))
|
|
827
|
+
list_table.setHorizontalHeaderLabels(column_headers)
|
|
828
|
+
header = list_table.horizontalHeader()
|
|
829
|
+
header.setSectionResizeMode(QHeaderView.ResizeMode.Interactive)
|
|
830
|
+
|
|
831
|
+
def resize_columns():
|
|
832
|
+
total_width = list_table.viewport().width()
|
|
833
|
+
if total_width == 0: return
|
|
834
|
+
for i, proportion in enumerate(column_proportions):
|
|
835
|
+
list_table.setColumnWidth(i, int(total_width * proportion))
|
|
836
|
+
|
|
837
|
+
resize_columns()
|
|
838
|
+
original_resize_event = list_table.resizeEvent
|
|
839
|
+
|
|
840
|
+
def on_resize(event):
|
|
841
|
+
resize_columns()
|
|
842
|
+
if original_resize_event: original_resize_event(event)
|
|
843
|
+
|
|
844
|
+
list_table.resizeEvent = on_resize
|
|
845
|
+
style_sheet = f"""
|
|
846
|
+
QTableWidget {{
|
|
847
|
+
color: {font_color};
|
|
848
|
+
background-color: {background_color};
|
|
849
|
+
font-family: {font_family};
|
|
850
|
+
font-size: {font_size}px;
|
|
851
|
+
border: {border_width}px solid {border_color};
|
|
852
|
+
}}
|
|
853
|
+
QTableWidget::item {{
|
|
854
|
+
color: {item_font_color};
|
|
855
|
+
background-color: {item_background_color};
|
|
856
|
+
border: none;
|
|
857
|
+
}}
|
|
858
|
+
QTableWidget::item:selected {{
|
|
859
|
+
background-color: {selected_item_background_color};
|
|
860
|
+
}}
|
|
861
|
+
QHeaderView::section {{
|
|
862
|
+
color: {header_font_color};
|
|
863
|
+
background-color: {header_background_color};
|
|
864
|
+
font-family: {header_font_family};
|
|
865
|
+
font-size: {header_font_size}px;
|
|
866
|
+
font-weight: {header_font_weight};
|
|
867
|
+
border: {header_border_width}px solid {header_border_color};
|
|
868
|
+
}}
|
|
869
|
+
QHeaderView::section:hover {{
|
|
870
|
+
background-color: {hover_header_background_color};
|
|
871
|
+
border: {hover_header_border_width}px solid {hover_header_border_color};
|
|
872
|
+
}}
|
|
873
|
+
QHeaderView::section:pressed {{
|
|
874
|
+
background-color: {pressed_header_background_color};
|
|
875
|
+
border: {pressed_header_border_width}px solid {pressed_header_border_color};
|
|
876
|
+
}}
|
|
877
|
+
QScrollBar:vertical {{
|
|
878
|
+
background-color: {scrollbar_background_color};
|
|
879
|
+
border: none;
|
|
880
|
+
}}
|
|
881
|
+
QScrollBar::handle:vertical {{
|
|
882
|
+
background-color: {scrollbar_handle_background_color};
|
|
883
|
+
border: none;
|
|
884
|
+
}}
|
|
885
|
+
QScrollBar::handle:vertical:hover {{
|
|
886
|
+
background-color: {hover_scrollbar_handle_background_color};
|
|
887
|
+
border: {hover_scrollbar_handle_border_width}px solid {hover_scrollbar_handle_border_color};
|
|
888
|
+
}}
|
|
889
|
+
QScrollBar::handle:vertical:pressed {{
|
|
890
|
+
background-color: {pressed_scrollbar_handle_background_color};
|
|
891
|
+
border: {pressed_scrollbar_handle_border_width}px solid {pressed_scrollbar_handle_border_color};
|
|
892
|
+
}}
|
|
893
|
+
"""
|
|
894
|
+
list_table.setStyleSheet(style_sheet)
|
|
895
|
+
list_table.setRowCount(len(items_data))
|
|
896
|
+
for row, item_data in enumerate(items_data):
|
|
897
|
+
items = row_populator_function(item_data)
|
|
898
|
+
for item in items:
|
|
899
|
+
item.setTextAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
900
|
+
for column, item in enumerate(items):
|
|
901
|
+
list_table.setItem(row, column, item)
|
|
902
|
+
return list_table
|
|
903
|
+
|
|
634
904
|
def confirm_exit(
|
|
635
905
|
window,
|
|
636
906
|
background_color = "#1e1e1e",
|
|
@@ -641,6 +911,10 @@ def confirm_exit(
|
|
|
641
911
|
label_font_size = 14,
|
|
642
912
|
label_font_color = "#ffffff",
|
|
643
913
|
label_padding = 15,
|
|
914
|
+
label_padding_top = None,
|
|
915
|
+
label_padding_right = None,
|
|
916
|
+
label_padding_bottom = None,
|
|
917
|
+
label_padding_left = None,
|
|
644
918
|
label_border_width = 0,
|
|
645
919
|
label_border_color = "#ffffff",
|
|
646
920
|
label_border_radius = 0,
|
|
@@ -649,6 +923,10 @@ def confirm_exit(
|
|
|
649
923
|
button_font_color = "#ffffff",
|
|
650
924
|
button_background_color = "#1e1e1e",
|
|
651
925
|
button_padding = 15,
|
|
926
|
+
button_padding_top = None,
|
|
927
|
+
button_padding_right = None,
|
|
928
|
+
button_padding_bottom = None,
|
|
929
|
+
button_padding_left = None,
|
|
652
930
|
button_border_width = 2,
|
|
653
931
|
button_border_color = "#5c5c5c",
|
|
654
932
|
button_border_radius = 0,
|
|
@@ -673,6 +951,10 @@ def confirm_exit(
|
|
|
673
951
|
label_font_size = label_font_size,
|
|
674
952
|
label_font_color = label_font_color,
|
|
675
953
|
label_padding = label_padding,
|
|
954
|
+
label_padding_top = label_padding_top,
|
|
955
|
+
label_padding_right = label_padding_right,
|
|
956
|
+
label_padding_bottom = label_padding_bottom,
|
|
957
|
+
label_padding_left = label_padding_left,
|
|
676
958
|
label_border_width = label_border_width,
|
|
677
959
|
label_border_color = label_border_color,
|
|
678
960
|
label_border_radius = label_border_radius,
|
|
@@ -681,6 +963,10 @@ def confirm_exit(
|
|
|
681
963
|
button_font_color = button_font_color,
|
|
682
964
|
button_background_color = button_background_color,
|
|
683
965
|
button_padding = button_padding,
|
|
966
|
+
button_padding_top = button_padding_top,
|
|
967
|
+
button_padding_right = button_padding_right,
|
|
968
|
+
button_padding_bottom = button_padding_bottom,
|
|
969
|
+
button_padding_left = button_padding_left,
|
|
684
970
|
button_border_width = button_border_width,
|
|
685
971
|
button_border_color = button_border_color,
|
|
686
972
|
button_border_radius = button_border_radius,
|
|
@@ -813,7 +1099,13 @@ def format_id(id_string):
|
|
|
813
1099
|
elif len(clean_id) == 7: return f"{clean_id[0:1]}.{clean_id[1:4]}.{clean_id[4:7]}"
|
|
814
1100
|
return id_string
|
|
815
1101
|
|
|
816
|
-
def
|
|
1102
|
+
def format_cellphone_number(cellphone_number):
|
|
817
1103
|
clean_number = "".join(filter(str.isdigit, cellphone_number))
|
|
818
1104
|
if len(clean_number) == 10: return f"{clean_number[0:4]} - {clean_number[4:10]}"
|
|
819
|
-
return cellphone_number
|
|
1105
|
+
return cellphone_number
|
|
1106
|
+
|
|
1107
|
+
def format_date(date):
|
|
1108
|
+
day = f"{date.day:02d}"
|
|
1109
|
+
month = f"{date.month:02d}"
|
|
1110
|
+
year = f"{date.year:,}".replace(",", ".")
|
|
1111
|
+
return f"{day}/{month}/{year}"
|
|
@@ -7,10 +7,8 @@ gui_utilities.egg-info/SOURCES.txt
|
|
|
7
7
|
gui_utilities.egg-info/dependency_links.txt
|
|
8
8
|
gui_utilities.egg-info/requires.txt
|
|
9
9
|
gui_utilities.egg-info/top_level.txt
|
|
10
|
-
gui_utilities/icons/checked_verification_mark_icon.png
|
|
11
10
|
gui_utilities/icons/focused_hide_text_icon.png
|
|
12
11
|
gui_utilities/icons/focused_show_text_icon.png
|
|
13
12
|
gui_utilities/icons/hide_text_icon.png
|
|
14
|
-
gui_utilities/icons/hover_verification_mark_icon.png
|
|
15
13
|
gui_utilities/icons/show_text_icon.png
|
|
16
14
|
gui_utilities/tlds/tlds_list.txt
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|