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:
@@ -52,6 +52,9 @@ public:
|
|||||||
|
|
||||||
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
|
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoGetClientSize(int *width, int *height) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
wxDECLARE_DYNAMIC_CLASS( wxFrame );
|
wxDECLARE_DYNAMIC_CLASS( wxFrame );
|
||||||
|
@@ -171,6 +171,20 @@ QAbstractScrollArea *wxFrame::QtGetScrollBarsContainer() const
|
|||||||
return dynamic_cast <QAbstractScrollArea *> (GetHandle()->centralWidget() );
|
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 )
|
wxQtMainWindow::wxQtMainWindow( wxWindow *parent, wxFrame *handler )
|
||||||
|
Reference in New Issue
Block a user