✨ feat(ui): display active window title in menu bar and set default app name to Finder
This commit is contained in:
5 files changed
+77
-7
No files matched your search
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user