diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /widget/uikit/nsLookAndFeel.mm | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/uikit/nsLookAndFeel.mm')
-rw-r--r-- | widget/uikit/nsLookAndFeel.mm | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/widget/uikit/nsLookAndFeel.mm b/widget/uikit/nsLookAndFeel.mm index 29eb52a234..b420cc9a1d 100644 --- a/widget/uikit/nsLookAndFeel.mm +++ b/widget/uikit/nsLookAndFeel.mm @@ -13,6 +13,8 @@ #include "gfxFont.h" #include "gfxFontConstants.h" +using namespace mozilla; + nsLookAndFeel::nsLookAndFeel() : mInitialized(false) {} nsLookAndFeel::~nsLookAndFeel() {} @@ -41,7 +43,8 @@ void nsLookAndFeel::RefreshImpl() { mInitialized = false; } -nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) { +nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme, + nscolor& aResult) { EnsureInit(); nsresult res = NS_OK; @@ -55,7 +58,7 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) { break; case ColorID::Highlighttext: case ColorID::MozMenuhovertext: - aResult = mColorTextSelectForeground; + aResult = NS_SAME_AS_FOREGROUND_COLOR; break; case ColorID::IMESelectedRawTextBackground: case ColorID::IMESelectedConvertedTextBackground: @@ -154,11 +157,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) { aResult = NS_RGB(0xaa, 0xaa, 0xaa); break; case ColorID::Window: - case ColorID::MozField: + case ColorID::Field: case ColorID::MozCombobox: aResult = NS_RGB(0xff, 0xff, 0xff); break; - case ColorID::MozFieldtext: + case ColorID::Fieldtext: case ColorID::MozComboboxtext: aResult = mColorDarkText; break; @@ -175,12 +178,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) { case ColorID::MozMacFocusring: aResult = NS_RGB(0x3F, 0x98, 0xDD); break; - case ColorID::MozMacMenutextdisable: - aResult = NS_RGB(0x88, 0x88, 0x88); - break; - case ColorID::MozMacMenutextselect: - aResult = NS_RGB(0xaa, 0xaa, 0xaa); - break; case ColorID::MozMacDisabledtoolbartext: aResult = NS_RGB(0x3F, 0x3F, 0x3F); break; @@ -260,6 +257,19 @@ nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) { case IntID::ScrollArrowStyle: aResult = eScrollArrow_None; break; + case IntID::UseOverlayScrollbars: + case IntID::AllowOverlayScrollbarsOverlap: + aResult = 1; + break; + case IntID::ScrollbarDisplayOnMouseMove: + aResult = 0; + break; + case IntID::ScrollbarFadeBeginDelay: + aResult = 450; + break; + case IntID::ScrollbarFadeDuration: + aResult = 200; + break; case IntID::TreeOpenDelay: aResult = 1000; break; @@ -326,10 +336,10 @@ nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) { bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName, gfxFontStyle& aFontStyle) { // hack for now - if (aID == FontID::Window || aID == FontID::Document) { - aFontStyle.style = FontSlantStyle::Normal(); - aFontStyle.weight = FontWeight::Normal(); - aFontStyle.stretch = FontStretch::Normal(); + if (aID == FontID::Caption || aID == FontID::Menu) { + aFontStyle.style = FontSlantStyle::NORMAL; + aFontStyle.weight = FontWeight::NORMAL; + aFontStyle.stretch = FontStretch::NORMAL; aFontStyle.size = 14; aFontStyle.systemFont = true; @@ -347,14 +357,6 @@ void nsLookAndFeel::EnsureInit() { } mInitialized = true; - nscolor color; - GetColor(ColorID::TextSelectBackground, color); - if (color == 0x000000) { - mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff); - } else { - mColorTextSelectForeground = NS_SAME_AS_FOREGROUND_COLOR; - } - mColorDarkText = GetColorFromUIColor([UIColor darkTextColor]); RecordTelemetry(); |