mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 16:22:00 +00:00
Bug 1685010 - Paint indeterminate checkboxes properly on Windows high contrast mode in the non-native theme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D100757
This commit is contained in:
parent
b8b0d529d8
commit
88f9c54b10
@ -15,18 +15,20 @@ std::pair<sRGBColor, sRGBColor> nsNativeBasicThemeWin::ComputeCheckboxColors(
|
||||
|
||||
bool isDisabled = aState.HasState(NS_EVENT_STATE_DISABLED);
|
||||
bool isChecked = aState.HasState(NS_EVENT_STATE_CHECKED);
|
||||
bool isIndeterminate = aAppearance == StyleAppearance::Checkbox &&
|
||||
aState.HasState(NS_EVENT_STATE_INDETERMINATE);
|
||||
|
||||
sRGBColor backgroundColor = sRGBColor::FromABGR(
|
||||
LookAndFeel::GetColor(LookAndFeel::ColorID::TextBackground));
|
||||
sRGBColor borderColor = sRGBColor::FromABGR(
|
||||
LookAndFeel::GetColor(LookAndFeel::ColorID::Buttontext));
|
||||
if (isDisabled && isChecked) {
|
||||
if (isDisabled && (isChecked || isIndeterminate)) {
|
||||
backgroundColor = borderColor = sRGBColor::FromABGR(
|
||||
LookAndFeel::GetColor(LookAndFeel::ColorID::Graytext));
|
||||
} else if (isDisabled) {
|
||||
borderColor = sRGBColor::FromABGR(
|
||||
LookAndFeel::GetColor(LookAndFeel::ColorID::Graytext));
|
||||
} else if (isChecked) {
|
||||
} else if (isChecked || isIndeterminate) {
|
||||
backgroundColor = borderColor = sRGBColor::FromABGR(
|
||||
LookAndFeel::GetColor(LookAndFeel::ColorID::Highlight));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user