Skip to content

Fix and extend some shortcut actions for popups

Mathias Wein requested to merge (removed):popup-action-fixes into master

Since there have been users asking why the shortcuts to open the brush editor can't close it again when it's open, I looked into making that possible. And when setting up consistent behavior for the other "Brushes and Stuff" popups, I noticed a number of actions that were never connected to the popup in the first place, and thus not functional:

  • Gradients
  • Pattern
  • Workspace

The current solution is to just add the action to the popup widget too.

I'm not sure if that's really a good solution, as I couldn't really find clear information why shortcut events are not propagated from popup windows, if that's a hard rule or just some platform default, so we better test this on other platforms too (I only tested Plasma desktop on Ubuntu). And of course not everyone may agree that this behavior is desirable.

I was concerned that Qt may create context menus with that action, but I couldn't find any. And I was concerned it might cause ambiguous shortcut situations, but so far everything seems fine, brush editor can be toggled both in popup and detached mode here.

Test Plan

  • Assign a keyboard shortcut to popup actions that don't have a default one (Gradients, Patterns, Workspaces)
  • Make sure the shortcut to open a popup (F5, F6 and the ones mentioned above) work and will also close it again
  • Look out for undesirable side effects, like context menus being added or changed, any input conflicts etc.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports

Loading