Version: unspecified (using Devel) OS: Linux When using certain widget styles (but not changing any other settings), the marking of selected files is sometimes incorrect. With some of them the file name disappears when the focus is moved there (via the arrow keys) or when the file is selected (via Ctrl-LMB click), with others no selection marker (highlighted background) is shown. These are the results obtained with all of the styles included as standard in current trunk (with kdeartwork). File manager started with the command "konqueror --style STYLE ~" or "dolphin --style STYLE ~", the results are identical whether konqueror or dolphin is used. Files are selected by Ctrl-LMB clicking on them. Style Selection Focus Filename shown when highlight? frame? focussed or selected? CDE no no no Cleanlooks no no no (see screenshot 3) MS Windows 9x no no no Motif no no no Oxygen yes yes yes (see screenshot 1) Phase no yes no (see screenshot 2) Plastique no no no It appears that Oxygen is the only style that is correct. All other application GUI elements are correct as would be expected for the style. Reproducible: Always Steps to Reproduce: Run Konqueror or Dolphin as a file manager with the style selected. Actual Results: Display of focussed and/or selected files is incorrect as above. Expected Results: Focus frame, selection highlight and file name should be shown. Configured colours: black text on white background, selection colour green. Icon theme: Oxygen. "Show selection marker" is turned off. This problem has been present for at least a month in master branch (kdelibs 4.7 and recently 4.8), maybe longer.
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