✨ feat(ui): display active window title in menu bar and set default app name to Finder

This commit is contained in:
sankalp committed 2025-08-13 00:40:13 +05:45
1 parent 88ce59eec7
commit 35c4f9c7ff
5 files changed
+77 -7

No files matched your search

+8
View File
@@ -252,6 +252,9 @@ class MenuBarDropdowns:
),
)
# Connect to active app name changes to update the title button
modus_service.connect("current-active-app-name-changed", self._on_active_app_changed)
self.global_menu_button_title = Button(
child=ActiveWindow(
formatter=FormattedString(
@@ -335,6 +338,11 @@ class MenuBarDropdowns:
# If we can't get window info, don't show dropdown
pass
def _on_active_app_changed(self, _, value):
"""Handle active app name changes"""
# Update the "About" menu item label
self.global_title_menu_about.set_property("label", f"About {value}")
def hide_dropdowns(self, *_):
self.menu_button.remove_style_class("active")
self.global_menu_button_edit.remove_style_class("active")