| Summary: | Breeze on Plasma 6 doesn't render the QFrame::StyledPanel frame style | ||
|---|---|---|---|
| Product: | [Plasma] Breeze | Reporter: | Tobias Leupold <tl> |
| Component: | QStyle | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | carl, kde, kdelibs-bugs-null, nate, noahadvs, tl, uhhadd |
| Priority: | NOR | Keywords: | regression |
| Version First Reported In: | 6.0.5 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
CMakeLists_qt5.txt
CMakeLists_qt6.txt main.cpp MainWindow.cpp MainWindow.h plasma5_qt5_breeze.png plasma5_qt5_fusion.png plasma5_qt6_fusion.png plasma6_qt5_fusion.png plasma6_qt6_breeze.png plasma6_qt6_fusion.png |
||
|
Description
Tobias Leupold
2024-06-08 08:30:59 UTC
Created attachment 170251 [details]
CMakeLists_qt5.txt
Created attachment 170252 [details]
CMakeLists_qt6.txt
Created attachment 170253 [details]
main.cpp
Created attachment 170254 [details]
MainWindow.cpp
Created attachment 170255 [details]
MainWindow.h
Created attachment 170256 [details]
plasma5_qt5_breeze.png
Created attachment 170257 [details]
plasma5_qt5_fusion.png
Created attachment 170258 [details]
plasma5_qt6_fusion.png
Created attachment 170259 [details]
plasma6_qt5_fusion.png
Created attachment 170260 [details]
plasma6_qt6_breeze.png
Created attachment 170261 [details]
plasma6_qt6_fusion.png
I think this may have been an intentional change; see https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/251. Friedrich, can you comment on whether the exact effects described in this bugzilla ticket were intentional or not? That MR/change in KWidgetsAddons was about KTitleWidget no longer using a QLabel with that style, so unrelated. This is an implementation issue of the Breeze style (BTW Oxygen similarly does not render a frame for that), so moving over to Breeze. Is there something I can do to help here? I'm still seeing this with Breeze 6.2.4, and I'd really like to get StyledPanel frame styles for QLabels back ;-) After some investigation, I found that not only QLabel is affected, but also QFrame as a base class. QLabel inherits QFrame, and the paintEvent calls drawFrame(), which calls style()->drawControl(QStyle::CE_ShapedFrame, &opt, p, this). Looking at qcommonstyle.cpp, for QFrame::Box and QFrame::Panel, direct Qt functions seem to be called (qDrawPlainRect(), qDrawShadeRect() or qDrawShadePanel()), whereas for QFrame::StyledPanel, style()->drawPrimitive(QStyle::PE_Frame, ...) is invoked. QFrame::Box and QFrame::Panel frame shapes are visible, both if set for a plain QFrame as well as for a QLabel. Looking at breezestyle.cpp, in drawControl(), drawPrimitive() is called and from there drawFramePrimitive(). And here, I'm out of ideas, because drawFramePrimitive() is char by char identical with the KF5/Qt5 version, where the QFrame::StyledPanel shape (combined with the Raised or Sunken state) still was displayed correctly. I fear somebody with more insight of this would have to look into this :-( https://bugs.kde.org/show_bug.cgi?id=499131 could maybe be another implication of this?! Looks like it was intentional https://invent.kde.org/plasma/breeze/-/commit/c3dde54df6ffdb149d1e4ae223bc409756622d18 Huh? But why!? If this was really, for some reason I don't get at the moment, intentional: Could someone explain why I shouldn't be able to draw a frame around a label anymore if I want to? And: Can I work around this somehow?! I just tested it. I couldn't revert c3dde54df6ffdb149d1e4ae223bc409756622d18 automatically via git revert, so I did manually create a patch to revert this very change. This brought back e.g. drawing frames around a QLabel if explicitely requested (via setFrameStyle(QFrame::StyledPanel | QFrame::Sunken)). Carl, would you be so nice to explain what's the intention of this? And why this was added this way This does break existing functionality … one can't request to draw a frame around anything that doesn't have one by default anymore – and I think we should be able to do this, no?! Btw patching this commit away also fixes the missing frame I wrote about in Bug #499131! Imho this behavior is definitely a bug. Why should a QListWidget being the only widget inside a layout get no frame drawn, but one with a label besides should get one?! I create a PR with the patch fixing this: https://invent.kde.org/plasma/breeze/-/merge_requests/520 Please review! This is really an annoying bug, as it visually breaks everything explicitly requestig a styled panel frame, and also some other widgets … |