fix: systray hide

This commit is contained in:
Rubin Bhandari committed 2026-07-06 22:59:37 +05:45
1 parent 07216ceae9
commit 9e509a28ca
4 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -435,7 +435,7 @@ tooltip = true
[layout]
left_section = ["@group:0"]
middle_section = ["date_time", "weather", "ip_monitor"]
middle_section = ["date_time", "weather", "mpris"]
right_section = [ "@group:1","@group:2", "system_tray", "power"]
[[widget_groups]]
+1 -1
View File
@@ -435,7 +435,7 @@ tooltip = true
[layout]
left_section = ["@group:0"]
middle_section = ["date_time", "weather", "ip_monitor"]
middle_section = ["date_time", "weather", "mpris"]
right_section = [ "@group:1","@group:2", "system_tray", "power"]
[[widget_groups]]
-3
View File
@@ -486,9 +486,6 @@ scrolledwindow {
}
.panel-eventbox {
&:hover {
color: red;
}
.widget-container {
@include mixins.widget_style(variable.$bar-style-widget);
+6 -3
View File
@@ -187,7 +187,7 @@ class SystemTrayWidget(ButtonWidget, PopoverMixin, BaseSystemTray):
# Set children directly in Box to avoid double styling
self.container_box.add(self.tray_box)
if len(self.hidden_list) > 0:
if self.not_empty(self.hidden_list):
self.connect_after.add(self.chevron_icon)
self.create_menu()
# Connect click handler
@@ -246,13 +246,16 @@ class SystemTrayWidget(ButtonWidget, PopoverMixin, BaseSystemTray):
return
# Check if there are any visible items in the tray
has_visible_items = len(self.tray_box.get_children()) > 0
has_visible_items = self.not_empty(self.tray_box.get_children())
# Check if there are items in the popup menu
has_hidden_items = len(self.popup_menu.grid.get_children()) > 0
has_hidden_items = self.not_empty(self.popup_menu.grid.get_children())
# Widget is visible if there are any items (visible or hidden)
self.set_visible(has_visible_items or has_hidden_items)
def not_empty(self,item):
return len(item) > 0
def on_item_removed(self, _, item_identifier):
"""Handle when an item is removed from the system tray."""
item_button = self._items.get(item_identifier)