Bug 352653

Summary: Dropdowns in widget properties don't follow system color settings. [regression]
Product: [Plasma] plasmashell Reporter: kdebuac.rhn
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED UPSTREAM    
Severity: minor CC: bhush94, hugo.pereira.da.costa, kde, olaf.the.lost.viking, plasma-bugs, stevekej, tiposchi
Priority: NOR    
Version: 5.3.2   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot of the faulty rendering
Screenshot of correct rendering (same system, same settings, different application)

Description kdebuac.rhn 2015-09-13 10:22:15 UTC
This is a regression compared to KDE4.

Dropdowns in seemingly every Plasma dialog only partially respect theme settings, resulting in unreadable text.

Reproducible: Always

Steps to Reproduce:
1. Change to a dark theme (e.g. Breeze Dark)
2. Open desktop settings
3. Click "Wallpaper type"

Actual Results:  
Extremely low contrast results in unreadable text.

Expected Results:  
Widget is styled consistently with the restof the system, or at least is readable.

Fedora 22
Comment 1 kdebuac.rhn 2015-09-13 10:22:41 UTC
Created attachment 94533 [details]
Screenshot of the faulty rendering
Comment 2 kdebuac.rhn 2015-09-13 10:23:25 UTC
Created attachment 94534 [details]
Screenshot of correct rendering (same system, same settings, different application)
Comment 3 Kai Uwe Broulik 2015-09-13 10:48:37 UTC
This is a bug in the QtQuick Controls ComboBox used by Plasma - I reported an upstream bug there: https://bugreports.qt.io/browse/QTBUG-48252
Comment 4 Kai Uwe Broulik 2015-12-20 11:13:52 UTC
Hugo, could you perhaps have a look at this? It affects Breeze and Oxygen as well as Windows 95 style but not the Qt Fusion style. QtQuick Controls ComboBox uses PE_PanelItemViewRow in its ComboBox popup, perhaps we don't style that thing properly?

Relevant code:
qApp->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, m_styleoption, &pixpainter);
if ((style() == "mac" || !qApp->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected)) && selected()) {
    pal = QApplication::palette("QAbstractItemView");
    pal.setCurrentColorGroup(m_styleoption->palette.currentColorGroup());
    pixpainter.fillRect(m_styleoption->rect, pal.highlight());
}
Comment 5 Hugo Pereira Da Costa 2015-12-20 12:06:05 UTC
(In reply to Kai Uwe Broulik from comment #4)
> Hugo, could you perhaps have a look at this? It affects Breeze and Oxygen as
> well as Windows 95 style but not the Qt Fusion style. QtQuick Controls
> ComboBox uses PE_PanelItemViewRow in its ComboBox popup, perhaps we don't
> style that thing properly?
> 
> Relevant code:
> qApp->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, m_styleoption,
> &pixpainter);
> if ((style() == "mac" ||
> !qApp->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected)) &&
> selected()) {
>     pal = QApplication::palette("QAbstractItemView");
>     pal.setCurrentColorGroup(m_styleoption->palette.currentColorGroup());
>     pixpainter.fillRect(m_styleoption->rect, pal.highlight());
> }

Hi Kai,
From what I can understand, the code above is relevant for the selected item only, whereas the bug is for unselected ones.
And in fact, comparing the correct and incorrect rendering, what seems to be the problem is the color used for the list "background". (possibly incorrect background role).

Anyway, yes, I can try investigate a bit more (but it is likely _not_ in the code mentionned above.
Comment 6 Hugo Pereira Da Costa 2015-12-20 15:58:42 UTC
Any other application than plasmashell (desktop settings) that I could use to reproduce the issue ? (such as a QtQuickControls demo, for instance ?)

Right now plasmashell crashes on my hybrid system (kde4/kf5) and I don't feel like recompiling everything to make it work ...

Thanks in advance,

Hugo
Comment 8 Hugo Pereira Da Costa 2015-12-21 14:36:14 UTC
Thanks Kay !
Comment 9 Hugo Pereira Da Costa 2015-12-21 14:46:37 UTC
In fact, for editable comboboxes, fusion also shows the issue. 
Only for read-only comboboxes it does not, and for such, fusion's rendering (also in the widget case) is quite non-standard. 
I guess i'll look into how they do it in the QFusionStyle and see if I can get the code from there. 
Still : this _is_ an upstream bug.
Comment 10 David Edmundson 2015-12-21 14:50:50 UTC
https://bugreports.qt.io/browse/QTBUG-48252 if you're interested.
Comment 11 Kai Uwe Broulik 2015-12-21 22:25:27 UTC
*** Bug 357019 has been marked as a duplicate of this bug. ***
Comment 12 Kai Uwe Broulik 2015-12-22 15:15:05 UTC
*** Bug 357049 has been marked as a duplicate of this bug. ***