prkit 0.3.4__tar.gz → 0.3.6__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.
- {prkit-0.3.4 → prkit-0.3.6}/PKG-INFO +4 -4
- {prkit-0.3.4 → prkit-0.3.6}/README.md +3 -3
- {prkit-0.3.4 → prkit-0.3.6}/pyproject.toml +1 -1
- {prkit-0.3.4 → prkit-0.3.6}/pyproject.toml.orig +1 -1
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/__init__.py +1 -1
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/app.py +1 -1
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/icon.py +14 -2
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/platform.py +3 -3
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/tray.py +23 -1
- {prkit-0.3.4 → prkit-0.3.6}/LICENSE +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/__main__.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/autostart.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/capslock.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/cursor_watchdog.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/input_source.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/keyboard.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/keys.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/language.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/mac_capslock.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/mac_keyboard.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/message_dialog.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/overlays.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/py.typed +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/settings.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/single_instance.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/src/prkit/spotlight.py +0 -0
- {prkit-0.3.4 → prkit-0.3.6}/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
|
+
Version: 0.3.6
|
|
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.
|
|
44
|
-
| macOS Apple Silicon | `PRKit-0.3.
|
|
43
|
+
| Windows x64 | `PRKit-0.3.6-windows-x64.zip` | 解壓完整資料夾後執行 `PRKit/PRKit.exe` |
|
|
44
|
+
| macOS Apple Silicon | `PRKit-0.3.6-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.
|
|
77
|
+
若要固定特定版本,將 `latest` 改成版本標籤,例如 `v0.3.6`。
|
|
78
78
|
|
|
79
79
|
## 授權
|
|
80
80
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
| 平台 | 下載檔案 | 啟動方式 |
|
|
23
23
|
| --- | --- | --- |
|
|
24
|
-
| Windows x64 | `PRKit-0.3.
|
|
25
|
-
| macOS Apple Silicon | `PRKit-0.3.
|
|
24
|
+
| Windows x64 | `PRKit-0.3.6-windows-x64.zip` | 解壓完整資料夾後執行 `PRKit/PRKit.exe` |
|
|
25
|
+
| macOS Apple Silicon | `PRKit-0.3.6-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.
|
|
58
|
+
若要固定特定版本,將 `latest` 改成版本標籤,例如 `v0.3.6`。
|
|
59
59
|
|
|
60
60
|
## 授權
|
|
61
61
|
|
|
@@ -347,7 +347,7 @@ def create_application(arguments: Sequence[str] | None = None) -> QApplication:
|
|
|
347
347
|
app = QApplication(list(arguments) if arguments is not None else sys.argv)
|
|
348
348
|
app.setOrganizationName("prkit")
|
|
349
349
|
app.setApplicationName("簡報瑞士刀")
|
|
350
|
-
app.setWindowIcon(tray_icon())
|
|
350
|
+
app.setWindowIcon(tray_icon(template=False))
|
|
351
351
|
app.setQuitOnLastWindowClosed(False)
|
|
352
352
|
set_qt_language(app, SettingsStore().load().language)
|
|
353
353
|
return app
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import sys
|
|
4
|
+
|
|
3
5
|
from PySide6.QtCore import QByteArray
|
|
4
6
|
from PySide6.QtGui import QColor, QFont, QIcon, QPainter, QPen, QPixmap
|
|
5
7
|
from PySide6.QtSvg import QSvgRenderer
|
|
@@ -11,9 +13,18 @@ TRAY_ICON_SVG = b"""<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
|
11
13
|
<circle cx="32" cy="32" r="27" fill="url(#g)"/><circle cx="32" cy="32" r="8" fill="#fff"/>
|
|
12
14
|
</svg>"""
|
|
13
15
|
|
|
16
|
+
# macOS menu bar icons must be monochrome template images: only the alpha
|
|
17
|
+
# channel matters and the system tints them for light/dark menu bars.
|
|
18
|
+
TEMPLATE_ICON_SVG = b"""<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
19
|
+
<circle cx="32" cy="32" r="24" fill="none" stroke="#000" stroke-width="6"/>
|
|
20
|
+
<circle cx="32" cy="32" r="9" fill="#000"/>
|
|
21
|
+
</svg>"""
|
|
22
|
+
|
|
14
23
|
|
|
15
|
-
def tray_icon() -> QIcon:
|
|
16
|
-
|
|
24
|
+
def tray_icon(template: bool | None = None) -> QIcon:
|
|
25
|
+
if template is None:
|
|
26
|
+
template = sys.platform == "darwin"
|
|
27
|
+
renderer = QSvgRenderer(QByteArray(TEMPLATE_ICON_SVG if template else TRAY_ICON_SVG))
|
|
17
28
|
icon = QIcon()
|
|
18
29
|
for size in (16, 20, 24, 32, 48, 64):
|
|
19
30
|
pixmap = QPixmap(size, size)
|
|
@@ -22,6 +33,7 @@ def tray_icon() -> QIcon:
|
|
|
22
33
|
renderer.render(painter)
|
|
23
34
|
painter.end()
|
|
24
35
|
icon.addPixmap(pixmap)
|
|
36
|
+
icon.setIsMask(template)
|
|
25
37
|
return icon
|
|
26
38
|
|
|
27
39
|
|
|
@@ -37,14 +37,14 @@ def make_window_click_through(widget: QWidget) -> None:
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def configure_overlay_level(widget: QWidget) -> None:
|
|
40
|
-
"""Keep macOS overlays above apps
|
|
40
|
+
"""Keep macOS overlays above apps, the menu bar and popup menus (still click-through)."""
|
|
41
41
|
if sys.platform != "darwin":
|
|
42
42
|
return
|
|
43
43
|
try:
|
|
44
44
|
import objc
|
|
45
45
|
from AppKit import (
|
|
46
46
|
NSColor,
|
|
47
|
-
|
|
47
|
+
NSPopUpMenuWindowLevel,
|
|
48
48
|
NSWindowAnimationBehaviorNone,
|
|
49
49
|
NSWindowCollectionBehaviorCanJoinAllSpaces,
|
|
50
50
|
NSWindowCollectionBehaviorFullScreenAuxiliary,
|
|
@@ -56,7 +56,7 @@ def configure_overlay_level(widget: QWidget) -> None:
|
|
|
56
56
|
return
|
|
57
57
|
native_view = objc.objc_object(c_void_p=int(widget.winId()))
|
|
58
58
|
native_window = native_view.window()
|
|
59
|
-
native_window.setLevel_(
|
|
59
|
+
native_window.setLevel_(NSPopUpMenuWindowLevel + 1)
|
|
60
60
|
native_window.setHidesOnDeactivate_(False)
|
|
61
61
|
native_window.setAnimationBehavior_(NSWindowAnimationBehaviorNone)
|
|
62
62
|
native_window.setHasShadow_(False)
|
|
@@ -22,6 +22,7 @@ from PySide6.QtWidgets import (
|
|
|
22
22
|
QWidgetAction,
|
|
23
23
|
)
|
|
24
24
|
|
|
25
|
+
from prkit import __version__
|
|
25
26
|
from prkit.icon import language_icon, tray_icon
|
|
26
27
|
from prkit.language import effective_language, tr
|
|
27
28
|
from prkit.platform import is_wayland
|
|
@@ -32,6 +33,10 @@ from prkit.settings import (
|
|
|
32
33
|
)
|
|
33
34
|
|
|
34
35
|
|
|
36
|
+
def app_version_text(language: str) -> str:
|
|
37
|
+
return f"{tr('簡報瑞士刀', language)} v{__version__}"
|
|
38
|
+
|
|
39
|
+
|
|
35
40
|
class ColorButton(QPushButton):
|
|
36
41
|
color_changed = Signal(str)
|
|
37
42
|
|
|
@@ -137,6 +142,23 @@ class SettingsPanel(QWidget):
|
|
|
137
142
|
layout.setContentsMargins(14, 12, 14, 12)
|
|
138
143
|
layout.setSpacing(10)
|
|
139
144
|
|
|
145
|
+
header = QHBoxLayout()
|
|
146
|
+
self.title_label = QLabel("簡報瑞士刀")
|
|
147
|
+
self.title_label.setProperty("i18n", "簡報瑞士刀")
|
|
148
|
+
title_font = self.title_label.font()
|
|
149
|
+
title_font.setBold(True)
|
|
150
|
+
title_font.setPointSize(title_font.pointSize() + 2)
|
|
151
|
+
self.title_label.setFont(title_font)
|
|
152
|
+
header.addWidget(self.title_label)
|
|
153
|
+
header.addStretch(1)
|
|
154
|
+
self.version_label = QLabel(f"v{__version__}")
|
|
155
|
+
self.version_label.setStyleSheet(
|
|
156
|
+
"background: palette(midlight); border-radius: 5px; padding: 3px 6px;"
|
|
157
|
+
)
|
|
158
|
+
header.addWidget(self.version_label)
|
|
159
|
+
layout.addLayout(header)
|
|
160
|
+
layout.addWidget(self._separator())
|
|
161
|
+
|
|
140
162
|
self.spotlight_enabled = QCheckBox("啟用聚光燈游標")
|
|
141
163
|
self.spotlight_enabled.setProperty("i18n", "啟用聚光燈游標")
|
|
142
164
|
self.spotlight_enabled.setChecked(settings.spotlight.enabled)
|
|
@@ -362,7 +384,7 @@ class TrayController(QObject):
|
|
|
362
384
|
self.language_button.setIcon(language_icon(self.language_mode))
|
|
363
385
|
self.language_button.setToolTip(self.language_label.text())
|
|
364
386
|
self.exit_action.setText(tr("結束", language))
|
|
365
|
-
self.tray.setToolTip(
|
|
387
|
+
self.tray.setToolTip(app_version_text(language))
|
|
366
388
|
|
|
367
389
|
def set_language(self, preference: str) -> None:
|
|
368
390
|
self.language_mode = preference
|
|
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
|
|
File without changes
|