diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 80b418a4b385..0e50361a290c 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -10715,13 +10715,17 @@ mirror: always # The size in CSS pixels at full zoom of the minimum scrollbar width. -- name: widget.non-native-theme.gtk.scrollbar.normal-size +- name: widget.non-native-theme.scrollbar.normal-size type: uint32_t +#if defined(MOZ_WIDGET_GTK) value: 12 +#else + value: 17 +#endif mirror: always # The size in CSS pixels at full zoom of the "thin" scrollbars. -- name: widget.non-native-theme.gtk.scrollbar.thin-size +- name: widget.non-native-theme.scrollbar.thin-size type: uint32_t value: 6 mirror: always diff --git a/widget/gtk/nsNativeBasicThemeGTK.cpp b/widget/gtk/nsNativeBasicThemeGTK.cpp index 5ef6e69ff0ee..d851c16f149c 100644 --- a/widget/gtk/nsNativeBasicThemeGTK.cpp +++ b/widget/gtk/nsNativeBasicThemeGTK.cpp @@ -41,18 +41,6 @@ bool nsNativeBasicThemeGTK::ThemeSupportsScrollbarButtons() { return StaticPrefs::widget_non_native_theme_gtk_scrollbar_allow_buttons(); } -auto nsNativeBasicThemeGTK::GetScrollbarSizes(nsPresContext* aPresContext, - StyleScrollbarWidth aWidth, - Overlay) -> ScrollbarSizes { - DPIRatio dpiRatio = GetDPIRatioForScrollbarPart(aPresContext); - CSSCoord size = - aWidth == StyleScrollbarWidth::Thin - ? StaticPrefs::widget_non_native_theme_gtk_scrollbar_thin_size() - : StaticPrefs::widget_non_native_theme_gtk_scrollbar_normal_size(); - LayoutDeviceIntCoord s = (size * dpiRatio).Truncated(); - return {s, s}; -} - NS_IMETHODIMP nsNativeBasicThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame, diff --git a/widget/gtk/nsNativeBasicThemeGTK.h b/widget/gtk/nsNativeBasicThemeGTK.h index c5807b4fea22..c102ac311307 100644 --- a/widget/gtk/nsNativeBasicThemeGTK.h +++ b/widget/gtk/nsNativeBasicThemeGTK.h @@ -40,8 +40,6 @@ class nsNativeBasicThemeGTK : public nsNativeBasicTheme { DPIRatio); bool ThemeSupportsScrollbarButtons() override; - ScrollbarSizes GetScrollbarSizes(nsPresContext*, StyleScrollbarWidth, - Overlay) override; protected: virtual ~nsNativeBasicThemeGTK() = default; diff --git a/widget/nsNativeBasicTheme.cpp b/widget/nsNativeBasicTheme.cpp index 374103666a39..791b8d6cf72c 100644 --- a/widget/nsNativeBasicTheme.cpp +++ b/widget/nsNativeBasicTheme.cpp @@ -1518,7 +1518,7 @@ void nsNativeBasicTheme::PaintScrollbarButton( float arrowPolygonX[] = {-4.0f, 0.0f, 4.0f, 4.0f, 0.0f, -4.0f}; float arrowPolygonY[] = {0.0f, -4.0f, 0.0f, 3.0f, -1.0f, 3.0f}; - const float kPolygonSize = kMinimumScrollbarSize; + const float kPolygonSize = 17; const int32_t arrowNumPoints = ArrayLength(arrowPolygonX); switch (aAppearance) { @@ -1934,9 +1934,10 @@ bool nsNativeBasicTheme::GetWidgetOverflow(nsDeviceContext* aContext, auto nsNativeBasicTheme::GetScrollbarSizes(nsPresContext* aPresContext, StyleScrollbarWidth aWidth, Overlay) -> ScrollbarSizes { - CSSCoord size = aWidth == StyleScrollbarWidth::Thin - ? kMinimumThinScrollbarSize - : kMinimumScrollbarSize; + CSSCoord size = + aWidth == StyleScrollbarWidth::Thin + ? StaticPrefs::widget_non_native_theme_scrollbar_thin_size() + : StaticPrefs::widget_non_native_theme_scrollbar_normal_size(); LayoutDeviceIntCoord s = (size * GetDPIRatioForScrollbarPart(aPresContext)).Rounded(); return {s, s}; diff --git a/widget/nsNativeBasicTheme.h b/widget/nsNativeBasicTheme.h index f3ad33e55f70..b779dcd3cb7e 100644 --- a/widget/nsNativeBasicTheme.h +++ b/widget/nsNativeBasicTheme.h @@ -66,8 +66,6 @@ static const gfx::sRGBColor sScrollbarBorderColor(gfx::sRGBColor(1.0f, 1.0f, static const gfx::sRGBColor sScrollbarThumbColor( gfx::sRGBColor::UnusualFromARGB(0xffcdcdcd)); -static const CSSCoord kMinimumScrollbarSize = 17.0f; -static const CSSCoord kMinimumThinScrollbarSize = 6.0f; static const CSSCoord kMinimumColorPickerHeight = 32.0f; static const CSSCoord kMinimumRangeThumbSize = 20.0f; static const CSSCoord kMinimumDropdownArrowButtonWidth = 18.0f;