-
-
Notifications
You must be signed in to change notification settings - Fork 674
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
Add status icons #2768
Add status icons #2768
Conversation
Since this must be a programming error, rather than failing silently I think it would make sense to throw an exception so the developer is pointed directly at the cause. |
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
I've incorporated those doc updates, merged with main, replaced the TODO about standard commands with the actual standard command mechanism, and updated the tests and screenshots to reflect the standard menu items. I think that makes this ready for final review and merge. |
Adds an API allowing users to register status icons with an app.
status_icons
attribute to app. Status icons can be registered with the app, and can provided with an icon (falling back to the app's icon if no icon is provided), and a text label (falling back to the app name).StatusIcon
class, representing a "button-like" status icon. This has anon_press
handler.MenuStatusIcon
class, representing a "menu-like" status icon.MenuStatusIcon
can also act as a group, so groups can be created using the MenuStatusIcon as a parent.commands
CommandSet. Commands that you want to appear in status menus are registered with that CommandSet.COMMANDS
group will be added to the first MenuStatusIcon that is added tostatus_icons
. This allows for a safe default if you define commands without a specific status icon group.status_icons.commands
, and registered as part of theCOMMANDS
group, so they will be added to the first MenuStatusIcon for the app.status_icons
, and isn'tCOMMANDS
, will be ignored.There's one TODO in the implementation at present, waiting on the new "Standard command" API from #2666.
There is a stub implementation on Android, iOS, Web and Textual. This allows apps that define status icons to at least start, albeit with a warning.
The GTK implementation uses XApp, rather than AyatanaAppIndicator3 as discussed in the ticket. XApp uses almost the same API as Ayatana, but is being developed by Mint who (unlike Ubuntu) actually do believe in status icons, and as a result, the implementation actually works as you'd expect.
Fixes #97
PR Checklist: