feat(gui): 添加应用图标 x.png
This commit is contained in:
@@ -28,7 +28,7 @@ if sys.platform.startswith("win") and "QT_QPA_PLATFORM" not in os.environ:
|
||||
|
||||
try:
|
||||
from PySide6.QtCore import QEasingCurve, QEvent, QPropertyAnimation, Qt, QTimer, QUrl
|
||||
from PySide6.QtGui import QDragEnterEvent, QDragMoveEvent, QDropEvent, QFont, QKeyEvent, QPixmap
|
||||
from PySide6.QtGui import QDragEnterEvent, QDragMoveEvent, QDropEvent, QFont, QIcon, QKeyEvent, QPixmap
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QAbstractItemView,
|
||||
@@ -73,7 +73,7 @@ from .core import (
|
||||
read_3mf_summary,
|
||||
)
|
||||
from .builder import preview_members_for_gcode_member, resolve_output_gcode_member
|
||||
from .paths import default_patch_config_path, default_swap_gcode_dir, user_settings_path
|
||||
from .paths import default_patch_config_path, default_swap_gcode_dir, program_root, user_settings_path
|
||||
from .planning import (
|
||||
DEFAULT_OUTPUT_PATTERN,
|
||||
OutputNamingOptions,
|
||||
@@ -1446,6 +1446,9 @@ def main() -> int:
|
||||
freeze_support()
|
||||
app = QApplication(sys.argv)
|
||||
app.setFont(QFont("Segoe UI", 10))
|
||||
icon_path = program_root() / "x.png"
|
||||
if icon_path.exists():
|
||||
app.setWindowIcon(QIcon(str(icon_path)))
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
return app.exec()
|
||||
|
||||
@@ -38,6 +38,9 @@ if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL%
|
||||
copy /Y "gcode_patches.ini" "%DIST%\gcode_patches.ini" >nul
|
||||
if errorlevel 1 exit /b %ERRORLEVEL%
|
||||
|
||||
copy /Y "x.png" "%DIST%\x.png" >nul
|
||||
if errorlevel 1 exit /b %ERRORLEVEL%
|
||||
|
||||
echo.
|
||||
echo Build done: %DIST%
|
||||
exit /b 0
|
||||
|
||||
Reference in New Issue
Block a user