[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Mon May 16 10:55:01 UTC 2016


 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |   28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

New commits:
commit 2f5bba2511ef5ef3ad92f8f9547e25128570c324
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 16 11:53:12 2016 +0100

    gtk3: min slider size too small since 3.20.0
    
    "GtkScrollbar:min-slider-length has been deprecated since version 3.20 and
    should not be used in newly-written code.
    
    Use min-height/min-width CSS properties on the slider element instead. The
    value of this style property is ignored."
    
    sigh....
    
    Change-Id: I0fe44b0a3dd31bd60c07f58ae5245496a7463fe2

diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index ef3e61c..b5fb915c 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2127,14 +2127,26 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
     gint min_slider_length = 21;
 
     // Grab some button style attributes
-    gtk_style_context_get_style( mpVScrollbarStyle,
-                                 "slider-width", &slider_width,
-                                 "trough-border", &trough_border,
-                                 "min-slider-length", &min_slider_length,
-                                 nullptr );
-    gint magic = trough_border ? 1 : 0;
-    aStyleSet.SetScrollBarSize( slider_width + 2*trough_border );
-    aStyleSet.SetMinThumbSize( min_slider_length - magic );
+    gtk_style_context_get_style(mpVScrollbarStyle,
+                                "slider-width", &slider_width,
+                                "trough-border", &trough_border,
+                                nullptr);
+    aStyleSet.SetScrollBarSize(slider_width + 2*trough_border);
+    if (gtk_check_version(3, 20, 0) == nullptr)
+    {
+        gtk_style_context_get(mpVScrollbarSliderStyle, gtk_style_context_get_state(mpVScrollbarSliderStyle),
+                              "min-height", &min_slider_length,
+                              nullptr);
+        aStyleSet.SetMinThumbSize(min_slider_length);
+    }
+    else
+    {
+        gtk_style_context_get_style(mpVScrollbarStyle,
+                                    "min-slider-length", &min_slider_length,
+                                    nullptr);
+        gint magic = trough_border ? 1 : 0;
+        aStyleSet.SetMinThumbSize(min_slider_length - magic);
+    }
 
     // preferred icon style
     gchar* pIconThemeName = nullptr;


More information about the Libreoffice-commits mailing list