Bug 346679

Summary: Incorrect vertical alignment of Columns labels (not centralized)
Product: [Plasma] Breeze Reporter: André Marcelo Alvarenga <alvarenga>
Component: QStyleAssignee: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Status: RESOLVED FIXED    
Severity: normal CC: hugo.pereira.da.costa, mklapetek, plasma-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot

Description André Marcelo Alvarenga 2015-04-26 01:33:37 UTC
See City, Region and Comment columns in Time Zone page.

Reproducible: Always
Comment 1 Martin Klapetek 2015-05-04 16:16:59 UTC
Created attachment 92413 [details]
Screenshot

Attaching a screenshot.

This seems to be a problem in the breeze style (not sure if the qstyle or the qqc style though).
Comment 2 Hugo Pereira Da Costa 2015-05-04 17:33:27 UTC
What application is that ?
Comment 3 Hugo Pereira Da Costa 2015-05-04 17:34:55 UTC
If its plasma shell, it has to be qqc, no ? 
Also, it does not happen with any widget based list (oxygen-demo, dolphin, etc.)
Comment 4 Hugo Pereira Da Costa 2015-05-04 17:43:24 UTC
I suspect something wrong with QStyle::subElementRect, for SE_HeaderLabel (and most likely SE_HeaderArrow).

Would help if I knew how to reproduce the issue.
Comment 5 André Marcelo Alvarenga 2015-05-06 01:22:05 UTC
(In reply to Hugo Pereira Da Costa from comment #2)
> What application is that ?

Digital clock widget.

Settings -> Time Zones page
Comment 6 Martin Klapetek 2015-05-06 09:23:52 UTC
I actually do get the same problem with kf5 Dolphin in the "Details view mode". It looks just like on the screenshot.
Comment 7 Hugo Pereira Da Costa 2015-05-06 09:36:33 UTC
@Martin,
Thanks for the info. I'll investigate.
Comment 8 Hugo Pereira Da Costa 2015-05-06 10:15:23 UTC
reassigning to qstyle, then.
Note however that not all headers do show the issue (ksysguard for instance is fine).
Must be related to using custom made widgets (as does dolphin).
Comment 9 Martin Klapetek 2015-05-06 10:39:18 UTC
Yeah, you're right, ksysguard is fine, open/save dialog is also fine, muon as well.

In the case of the digital-clock config (configTimeZones.qml), there is nothing special going on, it's simple 

QtControls.TableView {

            QtControls.TableViewColumn {
                role: "city"
                title: i18n("City")
            }

...

}

So I'm at a loss.
Comment 10 Hugo Pereira Da Costa 2015-05-06 10:58:20 UTC
ok. In fact, this might well just be a vertical alignment flag missing (with default being vcenter).
looking into it now.
Comment 11 Hugo Pereira Da Costa 2015-05-06 18:45:33 UTC
OK. At least in the dolphin case I have double checked that this is because the vertical alignment flag is not set in the option passed to the style for rendering the header label. In such case Qt fallsback to AlignTop, hence the issue.
This is most likely the same problem for QtQuickControl.
I'll push a workaround in breeze to default to VCenter when this happens.
Comment 12 Hugo Pereira Da Costa 2015-05-06 18:50:32 UTC
Git commit 0fd84447e5393891b620a53b82cf391f3e787032 by Hugo Pereira Da Costa.
Committed on 06/05/2015 at 18:48.
Pushed by hpereiradacosta into branch 'master'.

Default to Qt::AlignVCenter (instead of Qt::AlignTop) when vertical alignment flag is not set

M  +4    -0    kstyle/breezestyle.cpp

http://commits.kde.org/breeze/0fd84447e5393891b620a53b82cf391f3e787032
Comment 13 Hugo Pereira Da Costa 2015-05-06 18:52:35 UTC
Git commit 29f05099f5fb950935e65e6f626f2f162e83b383 by Hugo Pereira Da Costa.
Committed on 06/05/2015 at 18:52.
Pushed by hpereiradacosta into branch 'Plasma/5.3'.

Default to Qt::AlignVCenter (instead of Qt::AlignTop) when vertical alignment flag is not set

M  +4    -0    kstyle/breezestyle.cpp

http://commits.kde.org/breeze/29f05099f5fb950935e65e6f626f2f162e83b383
Comment 14 Martin Klapetek 2015-05-06 20:34:49 UTC
This also fixed the digital-clock settings page. Thanks Hugo!