Additional fixes for KDE Plasma 6 support
This commit is contained in:
1 parent
efa05921fc
commit
723493a93e
7 files changed
+460
-22
No files matched your search
@@ -11,6 +11,8 @@ from .model import Snapshot, snapshot_from_dict, snapshot_to_dict
|
||||
DEFAULT_URL = "https://meteoinfo.ru/pogoda/russia/moscow-area/moscow"
|
||||
ANCHORS = ["top-left", "top-right", "bottom-left", "bottom-right"]
|
||||
LAYERS = ["bottom", "normal", "top"]
|
||||
TRAY_STYLES = ["stack", "pair", "wide"]
|
||||
WINDOW_TYPES = ["auto", "normal", "dock", "desktop"]
|
||||
|
||||
CONFIG_DIR = Path(os.environ.get("XDG_CONFIG_HOME") or Path.home() / ".config") / "ruweather"
|
||||
CACHE_DIR = Path(os.environ.get("XDG_CACHE_HOME") or Path.home() / ".cache") / "ruweather"
|
||||
@@ -31,6 +33,9 @@ class Config:
|
||||
click_through: bool = False # клики проходят «сквозь» окно
|
||||
forecast_rows: int = 4
|
||||
visible: bool = True
|
||||
window_type: str = "auto" # auto: в KDE — dock (не скрывается при «Показать рабочий стол»)
|
||||
tray_style: str = "stack" # stack — один значок, pair — два значка рядом, wide — один широкий
|
||||
tray_swap: bool = False # поменять местами два значка (порядок в трее задаёт сама панель)
|
||||
|
||||
@classmethod
|
||||
def load(cls) -> "Config":
|
||||
@@ -51,6 +56,10 @@ class Config:
|
||||
cfg.anchor = "bottom-right"
|
||||
if cfg.layer not in LAYERS:
|
||||
cfg.layer = "bottom"
|
||||
if cfg.window_type not in WINDOW_TYPES:
|
||||
cfg.window_type = "auto"
|
||||
if cfg.tray_style not in TRAY_STYLES:
|
||||
cfg.tray_style = "stack"
|
||||
return cfg
|
||||
|
||||
def save(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user