Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d95e56

Browse files
authored
Merge pull request#156 from Video-Nomad/fix/systray-fixes
fix(systray): fixed the pin state restore on initial launch
2 parents08f1031 +c004185 commit3d95e56

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/core/widgets/yasb/systray.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ def __init__(
157157
init_timer=QTimer(self)
158158
init_timer.setSingleShot(True)
159159
init_timer.timeout.connect(self.setup_client)# pyright: ignore [reportUnknownMemberType]
160-
init_timer.start(3000)
160+
init_timer.start(5000)
161161

162162
defsetup_client(self):
163163
"""Setup the tray monitor client and connect signals"""
164+
self.load_state()
164165
client=SystrayWidget.get_client_instance()
165166
client.icon_modified.connect(self.on_icon_modified)# pyright: ignore [reportUnknownMemberType]
166167
client.icon_deleted.connect(self.on_icon_deleted)# pyright: ignore [reportUnknownMemberType]
@@ -176,8 +177,6 @@ def setup_client(self):
176177
defshowEvent(self,a0:QShowEvent|None)->None:
177178
"""Called when the widget is shown on the screen"""
178179
super().showEvent(a0)
179-
self.get_screen_id()
180-
self.load_state()
181180
self.unpinned_vis_btn.setChecked(self.show_unpinned)
182181
self.unpinned_vis_btn.setText(self.label_expandedifself.show_unpinnedelseself.label_collapsed)
183182
self.unpinned_widget.setVisible(self.show_unpinned)
@@ -401,7 +400,7 @@ def update_current_state(self):
401400
is_pinned=w.is_pinned,
402401
index=index,
403402
)
404-
self.current_state=widgets_state
403+
self.current_state|=widgets_state
405404

406405
defsave_state(self):
407406
"""Save the current icon position and pinned state to disk."""
@@ -410,6 +409,7 @@ def save_state(self):
410409
ifnotLOCALDATA_FOLDER.exists():
411410
LOCALDATA_FOLDER.mkdir(parents=True,exist_ok=True)
412411

412+
self.get_screen_id()
413413
file_path=LOCALDATA_FOLDER/Path(f"systray_state_{self.screen_id}.json")
414414
logger.debug(f"Saving state to{file_path}")
415415
saved_state:dict[str,Any]= {}
@@ -427,7 +427,7 @@ def save_state(self):
427427

428428
defload_state(self):
429429
"""Load the saved icon position and pinned state from disk."""
430-
logger.debug("Loading state from disk")
430+
self.get_screen_id()
431431
file_path=LOCALDATA_FOLDER/Path(f"systray_state_{self.screen_id}.json")
432432
logger.debug(f"Loading state from{file_path}")
433433
self.current_state= {}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp