Set CombooBox QStyleOptionState == On rather than Sunken to match qwidgets
ClosedPublic

Authored by davidedmundson on Jan 16 2019, 12:22 AM.

Details

Summary

See the end of QComboBox::initStyleOption

if (d->container && d->container->isVisible())
    option->state |= QStyle::State_On;

The relevant breeze code reads:

const bool hasFocus( enabled && ( state & (State_HasFocus |

State_Sunken ) ) );

const bool sunken( state & (State_On|State_Sunken) );

So we still remain sunken in breeze, but we don't assume hasFocus, which
gives the background an incorrect colour.

BUG: 403153

Test Plan

Ran testComboBox from Aleix
Debug inside Breeze QStyle + reading Qt code

Diff Detail

Repository
R858 Qt Quick Controls 2: Desktop Style
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Plasma. · View Herald TranscriptJan 16 2019, 12:22 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Jan 16 2019, 12:22 AM

That doesn't fix the linked bug, however

When we click without explicit keyboard focus:

Currently we get black text on dark blue background.
After this patch we get black text on a light background.

Which I understood to be the main issue in that bug report.

broulik accepted this revision.Jan 16 2019, 12:24 PM

as far as I understood the issue is that in the popup the list elements are elided because they're too narrow. So, we have two separate bugs I presume :)

This revision is now accepted and ready to land.Jan 16 2019, 12:24 PM
This revision was automatically updated to reflect the committed changes.