summaryrefslogtreecommitdiffstats
path: root/widget/windows/nsLookAndFeel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'widget/windows/nsLookAndFeel.cpp')
-rw-r--r--widget/windows/nsLookAndFeel.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/widget/windows/nsLookAndFeel.cpp b/widget/windows/nsLookAndFeel.cpp
index 6122000c9e..b6b6877857 100644
--- a/widget/windows/nsLookAndFeel.cpp
+++ b/widget/windows/nsLookAndFeel.cpp
@@ -36,6 +36,17 @@ static int32_t GetSystemParam(long flag, int32_t def) {
return ::SystemParametersInfo(flag, 0, &value, 0) ? value : def;
}
+static int32_t GetTooltipOffsetVertical() {
+ static constexpr DWORD kDefaultCursorSize = 32;
+ const DWORD cursorSize =
+ GetSystemParam(MOZ_SPI_CURSORSIZE, kDefaultCursorSize);
+ if (cursorSize == kDefaultCursorSize) {
+ return LookAndFeel::kDefaultTooltipOffset;
+ }
+ return std::ceilf(float(LookAndFeel::kDefaultTooltipOffset) *
+ float(cursorSize) / float(kDefaultCursorSize));
+}
+
static bool SystemWantsDarkTheme() {
if (nsUXThemeData::IsHighContrastOn()) {
return LookAndFeel::IsDarkColor(
@@ -353,6 +364,7 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme,
case ColorID::Marktext:
case ColorID::Mark:
case ColorID::SpellCheckerUnderline:
+ case ColorID::MozAutofillBackground:
aColor = GetStandinForNativeColor(aID, aScheme);
return NS_OK;
default:
@@ -392,13 +404,9 @@ nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
aResult = std::ceil(float(timeout) / (2.0f * float(blinkTime)));
break;
}
-
case IntID::CaretWidth:
aResult = 1;
break;
- case IntID::ShowCaretDuringSelection:
- aResult = 0;
- break;
case IntID::SelectTextfieldsOnKeyFocus:
// Select textfield content when focused by kbd
// used by EventStateManager::sTextfieldSelectModel
@@ -523,6 +531,9 @@ nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
case IntID::ContextMenuOffsetHorizontal:
aResult = 2;
break;
+ case IntID::TooltipOffsetVertical:
+ aResult = GetTooltipOffsetVertical();
+ break;
case IntID::SystemUsesDarkTheme:
aResult = SystemWantsDarkTheme();
break;