From 09f176eed0dfb3e33c2e10aca3ff4547fcb41314 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 03:01:42 +0000 Subject: [PATCH] Fix frame client size in wxQT, thanks @seandepagnier Compute frame size subtracting statusbar, and handle NULL status bar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/qt/frame.h | 3 +++ src/qt/frame.cpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/wx/qt/frame.h b/include/wx/qt/frame.h index 15f2a3f162..aaf0541774 100644 --- a/include/wx/qt/frame.h +++ b/include/wx/qt/frame.h @@ -52,6 +52,9 @@ public: virtual QAbstractScrollArea *QtGetScrollBarsContainer() const; +protected: + virtual void DoGetClientSize(int *width, int *height) const; + private: wxDECLARE_DYNAMIC_CLASS( wxFrame ); diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index 3db48ae1d6..7817d7418c 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -171,6 +171,20 @@ QAbstractScrollArea *wxFrame::QtGetScrollBarsContainer() const return dynamic_cast (GetHandle()->centralWidget() ); } +void wxFrame::DoGetClientSize(int *width, int *height) const +{ + wxWindow::DoGetClientSize(width, height); + + // for a status bar, we must subtract it's height here + wxStatusBar *sb = GetStatusBar(); + if (height && sb) + { + int sbh = 0; + sb->GetSize(NULL, &sbh); + *height -= sbh; + } +} + //============================================================================= wxQtMainWindow::wxQtMainWindow( wxWindow *parent, wxFrame *handler )