While being a prepatory step to KMessageWidget respecting the current color
scheme via KStyle this also simplifies this widget by a huge amount. This
includes removing the nested content Frame and the indirection via a QPixmap
for the animations.
Details
- Reviewers
ngraham cfeck - Group Reviewers
Frameworks - Commits
- R236:835c64d1b693: [KMessageWidget] Draw it with QPainter instead of using stylesheet
kmessagewidgettest works as before
Before:
After:
Diff Detail
- Repository
- R236 KWidgetsAddons
- Branch
- no-css (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 22501 Build 22519: arc lint + arc unit
The border radius is slightly different because I copied what Kirigami does for the inner rect but I can also go back to radius 4
Does that also work in Kate for floating messages like when the search wraps? What I want to know is whether the corners behind the green frame are transparent in this case, or whether the corners are painted solid. If I remember correctly, these kind of bugs were the reason to use Qt StyleSheets. And it must work with all styles.
Please do NOT yet commit, especially since we'd only have two days of testing period: Saturday, 1st of February is the next frameworks tag.
Should or shouldn't it be transparent? Also I don't understand which part should be transparent and which shouldn't? The border was never transparent and the background also not. Screenshots:
Of course:
Adwaita
Adwaita Dark
Fusion
MS Windows 9x
Oxygen
QtCurve
Sorry forgot the screenshots, but you're right the text shines through now in KTextEditor and it doesn't seem to positioned correctly. For the first one I could go back to mixing the color manually instead of just drawing it with an alpha of 0.2. I will look into the second issue
Kate with this patch and Oxygen style:
The misplacement I spotted earlier is specific to QtCurve and also happens with the current KMessageWidget.
Better :) with corners I mean the 1-3 pixels left due to the rounding corners. These pixels were once also drawn as background although they are outside of the frame. It may be a minor detail, but imho such details are important. But indeed, the screenshots look good.
Next test: open a file in kate. Now either change the file externally or delete it. Kate should show an animated KMessageWidget. Does it also correctly work with a small kate? I.e. small width of kate window?
src/kmessagewidget.cpp | ||
---|---|---|
328 | Can't you use parentWidget()? |
src/kmessagewidget.cpp | ||
---|---|---|
39 | Does it need to be static to avoid an external symbol? |
src/kmessagewidget.cpp | ||
---|---|---|
39 | I don't think so:
|
src/kmessagewidget.cpp | ||
---|---|---|
328 | I knew there was a function like that but couldn't remember its name. Thanks! |
It seems to work better than before, on the left the current one, on the right this patch:
Uh-oh, now it looks like this in Konsole:
Compare to the current appearance:
I recall wrestling with this issue in D12508. Might be worth looking over that.
That's because it wants to look transparent and mixes the background color with its color. One fix could be to also use the parent's text color (in this case white) or stop using QPalette::Window for data storage and mix with the window color of the widget's palette and use something else (maybe QPalette::Base). Opinions?
That would be fine, yes.
In the current code I took the approach of always using the system color scheme even if the local view overrode it, as Konsole does. Using the view's local color scheme isn't incorrect, just different. Arguably it's more correct. I say go for it if you think it makes sense.
Explicitly set TextColor and palettes of the labels and react to parent changes . For example necessary for konsole
that uses stylesheet which break palette propagation and reparents the widget after creation.