KoToolBox: add orientation and compact mode to context menu
User-specified orientation
When the toolbox is docked next to other dock widgets, it can choose the wrong orientation for the space it's been given. I've tried addressing this with context menu items that allow for manually setting the orientation.
Possible values are Automatic, Vertical, and Horizontal.
Automatic changes the orientation based on the width-to-height ratio. This was already the case when the toolbox was floating. Now it's also the case when docked.
Vertical and Horizontal force the toolbox to use the respective orientation regardless of whether it's floating or docked.
Compact mode
Turns the toolbox sections into one big section, allowing for more buttons to fit in a smaller area.
Test Plan
- Open an image or create a new image in krita.
- Show the toolbox docker widget if it's not already visible (Settings -> Dockers -> Toolbox).
- Right-click on the toolbox and you should see the
Compactcheckbox at the top, and theOrientationradio buttons at the bottom. - Check for the following:
- Changes to orientation and compact mode update immediately when selected.
- All toolbox buttons can be selected when in compact mode.
- Switching between Left-to-Right and Right-to-Left layout directions do not break compact mode's appearance.
- Orientation, when set to
Automatic, switches to horizontal when toolbox width is greater than its height, and vertical otherwise. - Orientation, when set to
HorizontalorVerticalnever changes orientation during location changes or resizing.
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.
- Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.