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

Commit8dfd5a3

Browse files
authored
Merge pull request#151 from arthurferrai/feat/taskbar-foreground-class
Added extra class to taskbar foreground app
2 parentsba48b51 +f3ff04f commit8dfd5a3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _update_label(self, hwnd: int, win_info: dict, event: WinEvent) -> None:
150150
removed_hwnds= []
151151

152152
fortitle,hwnd,icon,processinvisible_windows:
153-
ifhwndnotinself.window_buttonsandiconisnotNone:
153+
ifhwndnotinself.window_buttons:
154154
self.window_buttons[hwnd]= (title,icon,hwnd,process)
155155
new_icons.append((title,icon,hwnd,process))
156156
elifhwndinexisting_hwnds:
@@ -164,8 +164,13 @@ def _update_label(self, hwnd: int, win_info: dict, event: WinEvent) -> None:
164164
# Remove icons for windows that are no longer visible
165165
foriinreversed(range(self._widget_container_layout.count())):
166166
widget=self._widget_container_layout.itemAt(i).widget()
167+
hwnd=widget.property("hwnd")
168+
169+
widget.setProperty("class",self._get_icon_class(hwnd))
170+
widget.style().unpolish(widget)
171+
widget.style().polish(widget)
172+
167173
ifwidget!=self.icon_label:
168-
hwnd=widget.property("hwnd")
169174
ifhwndinremoved_hwnds:
170175
ifself._animation['enabled']:
171176
self._animate_icon(widget,start_width=widget.width(),end_width=0)
@@ -176,7 +181,7 @@ def _update_label(self, hwnd: int, win_info: dict, event: WinEvent) -> None:
176181
# Add new icons
177182
fortitle,icon,hwnd,processinnew_icons:
178183
icon_label=QLabel()
179-
icon_label.setProperty("class","app-icon")
184+
icon_label.setProperty("class",self._get_icon_class(hwnd))
180185
ifself._animation['enabled']:
181186
icon_label.setFixedWidth(0)
182187
icon_label.setPixmap(icon)
@@ -189,6 +194,10 @@ def _update_label(self, hwnd: int, win_info: dict, event: WinEvent) -> None:
189194
ifself._animation['enabled']:
190195
self._animate_icon(icon_label,start_width=0,end_width=icon_label.sizeHint().width())
191196

197+
def_get_icon_class(self,hwnd:int)->str:
198+
ifhwnd==win32gui.GetForegroundWindow():
199+
return"app-icon foreground"
200+
return"app-icon"
192201

193202
def_get_app_icon(self,hwnd:int,title:str,process:dict,event:WinEvent)->QPixmap|None:
194203
try:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp