prkit 0.3.3__tar.gz → 0.3.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 (27) hide show
  1. {prkit-0.3.3 → prkit-0.3.4}/PKG-INFO +4 -4
  2. {prkit-0.3.3 → prkit-0.3.4}/README.md +3 -3
  3. {prkit-0.3.3 → prkit-0.3.4}/pyproject.toml +1 -1
  4. {prkit-0.3.3 → prkit-0.3.4}/pyproject.toml.orig +1 -1
  5. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/__init__.py +1 -1
  6. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/app.py +3 -1
  7. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/language.py +20 -1
  8. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/tray.py +4 -2
  9. {prkit-0.3.3 → prkit-0.3.4}/LICENSE +0 -0
  10. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/__main__.py +0 -0
  11. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/autostart.py +0 -0
  12. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/capslock.py +0 -0
  13. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/cursor_watchdog.py +0 -0
  14. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/icon.py +0 -0
  15. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/input_source.py +0 -0
  16. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/keyboard.py +0 -0
  17. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/keys.py +0 -0
  18. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/mac_capslock.py +0 -0
  19. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/mac_keyboard.py +0 -0
  20. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/message_dialog.py +0 -0
  21. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/overlays.py +0 -0
  22. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/platform.py +0 -0
  23. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/py.typed +0 -0
  24. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/settings.py +0 -0
  25. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/single_instance.py +0 -0
  26. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/spotlight.py +0 -0
  27. {prkit-0.3.3 → prkit-0.3.4}/src/prkit/windows_cursor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prkit
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: A cross-platform system-tray presentation toolkit
5
5
  Author: meebox
6
6
  Author-email: meebox <meebox@gmail.com>
@@ -40,8 +40,8 @@ Description-Content-Type: text/markdown
40
40
 
41
41
  | 平台 | 下載檔案 | 啟動方式 |
42
42
  | --- | --- | --- |
43
- | Windows x64 | `PRKit-0.3.3-windows-x64.zip` | 解壓完整資料夾後執行 `PRKit/PRKit.exe` |
44
- | macOS Apple Silicon | `PRKit-0.3.3-macos-arm64.dmg` | 開啟 DMG,將 `PRKit.app` 拖到「Applications」捷徑後啟動 |
43
+ | Windows x64 | `PRKit-0.3.4-windows-x64.zip` | 解壓完整資料夾後執行 `PRKit/PRKit.exe` |
44
+ | macOS Apple Silicon | `PRKit-0.3.4-macos-arm64.dmg` | 開啟 DMG,將 `PRKit.app` 拖到「Applications」捷徑後啟動 |
45
45
 
46
46
  Windows ZIP 包含完整執行環境與游標復原 watchdog;請保留整個 `PRKit` 資料夾。macOS 目前僅提供 Apple Silicon 版。程式啟動後顯示在系統匣/選單列,不會開啟主視窗。若啟用了開機自動啟動,搬移 Windows 資料夾後請在選單取消勾選再重新勾選,以更新啟動路徑。
47
47
 
@@ -74,7 +74,7 @@ uv tool install git+https://github.com/codemee/prkit.git@latest
74
74
  prkit
75
75
  ```
76
76
 
77
- 若要固定特定版本,將 `latest` 改成版本標籤,例如 `v0.3.3`。
77
+ 若要固定特定版本,將 `latest` 改成版本標籤,例如 `v0.3.4`。
78
78
 
79
79
  ## 授權
80
80
 
@@ -21,8 +21,8 @@
21
21
 
22
22
  | 平台 | 下載檔案 | 啟動方式 |
23
23
  | --- | --- | --- |
24
- | Windows x64 | `PRKit-0.3.3-windows-x64.zip` | 解壓完整資料夾後執行 `PRKit/PRKit.exe` |
25
- | macOS Apple Silicon | `PRKit-0.3.3-macos-arm64.dmg` | 開啟 DMG,將 `PRKit.app` 拖到「Applications」捷徑後啟動 |
24
+ | Windows x64 | `PRKit-0.3.4-windows-x64.zip` | 解壓完整資料夾後執行 `PRKit/PRKit.exe` |
25
+ | macOS Apple Silicon | `PRKit-0.3.4-macos-arm64.dmg` | 開啟 DMG,將 `PRKit.app` 拖到「Applications」捷徑後啟動 |
26
26
 
27
27
  Windows ZIP 包含完整執行環境與游標復原 watchdog;請保留整個 `PRKit` 資料夾。macOS 目前僅提供 Apple Silicon 版。程式啟動後顯示在系統匣/選單列,不會開啟主視窗。若啟用了開機自動啟動,搬移 Windows 資料夾後請在選單取消勾選再重新勾選,以更新啟動路徑。
28
28
 
@@ -55,7 +55,7 @@ uv tool install git+https://github.com/codemee/prkit.git@latest
55
55
  prkit
56
56
  ```
