Summary: | selection marker and filename disappear in certain styles | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Jonathan Marten <jjm> |
Component: | view-engine: general | Assignee: | Peter Penz <peter.penz19> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cfeck, cyberbeat |
Priority: | NOR | ||
Version: | 16.12.2 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.8.0 | |
Sentry Crash Report: | |||
Attachments: |
Screen shot - Oxygen style
Screen shot - Phase style Screen shot - Cleanlooks style Proposed patch |
Description
Jonathan Marten
2012-01-03 21:53:09 UTC
Created attachment 67414 [details]
Screen shot - Oxygen style
Created attachment 67415 [details]
Screen shot - Phase style
Created attachment 67416 [details]
Screen shot - Cleanlooks style
For the focus rectangle not being shown, it may be that Dolphin is abusing the Qt style system. KItemListWidget::paint() creates QStyleOptionViewItemV4 viewItemOption; and uses it in style()->drawPrimitive(QStyle::PE_FrameFocusRect, &viewItemOption, painter, widget); But in qcommonstyle and qwindowsstyle (which all of the problem styles inherit), there is code such as: case PE_FrameFocusRect: if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) { // draw the element } // otherwise do nothing The qstyleoption_cast will fail because the option is expected to be a QStyleOptionFocusRect, not a QStyleOptionViewItem. So nothing gets drawn. Oxygen does not check the type of the option passed to it and so works as intended. Created attachment 67485 [details]
Proposed patch
Right, the focus frame should use QStyleOptionFocusRect. The other bug is that dolphin does not set "icon" and "text" in the viewItemOption, so that the style does not render the backgrounds for those items. Attached patch fixes that.
*** Bug 290722 has been marked as a duplicate of this bug. *** Git commit 0a5a29a5e981446002f0f61b33dfd30c8c0a179a by Peter Penz. Committed on 05/01/2012 at 20:13. Pushed by ppenz into branch 'KDE/4.8'. Fix style-issues in items when not using Oxygen Thanks to Jonathan Marten and Christoph Feck for the analyses and the patch. Still open: The focus frame in cleanlooks is not drawn. M +8 -8 dolphin/src/kitemviews/kitemlistwidget.cpp http://commits.kde.org/kde-baseapps/0a5a29a5e981446002f0f61b33dfd30c8c0a179a Git commit af93bc46bcc63a48ae67db8f651283eb671a0d46 by Peter Penz. Committed on 05/01/2012 at 20:13. Pushed by ppenz into branch 'master'. Fix style-issues in items when not using Oxygen Thanks to Jonathan Marten and Christoph Feck for the analyses and the patch. Still open: The focus frame in cleanlooks is not drawn. M +8 -8 dolphin/src/kitemviews/kitemlistwidget.cpp http://commits.kde.org/kde-baseapps/af93bc46bcc63a48ae67db8f651283eb671a0d46 Thanks Jonathan and Christoph for your hints. It seems to work quite well now, except that in Cleanlooks no focus frame is visible. I tried a few things but did not succeed yet - probably you have a further hint what might be missing, but I currently will continue with fixing other issues for the 2.0 release (I think the current state of this issue is acceptable). Also I could not test the Phase style which I don't have installed. focusRectOption.state |= State_KeyboardFocusChange; The idea is that the focus frame should only be visible when the user is actually using the keyboard to change the focus, so when clicking on an item, there is no need to indicate where you are, because you "see where you clicked". I guess the behaviour of the GNOME platform is to supress the focus frame for this case, and Qt respects this behavior in the Cleanlooks style. So if you want to respect that behavior, too, you would only add that flag to the option.state, if the focus was changed by keyboard (for example, if you tabbed into the view), but I guess it simplest and sufficient to always set it. Ah, thanks Christoph :-) Will take care for this on the weekend. I'd say as long as the default KDE style does not care about the keyboard state I'll use the simple approach at is unrealistic that I've enough time to check possible issues that are related to the keyboard focus. Git commit 9362ba151ecfd849f15661df68a9a995809619bd by Peter Penz. Committed on 14/01/2012 at 11:29. Pushed by ppenz into branch 'KDE/4.8'. Fix current-item indicator in combination with the cleanlooks style Thanks to Christoph Feck for the hint. FIXED-IN: 4.8.0 M +1 -1 dolphin/src/kitemviews/kitemlistwidget.cpp http://commits.kde.org/kde-baseapps/9362ba151ecfd849f15661df68a9a995809619bd Git commit cc2f06882c9ddc587f792088a0e4503d1f17f10f by Peter Penz. Committed on 14/01/2012 at 11:29. Pushed by ppenz into branch 'master'. Fix current-item indicator in combination with the cleanlooks style Thanks to Christoph Feck for the hint. FIXED-IN: 4.8.0 M +1 -1 dolphin/src/kitemviews/kitemlistwidget.cpp http://commits.kde.org/kde-baseapps/cc2f06882c9ddc587f792088a0e4503d1f17f10f |