Commit Graph

4 Commits

Author SHA1 Message Date
Anders Jonsson 091893ddf5 menus, plug-ins: more tab menu translatability 2023-07-17 10:27:30 +00:00
Jehan ea1205f094 Issue #9349: removing 2 duplicate "*-short" actions.
"edit-paste-as-new-image-short" and "vectors-selection-to-vectors-short" were
just duplicate of the action named the same, except for the "-short" suffix, and
the only point was to have different labels.

Not though that this time, it was not enough to conclude that the action in a
menu shoud have the short variant. These were both used differently depending on
the menu.
Instead I added the concept of "label-variant" attribute in .ui menu files. When
the "long" variant is set, then we simply use the longer label.

There is still one more "-short" action: "tools-by-color-select-short", but I am
a still unsure how to handle this one.
2023-04-14 18:54:16 +02:00
Jehan 9c7469fb22 app, menus: handle the case where a menu is used both as popup and submenu.
Several menus can be triggered either as popups on their own when right-clicking
the dockable or on items, or as a submenu in the docks main menu.
In the former case, we want the menu items to be at the root level, whereas in
the latter case, we want them inside a properly named submenu.

To handle this, I wrap these in a properly labelled <submenu> in the .ui files,
and I add a boolean flag to gimp_menu_shell_fill() which will drop the top
submenu if and only if this is the only top item. I use this flag only when
using these menus as popup menu on their own.

Also fixing a few memory leaks around these pieces of code.
2023-04-12 22:07:08 +02:00
Jehan dcd911ba60 menus: implement a bunch of menus in GtkBuilder format.
It's not all of them yet, just the ones which work out of the box with current
code and which I could easily trigger.
2023-04-12 22:07:08 +02:00