gui-utilities 1.1.14__py3-none-any.whl → 1.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gui-utilities might be problematic. Click here for more details.

@@ -1,5 +1,5 @@
1
1
  from PyQt6.QtCore import Qt, QObject, QEvent, QSize
2
- from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QComboBox, QDialog, QToolButton, QWidgetAction, QCheckBox
2
+ from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QComboBox, QDialog, QToolButton, QWidgetAction, QCheckBox, QTableWidget, QHeaderView
3
3
  from PyQt6.QtGui import QIcon
4
4
  import re
5
5
  import requests
@@ -376,7 +376,7 @@ def create_checkbox(
376
376
  pressed_indicator_border_color = "#0078d7",
377
377
  checked_indicator_background_color = "#ffffff",
378
378
  checked_indicator_border_width = 1,
379
- checked_indicator_border_color = "#ffffff",
379
+ checked_indicator_border_color = "#5c5c5c",
380
380
  disabled_font_color = "#888888",
381
381
  disabled_background_color = "#2d2d2d",
382
382
  disabled_border_width = 1,
@@ -461,6 +461,7 @@ def create_information_message_box(
461
461
  message_box = QDialog()
462
462
  message_box.setObjectName("message_box")
463
463
  message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
464
+ message_box.setMinimumWidth(240)
464
465
  message_box.setMaximumWidth(480)
465
466
  style_sheet = f"""
466
467
  QDialog#message_box {{
@@ -553,6 +554,7 @@ def create_confirmation_message_box(
553
554
  confirm_message_box = QDialog()
554
555
  confirm_message_box.setObjectName("confirm_message_box")
555
556
  confirm_message_box.setWindowFlags(Qt.WindowType.FramelessWindowHint)
557
+ confirm_message_box.setMinimumWidth(240)
556
558
  confirm_message_box.setMaximumWidth(480)
557
559
  style_sheet = f"""
558
560
  QDialog#confirm_message_box {{
@@ -631,6 +633,122 @@ def create_confirmation_message_box(
631
633
  decline_button.clicked.connect(confirm_message_box.reject)
632
634
  return confirm_message_box
633
635
 
636
+ def create_list_table(
637
+ items_data,
638
+ column_headers,
639
+ column_proportions,
640
+ row_populator_function,
641
+ font_family = "Segoe UI",
642
+ font_size = 14,
643
+ font_color = "#ffffff",
644
+ background_color = "#1e1e1e",
645
+ border_width = 2,
646
+ border_color = "#5c5c5c",
647
+ item_font_color = "#ffffff",
648
+ item_background_color = "#1e1e1e",
649
+ selected_item_background_color = "#0078d7",
650
+ header_font_family = "Segoe UI",
651
+ header_font_size = 14,
652
+ header_font_color = "#ffffff",
653
+ header_font_weight = "bold",
654
+ header_background_color = "#1e1e1e",
655
+ header_border_width = 0,
656
+ header_border_color = "#5c5c5c",
657
+ hover_header_background_color = "#333333",
658
+ hover_header_border_width = 3,
659
+ hover_header_border_color = "#777777",
660
+ pressed_header_background_color = "#4a4a4a",
661
+ pressed_header_border_width = 3,
662
+ pressed_header_border_color = "#0078d7",
663
+ scrollbar_background_color = "#1e1e1e",
664
+ scrollbar_handle_background_color = "#333333",
665
+ hover_scrollbar_handle_background_color = "#4a4a4a",
666
+ hover_scrollbar_handle_border_width = 3,
667
+ hover_scrollbar_handle_border_color = "#777777",
668
+ pressed_scrollbar_handle_background_color = "#4a4a4a",
669
+ pressed_scrollbar_handle_border_width = 3,
670
+ pressed_scrollbar_handle_border_color = "#0078d7"
671
+ ):
672
+ list_table = QTableWidget()
673
+ list_table.verticalHeader().setVisible(False)
674
+ list_table.setColumnCount(len(column_headers))
675
+ list_table.setHorizontalHeaderLabels(column_headers)
676
+ header = list_table.horizontalHeader()
677
+ header.setSectionResizeMode(QHeaderView.ResizeMode.Interactive)
678
+
679
+ def resize_columns():
680
+ total_width = list_table.viewport().width()
681
+ if total_width == 0: return
682
+ for i, proportion in enumerate(column_proportions):
683
+ list_table.setColumnWidth(i, int(total_width * proportion))
684
+
685
+ resize_columns()
686
+ original_resize_event = list_table.resizeEvent
687
+
688
+ def on_resize(event):
689
+ resize_columns()
690
+ if original_resize_event: original_resize_event(event)
691
+
692
+ list_table.resizeEvent = on_resize
693
+ style_sheet = f"""
694
+ QTableWidget {{
695
+ color: {font_color};
696
+ background-color: {background_color};
697
+ font-family: {font_family};
698
+ font-size: {font_size}px;
699
+ border: {border_width}px solid {border_color};
700
+ }}
701
+ QTableWidget::item {{
702
+ color: {item_font_color};
703
+ background-color: {item_background_color};
704
+ border: none;
705
+ }}
706
+ QTableWidget::item:selected {{
707
+ background-color: {selected_item_background_color};
708
+ }}
709
+ QHeaderView::section {{
710
+ color: {header_font_color};
711
+ background-color: {header_background_color};
712
+ font-family: {header_font_family};
713
+ font-size: {header_font_size}px;
714
+ font-weight: {header_font_weight};
715
+ border: {header_border_width}px solid {header_border_color};
716
+ }}
717
+ QHeaderView::section:hover {{
718
+ background-color: {hover_header_background_color};
719
+ border: {hover_header_border_width}px solid {hover_header_border_color};
720
+ }}
721
+ QHeaderView::section:pressed {{
722
+ background-color: {pressed_header_background_color};
723
+ border: {pressed_header_border_width}px solid {pressed_header_border_color};
724
+ }}
725
+ QScrollBar:vertical {{
726
+ background-color: {scrollbar_background_color};
727
+ border: none;
728
+ }}
729
+ QScrollBar::handle:vertical {{
730
+ background-color: {scrollbar_handle_background_color};
731
+ border: none;
732
+ }}
733
+ QScrollBar::handle:vertical:hover {{
734
+ background-color: {hover_scrollbar_handle_background_color};
735
+ border: {hover_scrollbar_handle_border_width}px solid {hover_scrollbar_handle_border_color};
736
+ }}
737
+ QScrollBar::handle:vertical:pressed {{
738
+ background-color: {pressed_scrollbar_handle_background_color};
739
+ border: {pressed_scrollbar_handle_border_width}px solid {pressed_scrollbar_handle_border_color};
740
+ }}
741
+ """
742
+ list_table.setStyleSheet(style_sheet)
743
+ list_table.setRowCount(len(items_data))
744
+ for row, item_data in enumerate(items_data):
745
+ items = row_populator_function(item_data)
746
+ for item in items:
747
+ item.setTextAlignment(Qt.AlignmentFlag.AlignCenter)
748
+ for column, item in enumerate(items):
749
+ list_table.setItem(row, column, item)
750
+ return list_table
751
+
634
752
  def confirm_exit(
635
753
  window,
636
754
  background_color = "#1e1e1e",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gui_utilities
3
- Version: 1.1.14
3
+ Version: 1.2.0
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
@@ -0,0 +1,11 @@
1
+ gui_utilities/gui_utilities.py,sha256=zWW6HYyUILAV-hLQXkMLJlNE8NyUKV-O0TR6La2v1os,36363
2
+ gui_utilities/icons/focused_hide_text_icon.png,sha256=0Ysx7vC-mEVfuSBWx1Zw-UhpqvrTCcIvnQ926wFmuK4,13084
3
+ gui_utilities/icons/focused_show_text_icon.png,sha256=gmZU7RR4FN-9VSzpD00ZkQ8UGbihO2y808Kh3b_TaEg,6739
4
+ gui_utilities/icons/hide_text_icon.png,sha256=f5jq6KaAygWNjzP_Ah6dw6eu8q5ml3m56JTeNSTSgEU,7207
5
+ gui_utilities/icons/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
6
+ gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
7
+ gui_utilities-1.2.0.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
8
+ gui_utilities-1.2.0.dist-info/METADATA,sha256=5JDOV7Sc3P4P-UFsVJHs3zrnUs6kKeumgRIkaYKK0eY,265
9
+ gui_utilities-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ gui_utilities-1.2.0.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
11
+ gui_utilities-1.2.0.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- gui_utilities/gui_utilities.py,sha256=Qs7YAu9RFb1qClH4q2S5LXoFSoFSh8QWjnkxMj1-NCk,31707
2
- gui_utilities/icons/checked_verification_mark_icon.png,sha256=io3pvAu8cYugk5mmVGtGCKKzTSNLIINGMJcTySKv8e8,6587
3
- gui_utilities/icons/focused_hide_text_icon.png,sha256=0Ysx7vC-mEVfuSBWx1Zw-UhpqvrTCcIvnQ926wFmuK4,13084
4
- gui_utilities/icons/focused_show_text_icon.png,sha256=gmZU7RR4FN-9VSzpD00ZkQ8UGbihO2y808Kh3b_TaEg,6739
5
- gui_utilities/icons/hide_text_icon.png,sha256=f5jq6KaAygWNjzP_Ah6dw6eu8q5ml3m56JTeNSTSgEU,7207
6
- gui_utilities/icons/hover_verification_mark_icon.png,sha256=V--qmtXpVl1LNCusQEgRcJk8RU6pfzCqYCRNOoeZR5c,7382
7
- gui_utilities/icons/show_text_icon.png,sha256=8Vdp2XickPEM-eTb1-qBXf3qmHldSzllMZZfObir9p8,5376
8
- gui_utilities/tlds/tlds_list.txt,sha256=wIWmAQGVNsY0ZJy7qPW8kItDTCE4PTq8wcUhC2hpjkw,10916
9
- gui_utilities-1.1.14.dist-info/licenses/LICENSE,sha256=NNoMFs43kWl1J-aqq7_EsPlBjL5XTccWjZlwrlCR-Xc,1093
10
- gui_utilities-1.1.14.dist-info/METADATA,sha256=S-MFOHNro1e-Uz9mZbRQqBgQng90n9BqujjWjW3qCgE,266
11
- gui_utilities-1.1.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- gui_utilities-1.1.14.dist-info/top_level.txt,sha256=c4C84nMT41keiX9b1AJJZDBU3kA38c7vOmP9kDie8Lk,14
13
- gui_utilities-1.1.14.dist-info/RECORD,,