On touch devices, the default decoration button size is rather hard
to use. We have a thing to detect this however, KWin's Tablet Mode.
Using that, we can change button sizes based on this. Rather than
changing which size to use, change the base unit so we don't mess
around with config values.
This commit fixes the glitches in titlebar caption when it is updated near
the edge. These glitches were caused by the Titlebar_SideMargin being
multiplied by the incorrect largeSpacing factor when smallSpacing is used
in every other instance.
BUG: 418517
The geometry of the the title bar is not being correctly updated. The bug affects all C++-based window decorations (breeze, oxygen, even lightly) and can be observed when there isn't any title bar buttons to the left of the caption and the caption is changed (e.g. changing directories in dolphin), regardless of the alignment as long as the caption becomes close to the left edge. This makes sure that updateTitlebar sets the title bar's geometry in Decoration coordinates.
BUG: 418517
--m_iconSize for standalone buttons can be changed
dynamically based on user or container preferences.
Such an example could be the window buttons applet
that is resizing its buttons based on panel thickness
or when the applet is on the desktop and the user
resizes it. Previous implementation was failing
because even though m_iconSize was set as NULL for
StandAlone buttons, on the first painting m_iconSize
was set based on Button::geometry(). This of course
was failing because the Button::geometry() could change
afterwards and painting was not considering it to
calculate m_iconSize again.
QPainter's auto-scaling is prone to off-by-one rounding errors and draws on
fractional coordinates. With this change, we paint on a 1x DPR QPainter and
scale the shadow offset and strength manually based on DPR.
This resolves an issue with resulting in seams on the right and bottom
edges of a menu due to shadow boundaries being off-by-one.
BUG: 418166
v2: remove unrelated formatting changes
v3:
- move the DPR helper to ShadowHelper
- retrieve the DPR from the widget instead of the global QGuiApplication
- added BUG reference
This option is off by default and has been for several years, after it
was briefly turned on by default and proved to be unpopular with users,
generating many complaints and bug reports. The line uses a semantically
inappropriate highlight color which is far too visually bright, and it
doesn't look good with any of our header-color-using color schemes.
Arguably it never looked good with older color schemes where the titlebar
and window background use different colors either. Let's remove this
option.
BUG: 427422
FIXED-IN: 5.24
It doesn't make much sense to keep the raw pointer of a weak pointer
that could potentially disappear at any point.
This fixes warnings and just uses references like they're meant to be
used.