feat: add application icon and Windows identity for V1.1.3

This commit is contained in:
阿白叔 committed 2026-10-19 17:45:42 +08:00
1 parent 54c41d4525
commit 95c7f9b775
16 files changed
+203 -11

No files matched your search

@@ -10,6 +10,7 @@ import sys
from typing import Sequence
from PySide6.QtCore import QTimer, QThreadPool
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication
from dx_productivity.trial_task_center.logging_setup import LoggingContext, configure_logging, install_exception_hooks
@@ -28,6 +29,22 @@ def _load_window():
return TrialTaskCenterWindow
def configure_application_identity(application: QApplication) -> None:
"""Use one stable Windows identity and icon for source and portable launches."""
from dx_productivity import trial_task_center
if os.name == 'nt':
import ctypes
set_app_id = ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID
set_app_id.argtypes = (ctypes.c_wchar_p,)
set_app_id.restype = ctypes.c_long
set_app_id('DxProductivity.DxPartReplace')
application.setApplicationName('DxPartReplace')
application.setApplicationVersion(VERSION)
application.setWindowIcon(QIcon(str(Path(trial_task_center.__file__).parent / 'assets/app.ico')))
def _parse_arguments(argv: Sequence[str] | None) -> argparse.Namespace:
parser = argparse.ArgumentParser(prog="DxPartReplace")
parser.add_argument("--smoke-test", action="store_true", help=argparse.SUPPRESS)
@@ -127,6 +144,7 @@ def main(argv: Sequence[str] | None = None) -> int:
store = TaskStore(database_path)
service = TaskCenterService(store, logging_context)
qt_application = QApplication([sys.executable, *(argv or ())])
configure_application_identity(qt_application)
window = _load_window()(service)
window.show()
if arguments.smoke_test:
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
<defs>
<linearGradient id="tile" x1="0" y1="0" x2="1" y2="1">
<stop stop-color="#164D91"/>
<stop offset="1" stop-color="#079D98"/>
</linearGradient>
</defs>
<rect x="16" y="16" width="224" height="224" rx="52" fill="url(#tile)"/>
<g fill="none" stroke="#FFFFFF" stroke-width="12" stroke-linecap="round" stroke-linejoin="round">
<path d="M62 97V82Q62 60 84 60H184M169 46L184 60L169 74"/>
<path d="M194 159V174Q194 196 172 196H72M87 182L72 196L87 210"/>
</g>
<g fill="none" stroke="#FFFFFF" stroke-width="9" stroke-linecap="round">
<rect x="88" y="96" width="80" height="64" rx="10"/>
<path d="M76 112H88M76 128H88M76 144H88M168 112H180M168 128H180M168 144H180"/>
</g>
<rect x="109" y="117" width="38" height="22" rx="5" fill="#9BF0DE"/>
</svg>

After

Width:  |  Height:  |  Size: 883 B

@@ -1 +1 @@
VERSION = "1.1.2"
VERSION = "1.1.3"