From 7da4a9cfea46a1b13c4737b0b13551eeff77e268 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 23 Jan 2009 12:39:56 +0000 Subject: [PATCH] Remove scrollbar spacing from client size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 0b4bb5f..0a6eb5b 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2095,6 +2095,7 @@ bool wxWindowGTK::Create( wxWindow *parent, { // Get default border wxBorder border = GetBorder(style); + style &= ~wxBORDER_MASK; style |= border; @@ -2105,6 +2106,12 @@ bool wxWindowGTK::Create( wxWindow *parent, return false; } + // We should accept the native look +#if 0 + GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) ); + scroll_class->scrollbar_spacing = 0; +#endif + m_wxwindow = wxPizza::New(m_windowStyle); #ifndef __WXUNIVERSAL__ @@ -2122,12 +2129,6 @@ bool wxWindowGTK::Create( wxWindow *parent, GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget); - // We should accept the native look -#if 0 - GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) ); - scroll_class->scrollbar_spacing = 0; -#endif - // There is a conflict with default bindings at GTK+ // level between scrolled windows and notebooks both of which want to use // Ctrl-PageUp/Down: scrolled windows for scrolling in the horizontal @@ -2680,12 +2681,15 @@ void wxWindowGTK::DoGetClientSize( int *width, int *height ) const continue; } + GtkScrolledWindowClass *scroll_class = + GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) ); + GtkRequisition req; gtk_widget_size_request(GTK_WIDGET(range), &req); if (i == ScrollDir_Horz) - h -= req.height; + h -= req.height + scroll_class->scrollbar_spacing; else - w -= req.width; + w -= req.width + scroll_class->scrollbar_spacing; } } -- 2.7.4