enaml icon indicating copy to clipboard operation
enaml copied to clipboard

Text Eliding when changing styles in the DockArea

Open sccolbert opened this issue 11 years ago • 3 comments

When changing between styles on the DockArea the labels on the dock item title bars elide their text if the font size incurs a large increase. This is likely caused by QTextLabel caching it's size hint and not invalidating that cache on a style change. An appropriate fix would be to catch the QEvent::StyleChange and invalidate the cached hint.

sccolbert avatar Jul 05 '13 21:07 sccolbert

In addition to the style change, there also appears to be an issue with an off-by-one error in the computation for QFontMetrics::elidedText. If for example QFontMetrics::width(...) returns 40, then QFontMetrics.elidedText(...) requires a width of 41 to not elide the text. This is on OSX with a retina display. I have not seen the issue on a Windows box.

sccolbert avatar Jul 05 '13 21:07 sccolbert

A workaround was committed here: 5d7d0debe158065473bef4e476af3b5c49a0f57f

But, I'd still like to confirm whether the off-by-one issue is retina/OSX related, so i'm leaving the issue open for now.

sccolbert avatar Jul 05 '13 22:07 sccolbert

@gabrielcnr Could you confirm this is still an issue on OSX ?

MatthieuDartiailh avatar Mar 11 '18 18:03 MatthieuDartiailh