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
[GTK4 Prep] Replace menu items with menu model #1428
base: master
Are you sure you want to change the base?
Conversation
…e in the terminal
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.
Haven't tested this yet or looked into it too much, but just made a note about code style and detailed action names.
Since there's issues in Gtk3 with PopoverMenu, you can use Gtk.Menu with a model https://valadoc.org/gtk+-3.0/Gtk.Menu.Menu.from_model.html and then it's a pretty easy drop-in replacement during the GTK 4 port to change that
Since this is quite a huge branch I wonder if it might be better to do this in smaller steps, like just a branch to switch to using GLib.Actions I imagine is already a huge review in itself. It might help to get your work merged in faster if branches are more incremental
var open_in_terminal_pane_item = new GLib.MenuItem (_("Open in Terminal Pane"), | ||
MainWindow.ACTION_PREFIX | ||
+ MainWindow.ACTION_OPEN_IN_TERMINAL | ||
+ "::" | ||
+ file.path); | ||
|
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.
Code style for wrapping should be like:
var open_in_terminal_pane_item = new GLib.MenuItem (_("Open in Terminal Pane"), | |
MainWindow.ACTION_PREFIX | |
+ MainWindow.ACTION_OPEN_IN_TERMINAL | |
+ "::" | |
+ file.path); | |
var open_in_terminal_pane_item = new GLib.MenuItem ( | |
_("Open in Terminal Pane"), | |
MainWindow.ACTION_PREFIX | |
+ MainWindow.ACTION_OPEN_IN_TERMINAL | |
+ "::" | |
+ file.path | |
); |
There's actually a function for creating detailed action names as well: https://valadoc.org/gio-2.0/GLib.Action.print_detailed_name.html
I replaced as much as I possibly could.
The SourceView requires GTK4. We'd have access to
Gtk.TextView.extra_menu
.Also, the PopoverMenus used for the replaced Gtk.MenuItems currently don't show keyboard shortcuts. As far as I know, this should be fixed after moving over to GTK4.
Part of #1157.