Skip to content

Fix resizing issues with pattern and gradient choosers

Mathias Wein requested to merge mwein/krita:bug-431825 into master

This should fix BUG:431825

Various resource choosers try to control the preferred size (used for popups like the gradient and pattern choosers in the "Brushes and Stuff" toolbar) by setting fixed size on a label to the current widget size.

This however causes resize issues when used in dockers, and initially the label may still unnecessarily elide text because its size was fixed before it was first shown and hence the preferred layout size was determined.

The proper solution seems to set their size policy to "Ignored" instead. The layout will then just shrink or grow them to fill the available space.

Test Plan

  • Verify that the size of "Fill Gradient" and "Fill Pattern" popups in the "Brushes and Stuff" is still what it's supposed to be.
  • Verify that the Pattern docker can now be sized down again after choosing another pattern
  • Verify that the Seexpr preset chooser in the fill layer options will shrink with the dialog properly after increasing size and selecting a new preset.
  • Verify that the label showing the name of selected resource always shows as much text as it can in all the above cases.

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