monkeyqt 0.2.3__tar.gz → 0.2.4__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.
Files changed (76) hide show
  1. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/PKG-INFO +1 -1
  2. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/__init__.py +1 -1
  3. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/basic/button.py +21 -4
  4. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt.egg-info/PKG-INFO +1 -1
  5. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/LICENSE +0 -0
  6. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/README.md +0 -0
  7. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/common/enums.py +0 -0
  8. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/basic/__init__.py +0 -0
  9. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/basic/checkbox.py +0 -0
  10. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/basic/select_card.py +0 -0
  11. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/__init__.py +0 -0
  12. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/avatar.py +0 -0
  13. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/console.py +0 -0
  14. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/data_table.py +0 -0
  15. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/image_compare.py +0 -0
  16. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/image_split.py +0 -0
  17. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/preview_dialogs.py +0 -0
  18. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/pro_table.py +0 -0
  19. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/data/table.py +0 -0
  20. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/feedback/__init__.py +0 -0
  21. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/feedback/alert.py +0 -0
  22. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/feedback/card.py +0 -0
  23. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/feedback/progress_bar.py +0 -0
  24. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/feedback/progress_ring.py +0 -0
  25. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/feedback/tooltip.py +0 -0
  26. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/auth.py +0 -0
  27. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/captcha.py +0 -0
  28. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/combobox.py +0 -0
  29. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/date_picker.py +0 -0
  30. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/form.py +0 -0
  31. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/input.py +0 -0
  32. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/multicombobox.py +0 -0
  33. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/slider.py +0 -0
  34. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/switch.py +0 -0
  35. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/form/upload.py +0 -0
  36. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/__init__.py +0 -0
  37. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/box.py +0 -0
  38. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/page.py +0 -0
  39. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/scroll_area.py +0 -0
  40. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/widget.py +0 -0
  41. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/window.py +0 -0
  42. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/layout/window_shell.py +0 -0
  43. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/__init__.py +0 -0
  44. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/avatar_menu.py +0 -0
  45. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/breadcrumb.py +0 -0
  46. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/dropdown.py +0 -0
  47. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/history.py +0 -0
  48. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/pagination.py +0 -0
  49. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/segmented.py +0 -0
  50. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/sidebar.py +0 -0
  51. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/tabs.py +0 -0
  52. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/components/navigation/topbar.py +0 -0
  53. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/core/icons.py +0 -0
  54. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/core/theme.py +0 -0
  55. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/core/theme_data.py +0 -0
  56. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/designer/plugins.py +0 -0
  57. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/icons.py +0 -0
  58. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/__init__.py +0 -0
  59. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/__main__.py +0 -0
  60. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/adapter.py +0 -0
  61. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/components/__init__.py +0 -0
  62. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/components/theme_selector.py +0 -0
  63. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/engine.py +0 -0
  64. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/gallery.py +0 -0
  65. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/manager.py +0 -0
  66. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/names.py +0 -0
  67. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/palette_theme.py +0 -0
  68. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/style_utils.py +0 -0
  69. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/tokens.py +0 -0
  70. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt/themes/unified_qss.py +0 -0
  71. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt.egg-info/SOURCES.txt +0 -0
  72. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt.egg-info/dependency_links.txt +0 -0
  73. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt.egg-info/requires.txt +0 -0
  74. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/monkeyqt.egg-info/top_level.txt +0 -0
  75. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/pyproject.toml +0 -0
  76. {monkeyqt-0.2.3 → monkeyqt-0.2.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monkeyqt
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: An Enterprise-grade PySide6 UI Component Library
5
5
  Project-URL: Homepage, https://github.com/luohuabuxiema/MonkeyQt
6
6
  Requires-Python: >=3.8
@@ -81,7 +81,7 @@ from .themes import (
81
81
  modern_scrollbar_qss,
82
82
  )
83
83
 
84
- __version__ = "0.2.3"
84
+ __version__ = "0.2.4"
85
85
 
86
86
  __all__ = [
87
87
  "MkButton",
@@ -214,10 +214,23 @@ class MkButton(QPushButton):
214
214
  qss += f"\nQPushButton {{ {size_qss} }}"
215
215
  _MkThemeEngine.apply_style_sheet(self, qss)
216
216
 
217
+ def sizeHint(self):
218
+ hint = super().sizeHint()
219
+ fm = self.fontMetrics()
220
+ text_w = fm.horizontalAdvance(self.text()) if self.text() else 0
221
+ icon_w = self.iconSize().width() if not self.icon().isNull() else 0
222
+ spacing = 8 if (icon_w and text_w) else 0
223
+ padding_h = 28 if text_w else 0
224
+ w = max(hint.width(), icon_w + text_w + spacing + padding_h)
225
+ h = max(hint.height(), 36)
226
+ from PySide6.QtCore import QSize
227
+ return QSize(w, h)
228
+
217
229
  def paintEvent(self, event):
218
230
  t = ThemeEngine
219
231
  painter = QPainter(self)
220
232
  painter.setRenderHint(QPainter.RenderHint.Antialiasing)
233
+ painter.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform)
221
234
  rect = self.rect()
222
235
  primary = t.get("--primary", "#409EFF")
223
236
  bg = t.get("--bg", "#FFFFFF")
@@ -411,7 +424,7 @@ class MkButton(QPushButton):
411
424
  icon_sz = self.iconSize()
412
425
  icon_w = icon_sz.width()
413
426
  icon_h = icon_sz.height()
414
- spacing = 6 if text else 0
427
+ spacing = 8 if text else 0
415
428
  fm = painter.fontMetrics()
416
429
  text_w = fm.horizontalAdvance(text) if text else 0
417
430
  total_w = icon_w + spacing + text_w
@@ -419,8 +432,7 @@ class MkButton(QPushButton):
419
432
  start_x = rect.left() + (rect.width() - total_w) // 2
420
433
  icon_y = rect.top() + (rect.height() - icon_h) // 2
421
434
 
422
- pixmap = icon.pixmap(icon_sz)
423
- painter.drawPixmap(start_x, icon_y, pixmap)
435
+ icon.paint(painter, QRect(start_x, icon_y, icon_w, icon_h))
424
436
 
425
437
  if text:
426
438
  text_rect = QRect(start_x + icon_w + spacing, rect.top(), text_w + 10, rect.height())
@@ -482,7 +494,7 @@ class MkButton(QPushButton):
482
494
  def setIcon(self, icon):
483
495
  if isinstance(icon, str):
484
496
  try:
485
- from monkeyqt.icons import Ph
497
+ from monkeyqt_icons import Ph
486
498
  pm = Ph.pixmap(icon, size=16, color=self._get_button_text_color())
487
499
  if pm and not pm.isNull():
488
500
  icon = QIcon(pm)
@@ -491,11 +503,15 @@ class MkButton(QPushButton):
491
503
  elif hasattr(icon, "_ph_spec"):
492
504
  self._ph_icon_spec = getattr(icon, "_ph_spec", None)
493
505
  try:
506
+ from monkeyqt_icons import Ph
494
507
  spec = dict(self._ph_icon_spec)
495
508
  orig_color = spec.get("color")
496
509
  if orig_color in (None, "auto", "default", "fg", "foreground", "currentcolor"):
497
510
  spec["color"] = self._get_button_text_color()
498
511
  icon = Ph.icon(**spec)
512
+ if "size" in spec and isinstance(spec["size"], int):
513
+ from PySide6.QtCore import QSize
514
+ self.setIconSize(QSize(spec["size"], spec["size"]))
499
515
  except Exception:
500
516
  pass
501
517
  super().setIcon(icon)
@@ -504,6 +520,7 @@ class MkButton(QPushButton):
504
520
  self._update_style()
505
521
  if getattr(self, "_ph_icon_spec", None):
506
522
  try:
523
+ from monkeyqt_icons import Ph
507
524
  spec = dict(self._ph_icon_spec)
508
525
  orig_color = spec.get("color")
509
526
  if orig_color in (None, "auto", "default", "fg", "foreground", "currentcolor"):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monkeyqt
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: An Enterprise-grade PySide6 UI Component Library
5
5
  Project-URL: Homepage, https://github.com/luohuabuxiema/MonkeyQt
6
6
  Requires-Python: >=3.8
File without changes
File without changes
File without changes
File without changes
File without changes