Bug 348257 - QCommandLinkButton does not have correctly aligned text baseline to icon baseline
Summary: QCommandLinkButton does not have correctly aligned text baseline to icon base...
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: QStyle (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-26 17:34 UTC by Martin Klapetek
Modified: 2015-06-23 20:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (15.61 KB, image/png)
2015-05-26 17:34 UTC, Martin Klapetek
Details
Oxygen screenshot (17.46 KB, image/png)
2015-05-26 18:32 UTC, Martin Klapetek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Klapetek 2015-05-26 17:34:01 UTC
Created attachment 92832 [details]
Screenshot

See the attached screenshot, this is KAccounts from KDE Applications 15.04.
Comment 1 Hugo Pereira Da Costa 2015-05-26 17:36:44 UTC
Interesting :)
I was not even aware that this control existed ! 
Will investigate of course, and add to oxygen-demo

Thanks for reporting ! I'll keep you posted.
Comment 2 Hugo Pereira Da Costa 2015-05-26 18:23:02 UTC
Elaborating, 
it seems that the description is also not properly rendered (it overlap with the text).
This also applies to oxygen.
Do you confirm ?
Comment 3 Martin Klapetek 2015-05-26 18:32:09 UTC
Created attachment 92833 [details]
Oxygen screenshot

Yes I can confirm that with Breeze the description is rendered into text.

Oxygen renders both cases just fine, see this screenshot (oxygen without description).
Comment 4 Hugo Pereira Da Costa 2015-05-26 18:38:13 UTC
mmm. Can you double-check that you have the latest oxygen ? 

Here on breeze, it appears that the bug is a consequence of http://commits.kde.org/breeze/29f05099f5fb950935e65e6f626f2f162e83b383

Which in turn was committed to fix bug #346679

The thing is that Qt explicitly assumes, when rendering QCommandLinkButton internally, that when no vertical alignment is set, the style defaults to vertical Top (Qt::AlignTop), which is precisely what the commits breaks. 

Now, this really s..ks, because there is no way to fix both bugs consistently, inside breeze (nor latest oxygen, that has the same commit).

First off: can you confirm that if you revert the commit above, things look fine in breeze ? 
if yes, the easiest way to fix would actually be to patch Qt, so that it passes the correct alignment flags explicitly (rather than rely on some undocumented defaults, which break elsewhere).
Comment 5 Hugo Pereira Da Costa 2015-05-26 18:40:07 UTC
(side note: even with the commit reverted, the button is still not completely fixed, because there are some issues with margins ...)

(#begin of rant)To me this widget sounds half-backed, I'd say (#end of rant)
Comment 6 Martin Klapetek 2015-05-26 18:52:50 UTC
Ah you are correct, latest oxygen has indeed the very same issue; I was using about a month old revision.

Fwiw, if you think this widget is bad and fixing it would be just too much work, we can just switch away from it. It was suggested that KAccounts is the only user in all of KDE, so it might just be easier if we switch to something else :)
Comment 7 Hugo Pereira Da Costa 2015-06-23 20:08:04 UTC
Git commit 2a24ebce25bae976b06711ae6f023dfad6694745 by Hugo Pereira Da Costa.
Committed on 23/06/2015 at 20:07.
Pushed by hpereiradacosta into branch 'master'.

Fixed rendering of QCommandLinkButton

M  +92   -1    kstyle/breezestyle.cpp
M  +9    -0    kstyle/breezestyle.h

http://commits.kde.org/breeze/2a24ebce25bae976b06711ae6f023dfad6694745
Comment 8 Hugo Pereira Da Costa 2015-06-23 20:13:52 UTC
Git commit 800fff44e6291fdf72868033116c87a25b6966c0 by Hugo Pereira Da Costa.
Committed on 23/06/2015 at 20:13.
Pushed by hpereiradacosta into branch 'master'.

Fixed rendering of QCommandLinkButton

M  +97   -5    kstyle/oxygenstyle.cpp
M  +9    -0    kstyle/oxygenstyle.h

http://commits.kde.org/oxygen/800fff44e6291fdf72868033116c87a25b6966c0