fix(panel): wire search button to toggle spotlight

- Add on_clicked handler to search button in panel
- Add set_spotlight_toggle() method on Panel
- Connect spotlight.toggle in main.py after both are created
This commit is contained in:
sankalp committed 2026-07-12 20:16:23 +05:45
1 parent b5c92a9a77
commit 795e259e16
2 files changed
+10 -1

No files matched your search

+1
View File
@@ -58,6 +58,7 @@ def main():
panel = Panel()
modusnoti = ModusNoti()
spotlight = SpotlightWindow()
panel.set_spotlight_toggle(spotlight.toggle)
deskwidget = Deskwidgets()
dock = Dock()
osd = OSDWindow()
+9 -1
View File
@@ -75,8 +75,13 @@ class Panel(Window):
spacing=4,
)
self._spotlight_toggle_cb = None
self.search = Button(
name="panel-button", child=svg_file("misc/search.svg", size=22)
name="panel-button",
child=svg_file("misc/search.svg", size=22),
on_clicked=lambda *_: (
self._spotlight_toggle_cb() if self._spotlight_toggle_cb else None
),
)
setup_cursor_hover(self.search, "pointer")
@@ -174,6 +179,9 @@ class Panel(Window):
self._update_tray_visibility()
self.show()
def set_spotlight_toggle(self, callback):
self._spotlight_toggle_cb = callback
def on_dnd_changed(self, _, dnd_state):
self.update_notification_icon() # Update notification icon when DND changes