Question: accel attribute usage in ui files


Not too many applications contain <attribute name="accel"> entries.

I found many GTK 4 application work without these entries.

Is there any good to use these entries?

GTK Demos contain accel entries.

I don’t know for sure but it seems like this attribute exists just for convenience.

Unfortunately, in this approach, developers should declare the same shortcut three times and this prone to error.

  • In application
  • In menu
  • In help-overlay.

What? Really?

Obviously, ShortcutsWindow would need a separate description of each shortcut to display it properly but I thought creating shortcuts in either application code or menu UI was enough to use them and display them in the menu.

I only define shortcuts in the application code and there doesn’t seem to be any problem. They work as expected and show up as subtext in the hamburger menu. Although, I use only two shortcuts (Refresh, Quit) both of which are application level (global) shortcuts.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.