Skip to content

Fix Brush Editor sizing issues

This is three four commits. The first saves the brush editor's window geometry in the config. The third removes a function that doesn't appear to be used. The fourth fixes the initial, unconfigured sizes.

The second one reverts the brush editor's sidebar toggle behavior: When the brush editor was changed to use a QSplitter, it became that the presets and scratchpad sidebars shared the width of the window with the center editor widget. This led to showing/hiding them causing the center widget to be either cut off or stretched. This commit changes it back to the previous behavior of changing the width of the window instead, leaving the center untouched.

The window resizing when doing this is unfortunately a bit flickery visually, as before. I don't know whether that can be fixed. (Might be OS-dependent?) There is a difference from 5.1.x; before when toggling the presets, the window would stay in place and the widgets move over. Now the window moves and the widgets stay in place.

With these two three commits building on the ability to save the splitter sizes (MR!1878), the user has control over the sizes of the brush editor and they will be saved. This doesn't however fix the issue of the initial, unconfigured sizes being cut off. The default size will be wide enough that the widgets won't be cut off, but can be configured smaller to save space.

Test Plan

  1. Resize the Brush Editor window, restart Krita. It should be the same size.
  2. Open the Brush Editor, and toggle the Presets and Scratchpad sidebars. They should resize the editor window to make room, keeping the center widget the same size and position.
  3. Close the Scratchpad, change preset, reopen the Scratchpad, it should not have gotten smaller.
  4. Clear brushEditorSplitterSizes and brushEditorWindowGeometry from kritarc, open the Brush Editor. The widgets shouldn't be cut off.

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.

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.

Edited by Freya Lupen

Merge request reports