57
57
 
58
- 若要固定特定版本,將 `latest` 改成版本標籤,例如 `v0.3.3`。
58
+ 若要固定特定版本,將 `latest` 改成版本標籤,例如 `v0.3.4`。
59
59
 
60
60
  ## 授權
61
61
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "prkit"
3
- version = "0.3.3"
3
+ version = "0.3.4"
4
4
  description = "A cross-platform system-tray presentation toolkit"
5
5
  readme = "README.md"
6
6
  license = "GPL-3.0-or-later"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "prkit"
3
- version = "0.3.3"
3
+ version = "0.3.4"
4
4
  description = "A cross-platform system-tray presentation toolkit"
5
5
  readme = "README.md"
6
6
  license = "GPL-3.0-or-later"
@@ -1,3 +1,3 @@
1
1
  """Presentation tools for the system tray."""
2
2
 
3
- __version__ = "0.3.3"
3
+ __version__ = "0.3.4"
@@ -13,7 +13,7 @@ from prkit.capslock import CapsLockMonitor
13
13
  from prkit.icon import tray_icon
14
14
  from prkit.input_source import InputSourceMonitor
15
15
  from prkit.keyboard import KeyboardMonitor
16
- from prkit.language import effective_language, tr
16
+ from prkit.language import effective_language, set_qt_language, tr
17
17
  from prkit.message_dialog import MessageDialog
18
18
  from prkit.overlays import CapsLockOverlay, KeystrokeOverlay
19
19
  from prkit.settings import SettingsStore, SettingsStoreProtocol
@@ -158,6 +158,7 @@ class AppController(QObject):
158
158
  def set_language(self, preference: str) -> None:
159
159
  if preference not in {"system", "zh", "en"}:
160
160
  return
161
+ set_qt_language(self._app, preference)
161
162
  self.settings.language = preference
162
163
  self.tray.set_language(preference)
163
164
  self.capslock.setToolTip(self._text("拖曳以移動狀態提示"))
@@ -348,6 +349,7 @@ def create_application(arguments: Sequence[str] | None = None) -> QApplication:
348
349
  app.setApplicationName("簡報瑞士刀")
349
350
  app.setWindowIcon(tray_icon())
350
351
  app.setQuitOnLastWindowClosed(False)
352
+ set_qt_language(app, SettingsStore().load().language)
351
353
  return app
352
354
 
353
355
 
@@ -1,8 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import sys
4
+ from pathlib import Path
4
5
 
5
- from PySide6.QtCore import QLocale
6
+ from PySide6.QtCore import QCoreApplication, QLibraryInfo, QLocale, QTranslator
6
7
 
7
8
  ENGLISH = {
8
9
  "簡報瑞士刀": "PRKit",
@@ -69,3 +70,21 @@ def effective_language(preference: str) -> str:
69
70
 
70
71
  def tr(text: str, language: str) -> str:
71
72
  return ENGLISH.get(text, text) if language == "en" else text
73
+
74
+
75
+ def set_qt_language(app: QCoreApplication, preference: str) -> None:
76
+ """Translate Qt-owned dialogs alongside PRKit's own interface."""
77
+ previous = getattr(app, "_prkit_qt_translator", None)
78
+ if previous is not None:
79
+ app.removeTranslator(previous)
80
+ previous.deleteLater()
81
+ app._prkit_qt_translator = None
82
+ if effective_language(preference) != "zh":
83
+ return
84
+
85
+ path = Path(QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath)) / "qtbase_zh_TW.qm"
86
+ translator = QTranslator(app)
87
+ if not translator.load(str(path)):
88
+ raise RuntimeError(f"Could not load Qt translation: {path}")
89
+ app.installTranslator(translator)
90
+ app._prkit_qt_translator = translator
@@ -37,6 +37,7 @@ class ColorButton(QPushButton):
37
37
 
38
38
  def __init__(self, color: str, parent: QWidget | None = None) -> None:
39
39
  super().__init__(parent)
40
+ self.setObjectName("colorSwatch")
40
41
  self._color = color
41
42
  self._dialog_title = "選擇顏色"
42
43
  self.setFixedSize(42, 24)
@@ -58,9 +59,10 @@ class ColorButton(QPushButton):
58
59
  if swatch.lightnessF() < 0.05:
59
60
  hover = QColor("#303030")
60
61
  self.setStyleSheet(
61
- f"QPushButton {{ background: {self._color}; border: none; "
62
+ f"QPushButton#colorSwatch {{ background: {self._color}; border: none; "
62
63
  "border-radius: 6px; }"
63
- f"QPushButton:hover, QPushButton:focus {{ background: {hover.name()}; }}"
64
+ f"QPushButton#colorSwatch:hover, QPushButton#colorSwatch:focus "
65
+ f"{{ background: {hover.name()}; }}"
64
66
  )
65
67
 
66
68
  def _choose_color(self) -> None:
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes