Bug 297028 - Long caption in Thumbnail layout overlaps box for only one item
Summary: Long caption in Thumbnail layout overlaps box for only one item
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: tabbox (show other bugs)
Version: 4.8.1
Platform: unspecified Linux
: NOR normal
Target Milestone: 4.8.3
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/104...
Keywords: reproducible
Depends on:
Blocks:
 
Reported: 2012-03-29 10:48 UTC by David Martí
Modified: 2012-04-16 15:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.8.3


Attachments
Screenshot (401.37 KB, image/png)
2012-03-29 10:48 UTC, David Martí
Details
Another screenshot (250.85 KB, image/png)
2012-03-29 10:57 UTC, David Martí
Details

Note You need to log in before you can comment on or make changes to this bug.
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