add config and change logo

This commit is contained in:
Julian Freeman
2025-10-18 23:09:05 -04:00
parent 516d9e4df3
commit 86badad057
9 changed files with 261 additions and 276 deletions

25
common/config.py Normal file
View File

@@ -0,0 +1,25 @@
from pathlib import Path
from qfluentwidgets import (
QConfig, qconfig, Theme, BoolValidator, ConfigItem,
SmoothMode, OptionsValidator, EnumSerializer, OptionsConfigItem,
)
from common.utils import get_app_dir
class Config(QConfig):
switch_animation = ConfigItem("Personalize", "SwitchAnimation", True,
BoolValidator(), restart=True)
smooth_mode = OptionsConfigItem("Personalize", "SmoothMode", SmoothMode.CONSTANT,
OptionsValidator(SmoothMode), EnumSerializer(SmoothMode), restart=True)
VERSION = "1.0.0"
ORG_NAME = "Oranje"
APP_NAME = "SafeMarksClient"
ZH_APP_NAME = "安全标记客户端"
APP_DIR = get_app_dir(ORG_NAME, APP_NAME)
cfg = Config()
cfg.themeMode.value = Theme.LIGHT
qconfig.load(str(Path(APP_DIR) / "config.json"), cfg)

View File

@@ -6,272 +6,124 @@
from PySide6 import QtCore from PySide6 import QtCore
qt_resource_data = b"\ qt_resource_data = b"\
\x00\x00\x10v\ \x00\x00\x074\
\x89\ \x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00\x80\x00\x00\x00\x80\x08\x03\x00\x00\x00\xf4\xe0\x91\xf9\ \x00\x00\x80\x00\x00\x00\x80\x08\x03\x00\x00\x00\xf4\xe0\x91\xf9\
\x00\x00\x03\x00PLTEGpL\x04\x06\x03\x00\x00\ \x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\
\x00\x00\x00\x00\x00\x00\x00z\xabh\x00\x00\x00\x1b=E\ \x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x02\
\x01\x02\x01\x10!%\x00\x03\x04\x00\x00\x00\x01\x02\x01\x00\ \xafPLTE\x00\x00\x00\x00\xd1j\x00\xd2i\x00\xd1\
\x00\x00\x03\x08\x07a\xaf\xc1\x04\x06\x03!\xaf\xe6\x02\x03\ j\x00\xd1j\x00\xd1i\x00\xd1i\x00\xd1i\x00\xd1i\
\x01\x00\x00\x00(O\x1a\x03\x04\x02\x00g\x8f\x00\x00\x00\ \x00\xd2j\x00\xd2i\x00\xd2j\x00\xd1i\x00\xd1j\x00\
\x05\x09\x04\x00\x00\x00\x00\x00\x00\x04\x08\x03\x02\x05\x02*\ \xd1j\x00\xd1i\x00\xd1j\x00\xd1i\x00\xd2i\x00\xd1\
U\x1b-\x5c\x1c\x05\x09\x03\x00Gb}\xda\xfa\x07@\ i\x00\xd2i\x00\xd2i\x00\xd2j\x00\xd1j\x00\xd1i\
W\x08\x12\x05\x11$\x0b'j\x82\x92\xd4n\x9f\xe5\xfb\ \x00\xd1i\x00\xd2i\x00\xd2j\x00\xd1j\x00\xd2i\x00\
\xa1\xe6\xfb%j\x82\x1b7\x11\x84\xdb\xf6.t\x8b\x00\ \xd2j\x00\xd2i\x00\xd1i\x00\xd1i\x00\xd2i\x00\xd2\
D^&n\x86E\xa6\x94T\xae\x96}\xd9\xf6k\xd0\ j\x00\xd1j\x00\xd1i\x00\xd1i\x00\xd1i\x00\xd0h\
\xf2#;\x1b\x0a\x9d\xcf\x15J;\x00D]#G\x16\ \x00\xd2j\x00\xd2i\x00\xd1j\x00\xd1i\x00\xd2i\x00\
#6\x1c2S&Jz8\x01FaV\xb2\x9c/\ \xd1i\x00\xd2i\x00\xd1i\x00\xd1i\x00\xd1j\x00\xd1\
z\x93'q\x8b,v\x90\x00Ie0{\x955\x82\ i\x00\xd1j\x00\xd2j\x00\xd2i\x00\xd1j\x00\xd1i\
\x9dY\x91D\x00E`H\xaa\x9bCk4d\xa3M\ \x00\xd2j\xf4\xf4\xf4\xf3\xf3\xf3\xec\xf2\xef\xef\xf3\xf1\xf1\
\x0aCK#\x86\x92z\xaeb7\x87\xa2.\xbf\xf5\x00\ \xf3\xf2\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x9d\x18J8\x12=7\x1dPF.bJp\ \xea\x8c\x0e\xfa\x9b\xd3\xea\x0e1\x9c\xf5\x8c\x8c\xea1\x9d\
\xc2y\x00\xff\x00z\x00\x04,;\xc9\x0b\x00\x00\x01\x00\ \x0f\xea\x9a\xf5Z&\x9bZ\x0e\x9d\x09\xfa\x9e\xfa\xfb\x0f\
tRNS\x00\x17\x11%\x09\x19\x0d\x01\x06\x03K,\ \x0e\xf5\xcc\xd3\xfb\xd3\xf6\x8b0\x97\xc0Q*\x00\x00\x03\
\x1c3!\x09U\x0e{9\xf9C\xfefq^>\x97\ \xdeIDATx\xda\xed\x9b\xf5S\x1bA\x14\xc7\x03\
\x88\xf9\xf9\xa5\xecq\xfd\xb9\xcc\xef\xfeiW\xdf\xe0D\ $\x84\xe0\xd2\x02-\xa5\xee\xee\xed^ \x81\xe0^\x0a\
\xf9\xec\xd1\xfb\xf61\x1f\xadd\xf6h\xee\x96\xc1\xdd\xaa\ \xd4\x80B\x81\xd2\x16\xda\xa25\xa4Pwwwww\
\xf7\xc4\xad\xb9\xf7\xf7\xfa\xec\x88\xfb\xcd\xf6\xf5\xfe\xfd\xfd\ www\xf9C\xcaP\x0a\xc9\xdb\xbb\x90\x99\xdc\xbd0\
n\xb9\xcft;\xef\xa4\x0f\xdf\xd0\xa2\x8f\x83u2\xab\ \xd3\xfd\xfexw\xb3\x9f\xcfD\xee\xde\xbe\xdb\x95\xc9X\
\xbb\xcb\xce\xdc\xfd\x14\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ XXX\xa8tT8\xbbXu'\x22Ge\xe5\xd2\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ \xa4CK\x13\xf0v\xb6\xbd\x88dq\xea\xda\xae\x1e|\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ \xe7f\x1eD\xd2tsS\x1a\xe3\xcb\xfb\x11\xc9\xd3G\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ .\xcc\xf7v%\x08\xf1l.\xc4w\xf4%(\xf1\x15\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ \xf8\x0c\x946\x04)6\xfc\xbf\x83f\x04-n\xbc\xff\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ ?\x07<\x81.v<\x02\x9d\x08bZ\xd0\xfc\x1eN\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ \x98\x02m\xbc(\x81\xb6\x045\x0aJ\xc0\x19W\xa0\x11\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ %\xd0\x1bW\xc0\x9e\x12\xb0\xc2\x15\xb0\xa6\x04T\xb8\x02\
\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ *J\x80 \x87\x090\x01&\xc0\x04\x98\xc0\xff\x22\xb0\
\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ 3\xff\xae\x9f\xdf\x89\xb4m\x96\x12\x18s\x9f\xab\xce\xf1\
\xff\xff\x09\x193o\xbfu\x00\x00\x0c%IDAT\ p\xcb\x08\x94\x14s5\x19\x1am\x09\x81k\xe7\xb9\xda\
x\xda\xec\x9aiT\x14W\x1a\x86U\x10hDQ\x14\ \x14X@`\xfc\x83:>w\x19_ {\xb2\x1e\x9f\
\x04\xb7$\xe8`\xc6IF'\x1a5\x893C\xc6h\ \x0bD\x17H\x1f\xa1\xcf\xe7t\xd8\x02\xa9\x09\x06|\xee\
\xd4$\x93\xcc\xbeo(6\xb2)\xa2\x12\x05\x89\xf4\xa8\ :\xb2@\xccHC>\x17\x82+0h\x14\xe0\xcf\x09\
\x11P\xd1\x91\x88#.\x19\x04Y\x04\xc1\xd6F\x81\x06\ @\x15\xc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\x8ao45\xdc\xb9}\
;\x1d\xa5\xb4\xf4(\x12\x10\xc6\x8fS\x0aXP\xc6\xb1\
\xda'\x02\xac\xfa\x81\x0f\x024\x9f\x13\x88\x86G\x97\xdb\
55\xe9\xf0\x22\xf8\x8a\x8a\xc6\xba\x10\x9a\xbfd\x89T\
\xc0b\x11\x04\x14\xed\xa3\x94\x8de\xd5\x9f\x96\x96\xb6x\
\x95\x9d\xc2\xe7\xe6>\x85G\xc4\x03\x95\x95\x955\x955\
(\xe95\x04\x7f\xf4hS]\x88X?\xf0\xa5\x02\x04\
o6\x8fc\x8f\xbf\xab\xacl,\xab\xfe\xb4\xc5\x8bA\
\x80\xe6\xe7\x96\x226\x0e\xe6\xf3\xf8\xc6\xa6,\x10\x10\xea\
\x07\xfe\xfc\xe1\x94\x00\xcf7\x8fc\x8f\x0fi\x97\xed>\
\x9e\xbf\x91\x17\xc8\xcd\xe5\x05\x98\xfc\xa6\xdc\xba8j\xfc\
\xf9\xf3\x95\x02fN@\xba\xf8v\x95\x01\x1f^\xed\xac\
\xfa\x81\xcf\x0bp\xfc\xe4\xf4J\xd1\x80\xf0\x01\xdf(\x08\
\xc4\x09\xfc\xd92\x01\xb3\x99\x08P\xedgs\xe3\x93\x06\
X\xf5\x03\x7f[\x94\x9d\xe6\xf3\x02\xfc\xf8\xa8\x00r\x05\
Z\xeb\x96H\xf82\x01\xc277?\xbdp\xf1\xfa\xb9\
\x07e\xd4\xf8\x18\x0f\x02\xac\xfa\x81\xbf-\xcdN\xe1\x93\
\x93K\x85\xea\x11\x1a\xd8\x00om\xc5\xcf\x82q!\x14\
^&@\xf0%%\xcdM\x8dG+J\xe1\xe7\xce\x85\
\x8b- \x22\xa6\x1d\xe3c\xa4\xf5o\xdb\xb6`\x01\x08\
P\xfc\xe4\x0a\x09;\x8b<\x02\xc3c\xa8l|\x99\x00\
\xcf/i\xce\xca\xe2\x14P\xd2\xd3o\x0b\x22\xed\xac\xfa\
\x81\x0f\x024?\xf9h\x85\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04\x10}\x10Z\xf2<\x1d\x86W\xe2\x0dN~_\xfe\
\x7f\xed\x9b1\x0e\x830\x0cEE\x14\xa5\x80P\x07\xa4\
\x0e\x9dz9\x8e\xc0!{,\xfe\xb7\xdd\x8a\xb4\x88\x81\
\xa4e\xf1\xbb\xc0{\xb1a\xf4:\xc2>\x8a;F\xf1\
\xc0B,`\x9am\xed\x9c<\xed:\xfb\x95>\x1e\xd7\
oG\xe8>0\x0a,\xe4\xa9\x7f\xbb\xad\xbd\xb7\xb7\xd3\
\x9e\xe9\x8b\xcf\x05^\x0dY\x04F1\x8eo\xf7\x8d\x0f\
\x87\x1br\xb1\x8b\xbeh\xfa\xfb\x11W\xad\xe8\xeds\x13\
/\xcdpCN{e\xfdV\x04*\xd4(\x0cBC\
\x82\xd8U_\xfdX\xc3\x1a\x18\x91R\xf8$\x091\xd2\
\xdev\x95\x9f\xff\x1d!\x1d9\xad\xa1\xe7\x1c\xbf=\x8c\
\xe9v\xf9\xdf\xa5\xcc\xe5\xd4\x1b\x1d\xc7q\x1c\xc7)c\
\x01\xf8\x0eHZ\xe9\xd3K\x9a\x00\x00\x00\x00IEN\
D\xaeB`\x82\
" "
qt_resource_name = b"\ qt_resource_name = b"\
@@ -285,7 +137,7 @@ qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x99\xf9l\xfe\x95\ \x00\x00\x01\x99\xfa]\xed\xe2\
" "
def qInitResources(): def qInitResources():

View File

@@ -1,3 +1,6 @@
import os
import sys
from pathlib import Path
from PySide6.QtWidgets import QWidget from PySide6.QtWidgets import QWidget
from qfluentwidgets import ( from qfluentwidgets import (
InfoBarIcon, MessageBox, InfoBarIcon, MessageBox,
@@ -44,3 +47,21 @@ def accept_warning(widget: QWidget, condition: bool,
if not mb.exec(): if not mb.exec():
return True return True
return False return False
def get_log_dir() -> str | None:
if sys.platform == "win32":
log_dir = Path(os.path.expanduser("~"), "AppData", "Roaming")
elif sys.platform == "darwin":
log_dir = Path(os.path.expanduser("~"), "Library", "Application Support")
else:
return None
if not log_dir.exists():
log_dir.mkdir(parents=True, exist_ok=True)
return str(log_dir)
def get_app_dir(org_name: str, app_name: str):
app_dir = Path(get_log_dir(), org_name, app_name)
app_dir.mkdir(parents=True, exist_ok=True)
return str(app_dir)

View File

@@ -3,10 +3,11 @@ from zoneinfo import ZoneInfo
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QAbstractItemView from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QAbstractItemView
from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, QSortFilterProxyModel from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, QSortFilterProxyModel
from qfluentwidgets import ( from qfluentwidgets import (
PushButton, TableView, FluentIcon as Fi, PillPushButton TableView, FluentIcon as Fi, PillPushButton, PrimaryPushButton
) )
from common.utils import SAFE_MAP_ICON, SAFE_MAP from common.utils import SAFE_MAP_ICON, SAFE_MAP
from common.config import cfg
# dict[str, str | int] 就是 # dict[str, str | int] 就是
# { # {
@@ -104,9 +105,9 @@ class MainInterface(QWidget):
self.setLayout(self.vly_m) self.setLayout(self.vly_m)
self.hly_top = QHBoxLayout() self.hly_top = QHBoxLayout()
self.pbn_refresh = PushButton(Fi.SYNC, "刷新", self) self.pbn_refresh = PrimaryPushButton(Fi.SYNC, "刷新", self)
self.pbn_add = PushButton(Fi.ADD, "添加", self) self.pbn_add = PrimaryPushButton(Fi.ADD, "添加", self)
self.pbn_delete = PushButton(Fi.DELETE, "删除", self) self.pbn_delete = PrimaryPushButton(Fi.DELETE, "删除", self)
safe_checks = [ safe_checks = [
("安全", 1), ("未知", 0), ("不安全", -1), ("未记录", -2), ("安全", 1), ("未知", 0), ("不安全", -1), ("未记录", -2),
@@ -146,6 +147,7 @@ class MainInterface(QWidget):
self.tbv_m.setColumnWidth(0, 250) self.tbv_m.setColumnWidth(0, 250)
self.tbv_m.setColumnWidth(1, 200) self.tbv_m.setColumnWidth(1, 200)
self.tbv_m.setColumnWidth(3, 180) self.tbv_m.setColumnWidth(3, 180)
self.tbv_m.scrollDelagate.verticalSmoothScroll.setSmoothMode(cfg.get(cfg.smooth_mode))
self.vly_m.addWidget(self.tbv_m) self.vly_m.addWidget(self.tbv_m)

View File

@@ -1,30 +1,39 @@
from PySide6.QtWidgets import QApplication from PySide6.QtWidgets import QApplication
from PySide6.QtCore import Qt, QThread, QModelIndex from PySide6.QtCore import Qt, QThread, QModelIndex
from PySide6.QtGui import QIcon from PySide6.QtGui import QIcon
from qfluentwidgets import MSFluentWindow, setTheme, Theme, InfoBar, FluentIcon as Fi, InfoBarPosition from qfluentwidgets import (
MSFluentWindow, setTheme, InfoBar, FluentIcon as Fi, InfoBarPosition,
NavigationItemPosition, setThemeColor
)
from common.utils import show_quick_tip, accept_warning from common.utils import show_quick_tip, accept_warning
from common.api_worker import ApiWorker from common.api_worker import ApiWorker
from components.ext_dialog import ExtensionDialog from components.ext_dialog import ExtensionDialog
from components.main_interface import MainInterface from components.main_interface import MainInterface
from components.settings_interface import SettingsInterface
from common.config import cfg
class MainWindow(MSFluentWindow): class MainWindow(MSFluentWindow):
def __init__(self): def __init__(self, title: str, width: int, height: int):
super().__init__() super().__init__()
self.setWindowTitle("插件安全标记") self.setWindowTitle(title)
self.setWindowIcon(QIcon(":/logo.png")) self.setWindowIcon(QIcon(":/logo.png"))
# self.navigationInterface.hide() self.resize(width, height)
self.resize(1000, 760)
desktop = QApplication.screens()[0].availableGeometry() desktop = QApplication.screens()[0].availableGeometry()
w, h = desktop.width(), desktop.height() w, h = desktop.width(), desktop.height()
self.move(w // 2 - self.width() // 2, h // 2 - self.height() // 2) self.move(w // 2 - self.width() // 2, h // 2 - self.height() // 2)
setTheme(Theme.LIGHT) setTheme(cfg.theme)
setThemeColor(cfg.get(cfg.themeColor))
# --- UI --- # --- UI ---
self.main_interface = MainInterface(parent=self) self.main_interface = MainInterface(parent=self)
self.settings_interface = SettingsInterface(name="settings", parent=self)
self.addSubInterface(self.main_interface, Fi.HOME, "主页", Fi.HOME_FILL) self.addSubInterface(self.main_interface, Fi.HOME, "主页", Fi.HOME_FILL)
self.addSubInterface(self.settings_interface, Fi.SETTING, "设置",
position=NavigationItemPosition.BOTTOM)
self.stackedWidget.setAnimationEnabled(cfg.get(cfg.switch_animation))
# --- 初始化后台工作线程和 QObject --- # --- 初始化后台工作线程和 QObject ---
self.thread = QThread() self.thread = QThread()

View File

@@ -0,0 +1,71 @@
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QWidget
from qfluentwidgets import (
ScrollArea, ExpandLayout, SettingCardGroup,
OptionsSettingCard, CustomColorSettingCard, setTheme, setThemeColor,
SwitchSettingCard, InfoBar, InfoBarPosition
)
from qfluentwidgets import FluentIcon as Fi
from common.config import cfg
class SettingsInterface(ScrollArea):
def __init__(self, name: str, parent=None):
super().__init__(parent)
self.setObjectName(name.replace(" ", "-"))
self.cw = QWidget(self)
self.ely = ExpandLayout(self.cw)
self.setWidget(self.cw)
self.setWidgetResizable(True)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
self.enableTransparentBackground()
self.personal_group = SettingCardGroup("个性化", self.cw)
self.theme_card = OptionsSettingCard(
cfg.themeMode,
Fi.BRUSH,
"应用主题",
"修改应用的外观",
texts=["浅色", "深色", "跟随系统"],
parent=self.personal_group,
)
self.theme_color_card = CustomColorSettingCard(
cfg.themeColor,
Fi.PALETTE,
"主题色",
"修改应用的主题颜色",
parent=self.personal_group,
)
self.switch_animation_card = SwitchSettingCard(
Fi.SCROLL,
"切换动画",
"切换不同页面时是否显示动画",
configItem=cfg.switch_animation,
parent=self.personal_group,
)
self.smooth_mode_card = OptionsSettingCard(
cfg.smooth_mode,
Fi.LEAF,
"滚动模式",
"修改视图滚动模式",
texts=["无滚动", "匀速滚动", "线性滚动", "二次缓动", "余弦平滑"],
parent=self.personal_group,
)
self.personal_group.addSettingCard(self.theme_card)
self.personal_group.addSettingCard(self.theme_color_card)
self.personal_group.addSettingCard(self.switch_animation_card)
self.personal_group.addSettingCard(self.smooth_mode_card)
self.ely.setSpacing(28)
self.ely.setContentsMargins(20, 20, 20, 20)
self.ely.addWidget(self.personal_group)
cfg.themeChanged.connect(setTheme)
cfg.appRestartSig.connect(self.show_restart_tip)
self.theme_color_card.colorChanged.connect(lambda c: setThemeColor(c))
def show_restart_tip(self):
InfoBar.warning("", "设置已更新,重启应用生效。", duration=5000,
position=InfoBarPosition.BOTTOM_RIGHT, parent=self.window())

BIN
logo.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View File

@@ -5,15 +5,20 @@ from PySide6.QtCore import QLocale
from qfluentwidgets import FluentTranslator from qfluentwidgets import FluentTranslator
from components.main_window import MainWindow from components.main_window import MainWindow
from common.config import VERSION, ZH_APP_NAME, ORG_NAME, APP_NAME
import common.resources import common.resources
# --- 运行 GUI --- # --- 运行 GUI ---
def main(): def main():
app = QApplication(sys.argv) app = QApplication(sys.argv)
app.setOrganizationName(ORG_NAME)
app.setApplicationName(APP_NAME)
translator = FluentTranslator(QLocale(QLocale.Language.Chinese, QLocale.Country.China)) translator = FluentTranslator(QLocale(QLocale.Language.Chinese, QLocale.Country.China))
app.installTranslator(translator) app.installTranslator(translator)
win = MainWindow()
win = MainWindow(title=f"插件安全标记 {VERSION}", width=1000, height=760)
win.show() win.show()
return app.exec() return app.exec()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB