Respect system color scheme for rectangular selection

Authored by rkflx on May 2 2018, 10:28 AM.



As a follow-up to 4e2f90a30b66, in addition to using the system's color
for the text labels, we now also support user-chosen colors for the
label's background and border. The highlight color for the selection
handles and the magnifier is improved, too.

The Use light background setting is now strictly about the
background colour and won't affect the selection handles anymore.

Note: Due to the opacity, we have to use systemPalette.light instead
of systemPalette.window, otherwise for light schemes the contrast
would be too low.

Test Plan

For all color schemes, start spectacle -r and observe the help text in
the center and on the bottom. Look at the selection handles and press
to show the magnifier's crosshair. Everything should respect
the chosen color scheme and have enough contrast.

Diff Detail

R166 Spectacle
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
rkflx requested review of this revision.May 2 2018, 10:28 AM
rkflx created this revision.
broulik accepted this revision.May 2 2018, 10:36 AM
broulik added a subscriber: broulik.
broulik added inline comments.

Note that these are overwritten from C++ in QuickEditor.cpp in case light selection background option is enabled

This revision is now accepted and ready to land.May 2 2018, 10:36 AM
rkflx updated this revision to Diff 33482.EditedMay 2 2018, 11:10 AM
  • Make the light selection background setting strictly about the background.

Thanks for the review, I knew I missed something.

I decided to remove the colour change for this case completely, as I could not see any reason why changing the background colour should affect the highlight colour of the handles. Everything still has good contrast.

rkflx edited the summary of this revision. (Show Details)May 2 2018, 11:10 AM
ngraham accepted this revision.May 2 2018, 3:24 PM
ngraham added a subscriber: ngraham.

Yep, works great with all themes and with both darkened and lightened backgrounds.

This revision was automatically updated to reflect the committed changes.