diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /widget/Theme.cpp | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/Theme.cpp')
-rw-r--r-- | widget/Theme.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/widget/Theme.cpp b/widget/Theme.cpp index 1fcd3d4bc3..15bf68ec01 100644 --- a/widget/Theme.cpp +++ b/widget/Theme.cpp @@ -296,6 +296,9 @@ std::pair<sRGBColor, sRGBColor> Theme::ComputeButtonColors( bool isHovered = aState.HasState(ElementState::HOVER); nscolor backgroundColor = [&] { + if (aState.HasState(ElementState::AUTOFILL)) { + return aColors.SystemNs(StyleSystemColor::MozAutofillBackground); + } if (isDisabled) { return aColors.SystemNs(StyleSystemColor::MozButtondisabledface); } @@ -308,12 +311,6 @@ std::pair<sRGBColor, sRGBColor> Theme::ComputeButtonColors( return aColors.SystemNs(StyleSystemColor::Buttonface); }(); - if (aState.HasState(ElementState::AUTOFILL)) { - backgroundColor = NS_ComposeColors( - backgroundColor, - aColors.SystemNs(StyleSystemColor::MozAutofillBackground)); - } - const sRGBColor borderColor = ComputeBorderColor(aState, aColors, OutlineCoversBorder::Yes); return std::make_pair(sRGBColor::FromABGR(backgroundColor), borderColor); @@ -323,18 +320,15 @@ std::pair<sRGBColor, sRGBColor> Theme::ComputeTextfieldColors( const ElementState& aState, const Colors& aColors, OutlineCoversBorder aOutlineCoversBorder) { nscolor backgroundColor = [&] { + if (aState.HasState(ElementState::AUTOFILL)) { + return aColors.SystemNs(StyleSystemColor::MozAutofillBackground); + } if (aState.HasState(ElementState::DISABLED)) { return aColors.SystemNs(StyleSystemColor::MozDisabledfield); } return aColors.SystemNs(StyleSystemColor::Field); }(); - if (aState.HasState(ElementState::AUTOFILL)) { - backgroundColor = NS_ComposeColors( - backgroundColor, - aColors.SystemNs(StyleSystemColor::MozAutofillBackground)); - } - const sRGBColor borderColor = ComputeBorderColor(aState, aColors, aOutlineCoversBorder); return std::make_pair(sRGBColor::FromABGR(backgroundColor), borderColor); |