26 lines
830 B
Python
26 lines
830 B
Python
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)
|