This reverts commit ce4e031fc7.
This has been annoying when debugging the tools area, and also causes
many colour schemes that would look good with a tools area border to not
draw one. The cases where this commit improves on are far outweighed by
the ones where this commit causes a visual regression.
This reverts commit 0deecb4d57. This commit
caused many regressions in regards to how the tools area handles changing
toolbars at runtime, and doesn't even properly handle most cases where there
are no changes after application initialisation, as you cannot assume the widget
tree is fully complete at ::polish time.
Never mutate a widget while painting! This causes recursive repaints and makes
prorgams crash. There is a reason why const_casts are discouraged.
BUG:432246
FIXED-IN: 5.21
Otherwise this kconf_update binary writes Breeze colors to the users kdeglobals.
I created a new user, added its ~/.config/kdeglobals to auditd and saw that this binary wrote to it.
BUG: 431917
cac4b544db introduced drawing separators
of transparent QMenus with WindowText color with 0.25 opacity. While the change
in drawMenuItemControl uses the correct condition, drawPanelMenuPrimitive
checked whether the widget had an alpha channel. This is wrong because we set
Qt::WA_TranslucentBackground always on all menus. The very low opacity made it
look like the section headers, separators and highlight were drawing outside of
the menu.
BUG:428710
if a QQuickView is part of a QQuickWidget, we can't do window moving
from there because that window is not actually visible.
so ignore everything in this case.
the drag from anywhere will happen at the qwidget level automatically
if no qquickitem ever accepted the mouse
The author contacted me and requested that their pseudonym be changed
from "Metal Bender" to "ruvkr", which is their GitHub username.
The SVG source file for the wallpaper can be found at
https://github.com/ruvkr/milkyway
Removing hover animations makes controls feel more responsive due to taking less time to respond to the user.
Stripping out the hover code causes a lot of problems due to the code's architecture being highly dependent on the animation engines to keep track of stuff like subcontrol rects and whatnot, so simply hardcoding the values to 0 will suffice for now.
Despite the name, Complementary colors are used more like an always available set of dark color scheme colors. This means that in situations where you'd expect colors to always be dark, they become bright white with Breeze Dark because they were given Complementary colors rather than hardcoded dark colors. I don't think all these instances where the complementary color group is used like that will be fixed before Plasma 5.21 is released, so I'm making the Breeze Dark Complementary color set use normal Breeze Dark colors.
There is a special case for comboboxes when drawing a styled frame, but for
some reason it didn't actually check whether the QQuickItem is a combobox,
there was only a comment...
This adds the check, which means that QQuickItems get a proper frame now
instead of a combobox popup.
Currently the separators in headers are drawn at the right edge for each
section. That makes it visible on the rightmost edge of a header, directly
adjacent to the surrounding frame, surrounding in a 2px wide line.
(For RTL it's the reverse)
Avoid the double line by moving the separator to the adjacent "HeaderEmptyArea"
instead, which is only visible when necessary.
As a side effect, this commit fixes the check for whether a section is "last"
for invisible headers and RTL layouts.
Paint events MUST not change the state of things. This is especially
important within style code that is used in many apps that we do not
control.
Doing it in polish is better. It's still not ideal to adjust geometry in
the style, but at least this is where we have a similar hook for
QDockWidget so hopefully we know this pattern is acceptable.
BUG: 427311
This reverts commit 7e678c344b and the followup.
A B
+-----+ +-----+ C
| | |XXXXX| +---+
| XXX | |X X| |XXX|
| XCX | |X C X| |XCX|
| XXX | |X X| |XXX|
| | |XXXXX| +---+
+-----+ +-----+
Initially it was A, the referenced commit changed it to be B instead, which
created a 1px gap between frame and content, and the followup avoids that gap
by adjusting the frame width, resulting in C.
Although it's consistent, it leads to a worse apperance in places where the 1px
margin between frame and rect was expected.
7e678c34 removed the offsets from all sides, but that created a gap at the
right and bottom edges. This is because the frame is actually just 1px on
each side, but Frame_FrameWidth didn't match that.
kde4breeze changes the color scheme when it runs as part of kconf_update,
but at that time some applications (including kwin) might already be running.
Those need to be notified of the change.
BUG: 428771
The documentation for 'QPainter::drawRoundedRect' [1]
says:
"A filled rectangle has a size of rect.size(). A stroked
rectangle has a size of rect.size() plus the pen width."
Therefore, the frame rect passed to that method needs to
be adjusted according to the pen width for the case where
the rect is stroked (i.e. an outline exists), and no
adjustement is needed when the rect is not stroked so
that
[size of rect] + [outline width] = [wanted total size]
The default pen size is 1 (which is also the value
of 'PenWidth::Frame' used to calculate the radius for the
outline a few lines further down).
For the case that an outline exists, the adjustment of
the rect already happens in the call to 'Helper::strokedRect',
so there is no need for reducing the rect by one additional
pixel on each side, which resulted in the frame border
unnecessarily not being right at the inner edge of the
rect, but one additional pixel "further inside".
It looks like the additional adjustment was originally added
by commit 3dbcea7e59
("Changed frame width to 2, to cope with focus rect.",
2014-07-30), later adapted by commit
f288c34c3e
("Render 2px focused outline *inside* frames rather than outside",
2014-08-11) and commit 2985b4cb6b
("use one pixel for focus frame instead of 2", 2014-09-22).
While 'Metrics::Frame_FrameWidth' still has the value 2,
it is not used here at all, so the default pen width of 1
applies.
Therefore, drop the extra adjustment in order for the
stroke to be drawn right at the edge of the rect.
[1] https://doc.qt.io/qt-5/qpainter.html#drawRoundedRect
BUG: 428973