gui-utilities 1.2.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gui_utilities
3
- Version: 1.2.2
3
+ Version: 1.2.18
4
4
  Summary: Librería de utilidades gráficas en PyQt6
5
5
  Author-email: Guido Iván Gross <grossguidoivan@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -1,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, QTableWidget, QHeaderView
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: {padding}px;
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: {padding}px;
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: {padding}px;
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
  }}
@@ -257,10 +306,6 @@ def create_text_box(
257
306
  border: none;
258
307
  margin-right: 10px;
259
308
  }}
260
- QToolButton:hover, QToolButton:pressed {{
261
- background-color: transparent;
262
- border: none;
263
- }}
264
309
  """
265
310
  toggle_text_visibility_button.setStyleSheet(style_sheet)
266
311
  text_box.addAction(toggle_text_visibility_action, QLineEdit.ActionPosition.TrailingPosition)
@@ -298,6 +343,10 @@ def create_combo_box(
298
343
  font_color = "#ffffff",
299
344
  background_color = "#1e1e1e",
300
345
  padding = 15,
346
+ padding_top = None,
347
+ padding_right = None,
348
+ padding_bottom = None,
349
+ padding_left = None,
301
350
  border_width = 2,
302
351
  border_color = "#5c5c5c",
303
352
  border_radius = 0,
@@ -319,6 +368,11 @@ def create_combo_box(
319
368
  combo_box.addItems(items)
320
369
  combo_box.setCurrentIndex(-1)
321
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
+
322
376
  def get_stylesheet(font_color):
323
377
  return f"""
