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
This commit is contained in:
Mariano Reingart 2014-09-29 03:01:42 +00:00
parent f8ccdd0bcf
commit 09f176eed0
2 changed files with 17 additions and 0 deletions

View File

@ -52,6 +52,9 @@ public:
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
protected:
virtual void DoGetClientSize(int *width, int *height) const;
private:
wxDECLARE_DYNAMIC_CLASS( wxFrame );

View File

@ -171,6 +171,20 @@ QAbstractScrollArea *wxFrame::QtGetScrollBarsContainer() const
return dynamic_cast <QAbstractScrollArea *> (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 )