From c7e111cd987068e8a57b22537d03049e26a7acc9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 1 Apr 2004 13:32:16 +0000 Subject: [PATCH] wxGTK became a little too eager in using the best size after my change in 1.453; only use it if width or height are not specified git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26548 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 8 ++++---- src/gtk1/window.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index be6e24913e..e5144820ee 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3009,13 +3009,13 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags } // calculate the best size if we should auto size the window - if ( (sizeFlags & wxSIZE_AUTO_WIDTH) || - (sizeFlags & wxSIZE_AUTO_HEIGHT) ) + if ( ((sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1) || + ((sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1) ) { const wxSize sizeBest = GetBestSize(); - if ( sizeFlags & wxSIZE_AUTO_WIDTH ) + if ( (sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1 ) width = sizeBest.x; - if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) + if ( (sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1 ) height = sizeBest.y; } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index be6e24913e..e5144820ee 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3009,13 +3009,13 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags } // calculate the best size if we should auto size the window - if ( (sizeFlags & wxSIZE_AUTO_WIDTH) || - (sizeFlags & wxSIZE_AUTO_HEIGHT) ) + if ( ((sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1) || + ((sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1) ) { const wxSize sizeBest = GetBestSize(); - if ( sizeFlags & wxSIZE_AUTO_WIDTH ) + if ( (sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1 ) width = sizeBest.x; - if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) + if ( (sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1 ) height = sizeBest.y; } -- 2.45.2