gui-utilities 1.1.9__tar.gz → 1.2.18__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.
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/PKG-INFO +1 -1
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities/gui_utilities.py +362 -24
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities.egg-info/PKG-INFO +1 -1
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities.egg-info/SOURCES.txt +0 -2
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/pyproject.toml +1 -1
- gui_utilities-1.1.9/gui_utilities/icons/checked_verification_mark_icon.png +0 -0
- gui_utilities-1.1.9/gui_utilities/icons/hover_verification_mark_icon.png +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/LICENSE +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/README.md +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities/icons/focused_hide_text_icon.png +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities/icons/focused_show_text_icon.png +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities/icons/hide_text_icon.png +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities/icons/show_text_icon.png +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities/tlds/tlds_list.txt +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities.egg-info/dependency_links.txt +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities.egg-info/requires.txt +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/gui_utilities.egg-info/top_level.txt +0 -0
- {gui_utilities-1.1.9 → gui_utilities-1.2.18}/setup.cfg +0 -0
|
@@ -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, QSizePolicy
|
|
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 = "#
|
|
439
|
+
checked_indicator_background_color = "#ffffff",
|
|
378
440
|
checked_indicator_border_width = 1,
|
|
379
|
-
checked_indicator_border_color = "#
|
|
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
|
}}
|
|
@@ -417,6 +491,50 @@ def create_checkbox(
|
|
|
417
491
|
check_box.setStyleSheet(style_sheet)
|
|
418
492
|
return check_box
|
|
419
493
|
|
|
494
|
+
class _ResponsiveDialog(QDialog):
|
|
495
|
+
"""
|
|
496
|
+
Subclase de QDialog que ajusta dinámicamente el ancho máximo del label principal
|
|
497
|
+
según el ancho actual del diálogo y los márgenes proporcionados.
|
|
498
|
+
"""
|
|
499
|
+
def __init__(self, left_margin, right_margin, label_padding_total_getter, *args, **kwargs):
|
|
500
|
+
super().__init__(*args, **kwargs)
|
|
501
|
+
self._left_margin = left_margin
|
|
502
|
+
self._right_margin = right_margin
|
|
503
|
+
# label_padding_total_getter: callable que devuelve número de px que ocupa padding horizontal del label
|
|
504
|
+
self._label_padding_total_getter = label_padding_total_getter
|
|
505
|
+
self._responsive_labels = []
|
|
506
|
+
|
|
507
|
+
def register_responsive_label(self, label_widget):
|
|
508
|
+
# Guardamos la referencia para ajustarla en resizeEvent
|
|
509
|
+
if label_widget not in self._responsive_labels:
|
|
510
|
+
self._responsive_labels.append(label_widget)
|
|
511
|
+
|
|
512
|
+
def resizeEvent(self, event):
|
|
513
|
+
# Calculamos ancho disponible y aplicamos a cada label registrado
|
|
514
|
+
total_padding = self._label_padding_total_getter() or 0
|
|
515
|
+
avail = max(0, self.width() - self._left_margin - self._right_margin - total_padding)
|
|
516
|
+
for lbl in self._responsive_labels:
|
|
517
|
+
lbl.setMaximumWidth(avail)
|
|
518
|
+
super().resizeEvent(event)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
def _compute_label_horizontal_padding(label_padding, padding_top, padding_right, padding_bottom, padding_left):
|
|
522
|
+
"""
|
|
523
|
+
Normaliza y calcula el total horizontal de padding entrado por parámetros.
|
|
524
|
+
Si label_padding está definido y paddings individuales no, se usa.
|
|
525
|
+
"""
|
|
526
|
+
# Si padding individual está dado, priorizarlo
|
|
527
|
+
left = padding_left if padding_left is not None else None
|
|
528
|
+
right = padding_right if padding_right is not None else None
|
|
529
|
+
if left is None and right is None:
|
|
530
|
+
# usar label_padding para ambos lados (si está definido)
|
|
531
|
+
if label_padding is None:
|
|
532
|
+
return 0
|
|
533
|
+
return 2 * label_padding
|
|
534
|
+
# si alguno es None, tratar como 0
|
|
535
|
+
return (left or 0) + (right or 0)
|
|
536
|
+
|
|
537
|
+
|
|
420
538
|
def create_information_message_box(
|
|
421
539
|
text,
|
|
422
540
|
top_margin = 25,
|
|
@@ -432,6 +550,10 @@ def create_information_message_box(
|
|
|
432
550
|
label_font_size = 14,
|
|
433
551
|
label_font_color = "#ffffff",
|
|
434
552
|
label_padding = 15,
|
|
553
|
+
label_padding_top = None,
|
|
554
|
+
label_padding_right = None,
|
|
555
|
+
label_padding_bottom = None,
|
|
556
|
+
label_padding_left = None,
|
|
435
557
|
label_border_width = 0,
|
|
436
558
|
label_border_color = "#ffffff",
|
|
437
559
|
label_border_radius = 0,
|
|
@@ -441,6 +563,10 @@ def create_information_message_box(
|
|
|
441
563
|
button_font_color = "#ffffff",
|
|
442
564
|
button_background_color = "#1e1e1e",
|
|
443
565
|
button_padding = 15,
|
|
566
|
+
button_padding_top = None,
|
|
567
|
+
button_padding_right = None,
|
|
568
|
+
button_padding_bottom = None,
|
|
569
|
+
button_padding_left = None,
|
|
444
570
|
button_border_width = 2,
|
|
445
571
|
button_border_color = "#5c5c5c",
|
|
446
572
|
button_border_radius = 0,
|
|
@@ -455,9 +581,15 @@ def create_information_message_box(
|
|
|
455
581
|
button_disabled_border_width = 2,
|
|
456
582
|
button_disabled_border_color = "#4a4a4a"
|
|
457
583
|
):
|
|
458
|
-
|
|
584
|
+
# Calculador de padding horizontal del label (valor único que devolverá el ResponsiveDialog)
|
|
585
|
+
def _label_padding_total():
|
|
586
|
+
return _compute_label_horizontal_padding(label_padding, label_padding_top, label_padding_right, label_padding_bottom, label_padding_left)
|
|
587
|
+
|
|
588
|
+
# Usamos la subclase de diálogo que ajusta dinámicamente
|
|
589
|
+
message_box = _ResponsiveDialog(left_margin, right_margin, _label_padding_total)
|
|
459
590
|
message_box.setObjectName("message_box")
|
|
460
591
|
message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
592
|
+
message_box.setMinimumWidth(240)
|
|
461
593
|
message_box.setMaximumWidth(480)
|
|
462
594
|
style_sheet = f"""
|
|
463
595
|
QDialog#message_box {{
|
|
@@ -467,23 +599,39 @@ def create_information_message_box(
|
|
|
467
599
|
}}
|
|
468
600
|
"""
|
|
469
601
|
message_box.setStyleSheet(style_sheet)
|
|
602
|
+
|
|
470
603
|
main_layout = QVBoxLayout(message_box)
|
|
471
604
|
message_box.setLayout(main_layout)
|
|
472
605
|
main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
|
|
473
606
|
main_layout.setSpacing(spacing)
|
|
607
|
+
|
|
608
|
+
# Creación del label (usamos create_label existente)
|
|
474
609
|
text_label = create_label(
|
|
475
610
|
text = text,
|
|
476
611
|
font_family = label_font_family,
|
|
477
612
|
font_size = label_font_size,
|
|
478
|
-
font_color= label_font_color,
|
|
613
|
+
font_color = label_font_color,
|
|
479
614
|
background_color = "transparent",
|
|
480
615
|
padding = label_padding,
|
|
616
|
+
padding_top = label_padding_top,
|
|
617
|
+
padding_right = label_padding_right,
|
|
618
|
+
padding_bottom = label_padding_bottom,
|
|
619
|
+
padding_left = label_padding_left,
|
|
481
620
|
border_width = label_border_width,
|
|
482
621
|
border_color = label_border_color,
|
|
483
622
|
border_radius = label_border_radius
|
|
484
623
|
)
|
|
624
|
+
|
|
625
|
+
# Políticas que permiten usar todo el ancho disponible y wrap solo cuando sea necesario
|
|
626
|
+
text_label.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred)
|
|
627
|
+
text_label.setWordWrap(True)
|
|
628
|
+
|
|
485
629
|
main_layout.addWidget(text_label)
|
|
486
630
|
|
|
631
|
+
# Registramos el label para que el diálogo lo ajuste en resizeEvent
|
|
632
|
+
message_box.register_responsive_label(text_label)
|
|
633
|
+
|
|
634
|
+
# Botón
|
|
487
635
|
accept_button = create_button(
|
|
488
636
|
text = button_text,
|
|
489
637
|
font_family = button_font_family,
|
|
@@ -491,6 +639,10 @@ def create_information_message_box(
|
|
|
491
639
|
font_color = button_font_color,
|
|
492
640
|
background_color = button_background_color,
|
|
493
641
|
padding = button_padding,
|
|
642
|
+
padding_top = button_padding_top,
|
|
643
|
+
padding_right = button_padding_right,
|
|
644
|
+
padding_bottom = button_padding_bottom,
|
|
645
|
+
padding_left = button_padding_left,
|
|
494
646
|
border_width = button_border_width,
|
|
495
647
|
border_color = button_border_color,
|
|
496
648
|
border_radius = button_border_radius,
|
|
@@ -507,8 +659,18 @@ def create_information_message_box(
|
|
|
507
659
|
)
|
|
508
660
|
main_layout.addWidget(accept_button)
|
|
509
661
|
accept_button.clicked.connect(message_box.accept)
|
|
662
|
+
|
|
663
|
+
# Ajustes finales: forzamos un tamaño inicial coherente
|
|
664
|
+
message_box.adjustSize()
|
|
665
|
+
# aseguramos ancho dentro de min/max
|
|
666
|
+
final_w = message_box.width()
|
|
667
|
+
if final_w < message_box.minimumWidth(): final_w = message_box.minimumWidth()
|
|
668
|
+
if final_w > message_box.maximumWidth(): final_w = message_box.maximumWidth()
|
|
669
|
+
message_box.resize(final_w, message_box.height())
|
|
670
|
+
|
|
510
671
|
return message_box
|
|
511
|
-
|
|
672
|
+
|
|
673
|
+
|
|
512
674
|
def create_confirmation_message_box(
|
|
513
675
|
text,
|
|
514
676
|
top_margin = 25,
|
|
@@ -525,6 +687,10 @@ def create_confirmation_message_box(
|
|
|
525
687
|
label_font_size = 14,
|
|
526
688
|
label_font_color = "#ffffff",
|
|
527
689
|
label_padding = 15,
|
|
690
|
+
label_padding_top = None,
|
|
691
|
+
label_padding_right = None,
|
|
692
|
+
label_padding_bottom = None,
|
|
693
|
+
label_padding_left = None,
|
|
528
694
|
label_border_width = 0,
|
|
529
695
|
label_border_color = "#ffffff",
|
|
530
696
|
label_border_radius = 0,
|
|
@@ -533,6 +699,10 @@ def create_confirmation_message_box(
|
|
|
533
699
|
button_font_color = "#ffffff",
|
|
534
700
|
button_background_color = "#1e1e1e",
|
|
535
701
|
button_padding = 15,
|
|
702
|
+
button_padding_top = None,
|
|
703
|
+
button_padding_right = None,
|
|
704
|
+
button_padding_bottom = None,
|
|
705
|
+
button_padding_left = None,
|
|
536
706
|
button_border_width = 2,
|
|
537
707
|
button_border_color = "#5c5c5c",
|
|
538
708
|
button_border_radius = 0,
|
|
@@ -547,9 +717,13 @@ def create_confirmation_message_box(
|
|
|
547
717
|
button_disabled_border_width = 2,
|
|
548
718
|
button_disabled_border_color = "#4a4a4a"
|
|
549
719
|
):
|
|
550
|
-
|
|
720
|
+
def _label_padding_total():
|
|
721
|
+
return _compute_label_horizontal_padding(label_padding, label_padding_top, label_padding_right, label_padding_bottom, label_padding_left)
|
|
722
|
+
|
|
723
|
+
confirm_message_box = _ResponsiveDialog(left_margin, right_margin, _label_padding_total)
|
|
551
724
|
confirm_message_box.setObjectName("confirm_message_box")
|
|
552
725
|
confirm_message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
|
726
|
+
confirm_message_box.setMinimumWidth(240)
|
|
553
727
|
confirm_message_box.setMaximumWidth(480)
|
|
554
728
|
style_sheet = f"""
|
|
555
729
|
QDialog#confirm_message_box {{
|
|
@@ -559,12 +733,12 @@ def create_confirmation_message_box(
|
|
|
559
733
|
}}
|
|
560
734
|
"""
|
|
561
735
|
confirm_message_box.setStyleSheet(style_sheet)
|
|
736
|
+
|
|
562
737
|
main_layout = QVBoxLayout(confirm_message_box)
|
|
563
738
|
confirm_message_box.setLayout(main_layout)
|
|
564
739
|
main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
|
|
565
740
|
main_layout.setSpacing(main_spacing)
|
|
566
|
-
|
|
567
|
-
main_layout.addLayout(text_layout)
|
|
741
|
+
|
|
568
742
|
text_label = create_label(
|
|
569
743
|
text = text,
|
|
570
744
|
font_family = label_font_family,
|
|
@@ -572,14 +746,24 @@ def create_confirmation_message_box(
|
|
|
572
746
|
font_color = label_font_color,
|
|
573
747
|
background_color = "transparent",
|
|
574
748
|
padding = label_padding,
|
|
749
|
+
padding_top = label_padding_top,
|
|
750
|
+
padding_right = label_padding_right,
|
|
751
|
+
padding_bottom = label_padding_bottom,
|
|
752
|
+
padding_left = label_padding_left,
|
|
575
753
|
border_width = label_border_width,
|
|
576
754
|
border_color = label_border_color,
|
|
577
755
|
border_radius = label_border_radius
|
|
578
756
|
)
|
|
579
|
-
|
|
757
|
+
|
|
758
|
+
text_label.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred)
|
|
759
|
+
text_label.setWordWrap(True)
|
|
760
|
+
main_layout.addWidget(text_label)
|
|
761
|
+
confirm_message_box.register_responsive_label(text_label)
|
|
762
|
+
|
|
580
763
|
buttons_layout = QHBoxLayout()
|
|
581
764
|
main_layout.addLayout(buttons_layout)
|
|
582
765
|
buttons_layout.setSpacing(button_spacing)
|
|
766
|
+
|
|
583
767
|
confirm_button = create_button(
|
|
584
768
|
text = "Sí",
|
|
585
769
|
font_family = button_font_family,
|
|
@@ -587,6 +771,10 @@ def create_confirmation_message_box(
|
|
|
587
771
|
font_color = button_font_color,
|
|
588
772
|
background_color = button_background_color,
|
|
589
773
|
padding = button_padding,
|
|
774
|
+
padding_top = button_padding_top,
|
|
775
|
+
padding_right = button_padding_right,
|
|
776
|
+
padding_bottom = button_padding_bottom,
|
|
777
|
+
padding_left = button_padding_left,
|
|
590
778
|
border_width = button_border_width,
|
|
591
779
|
border_color = button_border_color,
|
|
592
780
|
border_radius = button_border_radius,
|
|
@@ -603,6 +791,7 @@ def create_confirmation_message_box(
|
|
|
603
791
|
)
|
|
604
792
|
buttons_layout.addWidget(confirm_button)
|
|
605
793
|
confirm_button.clicked.connect(confirm_message_box.accept)
|
|
794
|
+
|
|
606
795
|
decline_button = create_button(
|
|
607
796
|
text = "No",
|
|
608
797
|
font_family = button_font_family,
|
|
@@ -610,6 +799,10 @@ def create_confirmation_message_box(
|
|
|
610
799
|
font_color = button_font_color,
|
|
611
800
|
background_color = button_background_color,
|
|
612
801
|
padding = button_padding,
|
|
802
|
+
padding_top = button_padding_top,
|
|
803
|
+
padding_right = button_padding_right,
|
|
804
|
+
padding_bottom = button_padding_bottom,
|
|
805
|
+
padding_left = button_padding_left,
|
|
613
806
|
border_width = button_border_width,
|
|
614
807
|
border_color = button_border_color,
|
|
615
808
|
border_radius = button_border_radius,
|
|
@@ -626,8 +819,131 @@ def create_confirmation_message_box(
|
|
|
626
819
|
)
|
|
627
820
|
buttons_layout.addWidget(decline_button)
|
|
628
821
|
decline_button.clicked.connect(confirm_message_box.reject)
|
|
822
|
+
|
|
823
|
+
confirm_message_box.adjustSize()
|
|
824
|
+
final_w = confirm_message_box.width()
|
|
825
|
+
if final_w < confirm_message_box.minimumWidth(): final_w = confirm_message_box.minimumWidth()
|
|
826
|
+
if final_w > confirm_message_box.maximumWidth(): final_w = confirm_message_box.maximumWidth()
|
|
827
|
+
confirm_message_box.resize(final_w, confirm_message_box.height())
|
|
828
|
+
|
|
629
829
|
return confirm_message_box
|
|
630
830
|
|
|
831
|
+
def create_list_table(
|
|
832
|
+
items_data,
|
|
833
|
+
column_headers,
|
|
834
|
+
column_proportions,
|
|
835
|
+
row_populator_function,
|
|
836
|
+
font_family = "Segoe UI",
|
|
837
|
+
font_size = 14,
|
|
838
|
+
font_color = "#ffffff",
|
|
839
|
+
background_color = "#1e1e1e",
|
|
840
|
+
border_width = 2,
|
|
841
|
+
border_color = "#5c5c5c",
|
|
842
|
+
item_font_color = "#ffffff",
|
|
843
|
+
item_background_color = "#1e1e1e",
|
|
844
|
+
selected_item_background_color = "#0078d7",
|
|
845
|
+
header_font_family = "Segoe UI",
|
|
846
|
+
header_font_size = 14,
|
|
847
|
+
header_font_color = "#ffffff",
|
|
848
|
+
header_font_weight = "bold",
|
|
849
|
+
header_background_color = "#1e1e1e",
|
|
850
|
+
header_border_width = 1,
|
|
851
|
+
header_border_color = "#191919",
|
|
852
|
+
hover_header_background_color = "#333333",
|
|
853
|
+
hover_header_border_width = 3,
|
|
854
|
+
hover_header_border_color = "#777777",
|
|
855
|
+
pressed_header_background_color = "#4a4a4a",
|
|
856
|
+
pressed_header_border_width = 3,
|
|
857
|
+
pressed_header_border_color = "#0078d7",
|
|
858
|
+
scrollbar_background_color = "#1e1e1e",
|
|
859
|
+
scrollbar_handle_background_color = "#333333",
|
|
860
|
+
hover_scrollbar_handle_background_color = "#4a4a4a",
|
|
861
|
+
hover_scrollbar_handle_border_width = 3,
|
|
862
|
+
hover_scrollbar_handle_border_color = "#777777",
|
|
863
|
+
pressed_scrollbar_handle_background_color = "#4a4a4a",
|
|
864
|
+
pressed_scrollbar_handle_border_width = 3,
|
|
865
|
+
pressed_scrollbar_handle_border_color = "#0078d7"
|
|
866
|
+
):
|
|
867
|
+
list_table = QTableWidget()
|
|
868
|
+
list_table.verticalHeader().setVisible(False)
|
|
869
|
+
list_table.setColumnCount(len(column_headers))
|
|
870
|
+
list_table.setHorizontalHeaderLabels(column_headers)
|
|
871
|
+
header = list_table.horizontalHeader()
|
|
872
|
+
header.setSectionResizeMode(QHeaderView.ResizeMode.Interactive)
|
|
873
|
+
|
|
874
|
+
def resize_columns():
|
|
875
|
+
total_width = list_table.viewport().width()
|
|
876
|
+
if total_width == 0: return
|
|
877
|
+
for i, proportion in enumerate(column_proportions):
|
|
878
|
+
list_table.setColumnWidth(i, int(total_width * proportion))
|
|
879
|
+
|
|
880
|
+
resize_columns()
|
|
881
|
+
original_resize_event = list_table.resizeEvent
|
|
882
|
+
|
|
883
|
+
def on_resize(event):
|
|
884
|
+
resize_columns()
|
|
885
|
+
if original_resize_event: original_resize_event(event)
|
|
886
|
+
|
|
887
|
+
list_table.resizeEvent = on_resize
|
|
888
|
+
style_sheet = f"""
|
|
889
|
+
QTableWidget {{
|
|
890
|
+
color: {font_color};
|
|
891
|
+
background-color: {background_color};
|
|
892
|
+
font-family: {font_family};
|
|
893
|
+
font-size: {font_size}px;
|
|
894
|
+
border: {border_width}px solid {border_color};
|
|
895
|
+
}}
|
|
896
|
+
QTableWidget::item {{
|
|
897
|
+
color: {item_font_color};
|
|
898
|
+
background-color: {item_background_color};
|
|
899
|
+
border: none;
|
|
900
|
+
}}
|
|
901
|
+
QTableWidget::item:selected {{
|
|
902
|
+
background-color: {selected_item_background_color};
|
|
903
|
+
}}
|
|
904
|
+
QHeaderView::section {{
|
|
905
|
+
color: {header_font_color};
|
|
906
|
+
background-color: {header_background_color};
|
|
907
|
+
font-family: {header_font_family};
|
|
908
|
+
font-size: {header_font_size}px;
|
|
909
|
+
font-weight: {header_font_weight};
|
|
910
|
+
border: {header_border_width}px solid {header_border_color};
|
|
911
|
+
}}
|
|
912
|
+
QHeaderView::section:hover {{
|
|
913
|
+
background-color: {hover_header_background_color};
|
|
914
|
+
border: {hover_header_border_width}px solid {hover_header_border_color};
|
|
915
|
+
}}
|
|
916
|
+
QHeaderView::section:pressed {{
|
|
917
|
+
background-color: {pressed_header_background_color};
|
|
918
|
+
border: {pressed_header_border_width}px solid {pressed_header_border_color};
|
|
919
|
+
}}
|
|
920
|
+
QScrollBar:vertical {{
|
|
921
|
+
background-color: {scrollbar_background_color};
|
|
922
|
+
border: none;
|
|
923
|
+
}}
|
|
924
|
+
QScrollBar::handle:vertical {{
|
|
925
|
+
background-color: {scrollbar_handle_background_color};
|
|
926
|
+
border: none;
|
|
927
|
+
}}
|
|
928
|
+
QScrollBar::handle:vertical:hover {{
|
|
929
|
+
background-color: {hover_scrollbar_handle_background_color};
|
|
930
|
+
border: {hover_scrollbar_handle_border_width}px solid {hover_scrollbar_handle_border_color};
|
|
931
|
+
}}
|
|
932
|
+
QScrollBar::handle:vertical:pressed {{
|
|
933
|
+
background-color: {pressed_scrollbar_handle_background_color};
|
|
934
|
+
border: {pressed_scrollbar_handle_border_width}px solid {pressed_scrollbar_handle_border_color};
|
|
935
|
+
}}
|
|
936
|
+
"""
|
|
937
|
+
list_table.setStyleSheet(style_sheet)
|
|
938
|
+
list_table.setRowCount(len(items_data))
|
|
939
|
+
for row, item_data in enumerate(items_data):
|
|
940
|
+
items = row_populator_function(item_data)
|
|
941
|
+
for item in items:
|
|
942
|
+
item.setTextAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
943
|
+
for column, item in enumerate(items):
|
|
944
|
+
list_table.setItem(row, column, item)
|
|
945
|
+
return list_table
|
|
946
|
+
|
|
631
947
|
def confirm_exit(
|
|
632
948
|
window,
|
|
633
949
|
background_color = "#1e1e1e",
|
|
@@ -638,6 +954,10 @@ def confirm_exit(
|
|
|
638
954
|
label_font_size = 14,
|
|
639
955
|
label_font_color = "#ffffff",
|
|
640
956
|
label_padding = 15,
|
|
957
|
+
label_padding_top = None,
|
|
958
|
+
label_padding_right = None,
|
|
959
|
+
label_padding_bottom = None,
|
|
960
|
+
label_padding_left = None,
|
|
641
961
|
label_border_width = 0,
|
|
642
962
|
label_border_color = "#ffffff",
|
|
643
963
|
label_border_radius = 0,
|
|
@@ -646,6 +966,10 @@ def confirm_exit(
|
|
|
646
966
|
button_font_color = "#ffffff",
|
|
647
967
|
button_background_color = "#1e1e1e",
|
|
648
968
|
button_padding = 15,
|
|
969
|
+
button_padding_top = None,
|
|
970
|
+
button_padding_right = None,
|
|
971
|
+
button_padding_bottom = None,
|
|
972
|
+
button_padding_left = None,
|
|
649
973
|
button_border_width = 2,
|
|
650
974
|
button_border_color = "#5c5c5c",
|
|
651
975
|
button_border_radius = 0,
|
|
@@ -670,6 +994,10 @@ def confirm_exit(
|
|
|
670
994
|
label_font_size = label_font_size,
|
|
671
995
|
label_font_color = label_font_color,
|
|
672
996
|
label_padding = label_padding,
|
|
997
|
+
label_padding_top = label_padding_top,
|
|
998
|
+
label_padding_right = label_padding_right,
|
|
999
|
+
label_padding_bottom = label_padding_bottom,
|
|
1000
|
+
label_padding_left = label_padding_left,
|
|
673
1001
|
label_border_width = label_border_width,
|
|
674
1002
|
label_border_color = label_border_color,
|
|
675
1003
|
label_border_radius = label_border_radius,
|
|
@@ -678,6 +1006,10 @@ def confirm_exit(
|
|
|
678
1006
|
button_font_color = button_font_color,
|
|
679
1007
|
button_background_color = button_background_color,
|
|
680
1008
|
button_padding = button_padding,
|
|
1009
|
+
button_padding_top = button_padding_top,
|
|
1010
|
+
button_padding_right = button_padding_right,
|
|
1011
|
+
button_padding_bottom = button_padding_bottom,
|
|
1012
|
+
button_padding_left = button_padding_left,
|
|
681
1013
|
button_border_width = button_border_width,
|
|
682
1014
|
button_border_color = button_border_color,
|
|
683
1015
|
button_border_radius = button_border_radius,
|
|
@@ -810,7 +1142,13 @@ def format_id(id_string):
|
|
|
810
1142
|
elif len(clean_id) == 7: return f"{clean_id[0:1]}.{clean_id[1:4]}.{clean_id[4:7]}"
|
|
811
1143
|
return id_string
|
|
812
1144
|
|
|
813
|
-
def
|
|
1145
|
+
def format_cellphone_number(cellphone_number):
|
|
814
1146
|
clean_number = "".join(filter(str.isdigit, cellphone_number))
|
|
815
1147
|
if len(clean_number) == 10: return f"{clean_number[0:4]} - {clean_number[4:10]}"
|
|
816
|
-
return cellphone_number
|
|
1148
|
+
return cellphone_number
|
|
1149
|
+
|
|
1150
|
+
def format_date(date):
|
|
1151
|
+
day = f"{date.day:02d}"
|
|
1152
|
+
month = f"{date.month:02d}"
|
|
1153
|
+
year = f"{date.year:,}".replace(",", ".")
|
|
1154
|
+
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
|