324
378
  QComboBox {{
@@ -326,7 +380,10 @@ def create_combo_box(
326
380
  font-size: {font_size}px;
327
381
  color: {font_color};
328
382
  background-color: {background_color};
329
- padding: {padding}px;
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;
330
387
  border: {border_width}px solid {border_color};
331
388
  border-radius: {border_radius}px;
332
389
  }}
@@ -365,6 +422,10 @@ def create_checkbox(
365
422
  font_color = "#ffffff",
366
423
  background_color = "#1e1e1e",
367
424
  padding = 5,
425
+ padding_top = None,
426
+ padding_right = None,
427
+ padding_bottom = None,
428
+ padding_left = None,
368
429
  indicator_background_color = "#1e1e1e",
369
430
  indicator_border_width = 1,
370
431
  indicator_border_color = "#5c5c5c",
@@ -384,13 +445,20 @@ def create_checkbox(
384
445
  disabled_border_color = "#4a4a4a"
385
446
  ):
386
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
387
452
  style_sheet = f"""
388
453
  QCheckBox {{
389
454
  font-family: {font_family};
390
455
  font-size: {font_size}px;
391
456
  color: {font_color};
392
457
  background-color: {background_color};
393
- padding: {padding}px;
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;
394
462
  }}
395
463
  QCheckBox::indicator {{
396
464
  image: none;
@@ -423,6 +491,50 @@ def create_checkbox(
423
491
  check_box.setStyleSheet(style_sheet)
424
492
  return check_box
425
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
+
426
538
  def create_information_message_box(
427
539
  text,
428
540
  top_margin = 25,
@@ -438,6 +550,10 @@ def create_information_message_box(
438
550
  label_font_size = 14,
439
551
  label_font_color = "#ffffff",
440
552
  label_padding = 15,
553
+ label_padding_top = None,
554
+ label_padding_right = None,
555
+ label_padding_bottom = None,
556
+ label_padding_left = None,
441
557
  label_border_width = 0,
442
558
  label_border_color = "#ffffff",
443
559
  label_border_radius = 0,
@@ -447,6 +563,10 @@ def create_information_message_box(
447
563
  button_font_color = "#ffffff",
448
564
  button_background_color = "#1e1e1e",
449
565
  button_padding = 15,
566
+ button_padding_top = None,
567
+ button_padding_right = None,
568
+ button_padding_bottom = None,
569
+ button_padding_left = None,
450
570
  button_border_width = 2,
451
571
  button_border_color = "#5c5c5c",
452
572
  button_border_radius = 0,
@@ -461,7 +581,12 @@ def create_information_message_box(
461
581
  button_disabled_border_width = 2,
462
582
  button_disabled_border_color = "#4a4a4a"
463
583
  ):
464
- message_box = QDialog()
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)
465
590
  message_box.setObjectName("message_box")
466
591
  message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
467
592
  message_box.setMinimumWidth(240)
@@ -474,23 +599,39 @@ def create_information_message_box(
474
599
  }}
475
600
  """
476
601
  message_box.setStyleSheet(style_sheet)
602
+
477
603
  main_layout = QVBoxLayout(message_box)
478
604
  message_box.setLayout(main_layout)
479
605
  main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
480
606
  main_layout.setSpacing(spacing)
607
+
608
+ # Creación del label (usamos create_label existente)
481
609
  text_label = create_label(
482
610
  text = text,
483
611
  font_family = label_font_family,
484
612
  font_size = label_font_size,
485
- font_color= label_font_color,
613
+ font_color = label_font_color,
486
614
  background_color = "transparent",
487
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,
488
620
  border_width = label_border_width,
489
621
  border_color = label_border_color,
490
622
  border_radius = label_border_radius
491
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
+
492
629
  main_layout.addWidget(text_label)
493
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
494
635
  accept_button = create_button(
495
636
  text = button_text,
496
637
  font_family = button_font_family,
@@ -498,6 +639,10 @@ def create_information_message_box(
498
639
  font_color = button_font_color,
499
640
  background_color = button_background_color,
500
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,
501
646
  border_width = button_border_width,
502
647
  border_color = button_border_color,
503
648
  border_radius = button_border_radius,
@@ -514,8 +659,18 @@ def create_information_message_box(
514
659
  )
515
660
  main_layout.addWidget(accept_button)
516
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
+
517
671
  return message_box
518
-
672
+
673
+
519
674
  def create_confirmation_message_box(
520
675
  text,
521
676
  top_margin = 25,
@@ -532,6 +687,10 @@ def create_confirmation_message_box(
532
687
  label_font_size = 14,
533
688
  label_font_color = "#ffffff",
534
689
  label_padding = 15,
690
+ label_padding_top = None,
691
+ label_padding_right = None,
692
+ label_padding_bottom = None,
693
+ label_padding_left = None,
535
694
  label_border_width = 0,
536
695
  label_border_color = "#ffffff",
537
696
  label_border_radius = 0,
@@ -540,6 +699,10 @@ def create_confirmation_message_box(
540
699
  button_font_color = "#ffffff",
541
700
  button_background_color = "#1e1e1e",
542
701
  button_padding = 15,
702
+ button_padding_top = None,
703
+ button_padding_right = None,
704
+ button_padding_bottom = None,
705
+ button_padding_left = None,
543
706
  button_border_width = 2,
544
707
  button_border_color = "#5c5c5c",
545
708
  button_border_radius = 0,
@@ -554,7 +717,10 @@ def create_confirmation_message_box(
554
717
  button_disabled_border_width = 2,
555
718
  button_disabled_border_color = "#4a4a4a"
556
719
  ):
557
- confirm_message_box = QDialog()
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)
558
724
  confirm_message_box.setObjectName("confirm_message_box")
559
725
  confirm_message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
560
726
  confirm_message_box.setMinimumWidth(240)
@@ -567,12 +733,12 @@ def create_confirmation_message_box(
567
733
  }}
568
734
  """
569
735
  confirm_message_box.setStyleSheet(style_sheet)
736
+
570
737
  main_layout = QVBoxLayout(confirm_message_box)
571
738
  confirm_message_box.setLayout(main_layout)
572
739
  main_layout.setContentsMargins(left_margin, top_margin, right_margin, bottom_margin)
573
740
  main_layout.setSpacing(main_spacing)
574
- text_layout = QHBoxLayout()
575
- main_layout.addLayout(text_layout)
741
+
576
742
  text_label = create_label(
577
743
  text = text,
578
744
  font_family = label_font_family,
@@ -580,14 +746,24 @@ def create_confirmation_message_box(
580
746
  font_color = label_font_color,
581
747
  background_color = "transparent",
582
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,
583
753
  border_width = label_border_width,
584
754
  border_color = label_border_color,
585
755
  border_radius = label_border_radius
586
756
  )
587
- text_layout.addWidget(text_label)
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
+
588
763
  buttons_layout = QHBoxLayout()
589
764
  main_layout.addLayout(buttons_layout)
590
765
  buttons_layout.setSpacing(button_spacing)
766
+
591
767
  confirm_button = create_button(
592
768
  text = "Sí",
593
769
  font_family = button_font_family,
@@ -595,6 +771,10 @@ def create_confirmation_message_box(
595
771
  font_color = button_font_color,
596
772
  background_color = button_background_color,
597
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,
598
778
  border_width = button_border_width,
599
779
  border_color = button_border_color,
600
780
  border_radius = button_border_radius,
@@ -611,6 +791,7 @@ def create_confirmation_message_box(
611
791
  )
612
792
  buttons_layout.addWidget(confirm_button)
613
793
  confirm_button.clicked.connect(confirm_message_box.accept)
794
+
614
795
  decline_button = create_button(
615
796
  text = "No",
616
797
  font_family = button_font_family,
@@ -618,6 +799,10 @@ def create_confirmation_message_box(
618
799
  font_color = button_font_color,
619
800
  background_color = button_background_color,
620
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,
621
806
  border_width = button_border_width,
622
807
  border_color = button_border_color,
623
808
  border_radius = button_border_radius,
@@ -634,6 +819,13 @@ def create_confirmation_message_box(
634
819
  )
635
820
  buttons_layout.addWidget(decline_button)
636
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
+
637
829
  return confirm_message_box
638
830
 
639
831
  def create_list_table(
@@ -655,8 +847,8 @@ def create_list_table(
655
847
  header_font_color = "#ffffff",
656
848
  header_font_weight = "bold",
657
849
  header_background_color = "#1e1e1e",
658
- header_border_width = 0,
659
- header_border_color = "#5c5c5c",
850
+ header_border_width = 1,
851
+ header_border_color = "#191919",
660
852
  hover_header_background_color = "#333333",
661
853
  hover_header_border_width = 3,
662
854
  hover_header_border_color = "#777777",
@@ -762,6 +954,10 @@ def confirm_exit(
762
954
  label_font_size = 14,
763
955
  label_font_color = "#ffffff",
764
956
  label_padding = 15,
957
+ label_padding_top = None,
958
+ label_padding_right = None,
959
+ label_padding_bottom = None,
960
+ label_padding_left = None,
765
961
  label_border_width = 0,
766
962
  label_border_color = "#ffffff",
767
963
  label_border_radius = 0,
@@ -770,6 +966,10 @@ def confirm_exit(
770
966
  button_font_color = "#ffffff",
771
967
  button_background_color = "#1e1e1e",
772
968
  button_padding = 15,
969
+ button_padding_top = None,
970
+ button_padding_right = None,
971
+ button_padding_bottom = None,
972
+ button_padding_left = None,
773
973
  button_border_width = 2,
774
974
  button_border_color = "#5c5c5c",
775
975
  button_border_radius = 0,
@@ -794,6 +994,10 @@ def confirm_exit(
794
994
  label_font_size = label_font_size,
795
995
  label_font_color = label_font_color,
796
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,
797
1001
  label_border_width = label_border_width,
798
1002
  label_border_color = label_border_color,
799
1003
  label_border_radius = label_border_radius,
@@ -802,6 +1006,10 @@ def confirm_exit(
802
1006
  button_font_color = button_font_color,
803
1007
  button_background_color = button_background_color,
804
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,
805
1013
  button_border_width = button_border_width,
806
1014
  button_border_color = button_border_color,
807
1015
  button_border_radius = button_border_radius,
@@ -934,7 +1142,13 @@ def format_id(id_string):
934
1142
  elif len(clean_id) == 7: return f"{clean_id[0:1]}.{clean_id[1:4]}.{clean_id[4:7]}"
935
1143
  return id_string
936
1144
 
937
- def cellphone_number_format(cellphone_number):
1145
+ def format_cellphone_number(cellphone_number):
938
1146
  clean_number = "".join(filter(str.isdigit, cellphone_number))
939
1147
  if len(clean_number) == 10: return f"{clean_number[0:4]} - {clean_number[4:10]}"
940
- 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}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gui_utilities
3
- Version: 1.2.2
3
+ Version: 1.2.18
4
4
  Summary: Librería de utilidades gráficas en PyQt6
5
5
  Author-email: Guido Iván Gross <grossguidoivan@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gui_utilities"
3
- version = "1.2.2"
3
+ version = "1.2.18"
4
4
  description = "Librería de utilidades gráficas en PyQt6"
5
5
  authors = [{name = "Guido Iván Gross", email = "grossguidoivan@gmail.com"}]
6
6
  requires-python = ">=3.8"
File without changes
File without changes
File without changes