Skip to content

feat(shortcuts): Port to libadwaita 1.8 - #453

Open
mufeedali wants to merge 3 commits into
mainfrom
adw-1.8
Open

feat(shortcuts): Port to libadwaita 1.8#453
mufeedali wants to merge 3 commits into
mainfrom
adw-1.8

Conversation

@mufeedali

Copy link
Copy Markdown
Member

If I'm being honest, I don't quite like that Adw.ShortcutsDialog and related classes are so inflexible... I could only "add" the Translate shortcut item. But that means it's always at the end of the list.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the keyboard shortcuts dialog from a custom Gtk.ShortcutsWindow implementation to libadwaita 1.8's Adw.ShortcutsDialog. The migration involves removing the custom Python class and UI blueprint files, and replacing them with a simpler blueprint definition that is loaded dynamically when needed.

Changes:

  • Replaced custom DialectShortcutsWindow with Adw.ShortcutsDialog loaded from resources
  • Moved shortcuts action from window-level to application-level (win.show-help-overlayapp.shortcuts)
  • Added dynamic insertion of the "Translate" shortcut when live translation is disabled

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
dialect/window.pyRemoved import and initialization of custom shortcuts window
dialect/window.blpChanged menu action from win.show-help-overlay to app.shortcuts; added formatting improvements
dialect/shortcuts.pyDeleted custom shortcuts window implementation
dialect/shortcuts.blpDeleted old blueprint definition for custom shortcuts window
dialect/shortcuts-dialog.blpAdded new blueprint definition using Adw.ShortcutsDialog and Adw.ShortcutsItem
dialect/main.pyAdded shortcuts action handler that loads dialog from resources and dynamically adds translate shortcut
dialect/meson.buildUpdated blueprint file reference from shortcuts.blp to shortcuts-dialog.blp
dialect/dialect.gresource.xmlUpdated resource reference and applied consistent formatting to file entries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threaddialect/main.py Outdated
Comment threaddialect/main.py Outdated
Comment threaddialect/shortcuts-dialog.blp Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threaddialect/main.py
Comment threaddialect/shortcuts-dialog.blp
Comment threaddialect/dialect.gresource.xml Outdated
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mufeedali