Skip to content

Commit

Permalink
feat(taskbar): toggle window state between minimize and restore
Browse files Browse the repository at this point in the history
  • Loading branch information
amnweb committed Nov 30, 2024
1 parent 0009752 commit 6aea31f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/widgets/yasb/taskbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,14 @@ def bring_to_foreground(self, hwnd):
logging.warning(f"Invalid window handle: {hwnd}")
return

# Check if the window is minimized
if win32gui.IsIconic(hwnd):
# If the window is minimized, restore it
win32gui.ShowWindow(hwnd, win32con.SW_RESTORE)
else:
win32gui.ShowWindow(hwnd, win32con.SW_SHOW)
win32gui.SetForegroundWindow(hwnd)
win32gui.SetForegroundWindow(hwnd)
else:
# If the window is not minimized, minimize it
win32gui.ShowWindow(hwnd, win32con.SW_MINIMIZE)

def _animate_icon(self, icon_label, start_width=None, end_width=None,fps = 120, duration=240):
if start_width is None:
Expand Down

0 comments on commit 6aea31f

Please sign in to comment.