Bug 297028

Summary: Long caption in Thumbnail layout overlaps box for only one item
Product: [Plasma] kwin Reporter: David Martí <neikokz+kbugs>
Component: tabboxAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal Keywords: reproducible
Priority: NOR    
Version: 4.8.1   
Target Milestone: 4.8.3   
Platform: unspecified   
OS: Linux   
URL: https://git.reviewboard.kde.org/r/104507/
Latest Commit: Version Fixed In: 4.8.3
Attachments: Screenshot
Another screenshot

Description David Martí 2012-03-29 10:48:51 UTC
Created attachment 69989 [details]
Screenshot

Screenshot attached.
Comment 1 David Martí 2012-03-29 10:56:56 UTC
Way to reproduce: use the dialog when there's only a window open.
It's 100% reproduceable.

The problem is that the window title is bigger than the size of the tabbox and the thumbnail is not centered in the tabbox.
Comment 2 David Martí 2012-03-29 10:57:39 UTC
Created attachment 69990 [details]
Another screenshot
Comment 3 Martin Flöser 2012-04-01 15:17:24 UTC
I can reproduce on current master
Comment 4 Martin Flöser 2012-04-07 10:38:00 UTC
It is not possible to fix this bug properly as QML seems not to be meant to have text elements with changing sizes. The only possibility to fix I have seen so far is to create a new text element whenever the selection changes, get the implicitWidth and use it to update the item's width. That would of course impact the performance.

I'll try to at least clip properly for one item.
Comment 5 Martin Flöser 2012-04-07 11:29:13 UTC
I succeeded, please have a look at https://git.reviewboard.kde.org/r/104507/ (especially the screenshot) and if possible give it a try.
Comment 6 David Martí 2012-04-09 21:50:40 UTC
This solves half of the issue, the thumbnail and the text aren't centered yet inside the tabbox
Comment 7 Martin Flöser 2012-04-10 04:41:58 UTC
The text is perfectly centered. Not having the thumbnail centered is actually a different bug :-)
Comment 8 Martin Flöser 2012-04-10 17:28:37 UTC
Reported Bug #297856 for the new spotted issue
Comment 9 Martin Flöser 2012-04-16 15:42:51 UTC
Git commit 41b0647ad4ad052a3b6b049cb8ffdc526a6e03fd by Martin Gräßlin.
Committed on 09/04/2012 at 11:28.
Pushed by graesslin into branch 'master'.

Constrain width of text element in Thumbnail Layout

Fixes a layouting issue when caption does not fit into
the window switcher box.

REVIEW: 104507

M  +22   -0    kwin/tabbox/qml/clients/thumbnails/contents/ui/main.qml

http://commits.kde.org/kde-workspace/41b0647ad4ad052a3b6b049cb8ffdc526a6e03fd
Comment 10 Martin Flöser 2012-04-16 15:45:02 UTC
Git commit 8cdc6c341456f361a45bbc28cb85869004de3900 by Martin Gräßlin.
Committed on 09/04/2012 at 11:28.
Pushed by graesslin into branch 'KDE/4.8'.

Constrain width of text element in Thumbnail Layout

Fixes a layouting issue when caption does not fit into
the window switcher box.

Cherry-picked from 41b0647ad4ad052a3b6b049cb8ffdc526a6e03fd

REVIEW: 104507
FIXED-IN: 4.8.3

M  +22   -0    kwin/tabbox/qml/thumbnails.qml

http://commits.kde.org/kde-workspace/8cdc6c341456f361a45bbc28cb85869004de3900