]> git.saurik.com Git - wxWidgets.git/commitdiff
compute scrollbar spacing the same way GtkScrolledWindow does it
authorPaul Cornett <paulcor@bullseye.com>
Fri, 14 Dec 2012 06:29:54 +0000 (06:29 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Fri, 14 Dec 2012 06:29:54 +0000 (06:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 62b93d3a4ea7514221ded3bf1787f10564d58a90..66e9818fa380966e8eb69ecda7f389df42c8e0fc 100644 (file)
@@ -2837,8 +2837,16 @@ void wxWindowGTK::DoGetClientSize( int *width, int *height ) const
             gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(m_widget),
                                            &policy[ScrollDir_Horz],
                                            &policy[ScrollDir_Vert]);
-            int scrollbar_spacing;
-            gtk_widget_style_get(m_widget, "scrollbar-spacing", &scrollbar_spacing, NULL);
+
+            // get scrollbar spacing the same way the GTK-private function
+            // _gtk_scrolled_window_get_scrollbar_spacing() does it
+            int scrollbar_spacing =
+                GTK_SCROLLED_WINDOW_GET_CLASS(m_widget)->scrollbar_spacing;
+            if (scrollbar_spacing < 0)
+            {
+                gtk_widget_style_get(
+                    m_widget, "scrollbar-spacing", &scrollbar_spacing, NULL);
+            }
 
             for ( int i = 0; i < ScrollDir_Max; i++ )
             {