https://bugs.kde.org/show_bug.cgi?id=409661

Lynx3d <lynx.mw+...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://invent.kde.org/kde/
                   |                            |krita/commit/93bdd1d6f56092
                   |                            |e2f229dc6202aa068f4526ddbc
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #7 from Lynx3d <lynx.mw+...@gmail.com> ---
Git commit 93bdd1d6f56092e2f229dc6202aa068f4526ddbc by Mathias Wein.
Committed on 01/05/2020 at 01:06.
Pushed by mwein into branch 'master'.

Fix Brush HUD width adjustment

This time hopefully for real.
There are two issues to bypass:

1) Layouts don't just instantly calculate new dimension as
   you modify them, it would be way too expensive, so Qt has
   a delayed pass for that in the event loop. So we need to
   wait until this has happened for the properties layout
   before resizing.
2) QScrollArea has a pretty broken sizeHint() implementation.
   It will just not give us a useful size that we could use.
   See also QTBUG-76256 and QTBUG-58447

The most sane solution I could come up with is to install the
HUD widget as event filter for the content widget of the scroll
area, and catch the LayoutRequest event. This event gets sent
by the layout to the parent widget to indicate its new dimension
are now available.
This is what Q(Abstract)ScrollArea does internally anyway, so
even fixing the sizeHint and waiting for the event to trigger
again on the outer layout just costs another loop iteration
and results in multiple screen updates.

Since we need to adjust the width a few levels up, we need to
calculate the margins our self, but the layout is not overly
complex luckily.

M  +17   -1    libs/ui/brushhud/kis_brush_hud.cpp
M  +1    -0    libs/ui/brushhud/kis_brush_hud.h

https://invent.kde.org/kde/krita/commit/93bdd1d6f56092e2f229dc6202aa068f4526ddbc

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to