-
-
Notifications
You must be signed in to change notification settings - Fork 32
Launcher: new context option to close all windows #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
leolost2605
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, once again thank you!
I've added some comments how things could be made a bit cleaner.
In general I would move everything to the app class instead of having it in the launcher. Also instead of adding and removing the action and menuitem you can keep both around and set the action enabled depending on whether the app is running. Then you can add the attribute hidden-when with value action-disabled to your menuitem so that it will automatically be hidden when the action is disabled (see https://valadoc.org/gtk4/Gtk.PopoverMenu.html there's a list of supported attributes).
Co-authored-by: Leonhard <[email protected]>
Co-authored-by: Leonhard <[email protected]>
| LauncherManager.get_default ().sync_pinned (); | ||
| }); | ||
|
|
||
| var close_item = new GLib.MenuItem (_(CLOSE_WINDOWS_LABEL), ACTION_PREFIX + CLOSE_WINDOWS_ACTION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't add Close All Windows as a constant, it's untranslatable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, one can if it is marked as N_,
So it has to be:
private const string CLOSE_WINDOWS_LABEL = N_("Close All Windows");There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I don't see the benefit of a constant here
New context option to close all windows of an app on the dock:
elementary/gala#2196