Skip to content

Commit

Permalink
Merge pull request #365 from pol-rivero/master
Browse files Browse the repository at this point in the history
Fix tray icon when IconThemePath exists but is empty
  • Loading branch information
nwg-piotr authored Dec 17, 2024
2 parents d767f54 + ad63ae9 commit b09cff5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nwg_panel/modules/sni_system_tray/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ def update_item(self, item: StatusNotifierItem, changed_properties: list[str]):
event_box = self.items[full_service_name]["event_box"]
image = self.items[full_service_name]["image"]

if "IconThemePath" in changed_properties or ("IconName" in changed_properties and len(item.properties['IconName']) > 0):
def prop_changed(prop):
return prop in changed_properties and len(item.properties[prop]) > 0

if prop_changed("IconThemePath") or prop_changed("IconName"):
update_icon(image, item, self.icon_size, self.icons_path)
elif "IconPixmap" in changed_properties and len(item.properties["IconPixmap"]) != 0:
elif prop_changed("IconPixmap"):
update_icon_from_pixmap(image, item, self.icon_size)
pass

if "Tooltip" in changed_properties or "ToolTip" in changed_properties:
update_tooltip(image, item)
Expand Down

0 comments on commit b09cff5

Please sign in to comment.