diff options
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(); |