-
-
Notifications
You must be signed in to change notification settings - Fork 197
book: Use adw::ShortcutDialog
#2193
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
| <item> | ||
| <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute> | ||
| <attribute name="action">win.show-help-overlay</attribute> | ||
| <attribute name="action">app.shortcuts</attribute> |
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.
TODO: Mention that change in the book
| <interface> | ||
| <object class="GtkShortcutsWindow" id="help_overlay"> | ||
| <property name="modal">True</property> | ||
| <object class="AdwShortcutsDialog" id="shortcuts_dialog"> |
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.
TODO: Mention the changed id in the book
| <gresources> | ||
| <gresource prefix="/org/gtk_rs/Todo6/"> | ||
| <file compressed="true" preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">shortcuts.ui</file> | ||
| <file compressed="true" preprocess="xml-stripblanks" alias="shortcuts-dialog.ui">shortcuts.ui</file> |
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.
TODO: Mention that change in the book
| Now that we are using Libadwaita, we should also update our keyboard shortcuts window to use [`adw::ShortcutsDialog`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ShortcutsDialog.html). | ||
| This widget is the Libadwaita equivalent of [`gtk::ShortcutsWindow`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ShortcutsWindow.html) and provides better integration with the Adwaita style. | ||
|
|
||
| The main differences are: | ||
|
|
||
| - [`adw::ShortcutsDialog`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ShortcutsDialog.html) extends [`adw::Dialog`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.Dialog.html) rather than [`gtk::Window`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Window.html) | ||
| - It uses [`adw::ShortcutsSection`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ShortcutsSection.html) and [`adw::ShortcutsItem`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ShortcutsItem.html) instead of [`gtk::ShortcutsSection`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ShortcutsSection.html), [`gtk::ShortcutsGroup`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ShortcutsGroup.html), and [`gtk::ShortcutsShortcut`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ShortcutsShortcut.html) | ||
| - The structure is simpler, with sections directly containing items |
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.
Simplify this and add diff of changed parts
| ```xml | ||
| {{#rustdoc_include ../listings/todo/6/resources/shortcuts.ui}} | ||
| ``` | ||
|
|
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.
Add screenshot
Also update dependencies