From: Paul Cornett Date: Sun, 20 May 2007 02:35:15 +0000 (+0000) Subject: simplify client size calculation X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e36a8aff9a71a5478b029c9f5ced6a712ab6bd55 simplify client size calculation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 754e601fc5..c535e66b93 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -209,52 +209,40 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - wxTopLevelWindow::DoGetClientSize( width, height ); + wxFrameBase::DoGetClientSize(width, height); if (height) { #if wxUSE_MENUS_NATIVE // menu bar - if (m_frameMenuBar && !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOMENUBAR) != 0)) + if (m_frameMenuBar && + GTK_WIDGET_VISIBLE(m_frameMenuBar->m_widget) && !m_menuBarDetached) { - if (!m_menuBarDetached) - (*height) -= m_menuBarHeight; - else - (*height) -= wxPLACE_HOLDER; + *height -= m_menuBarHeight; } #endif // wxUSE_MENUS_NATIVE #if wxUSE_STATUSBAR // status bar - if (m_frameStatusBar && m_frameStatusBar->IsShown() && - !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOSTATUSBAR) != 0)) - (*height) -= wxSTATUS_HEIGHT; + if (m_frameStatusBar && GTK_WIDGET_VISIBLE(m_frameStatusBar->m_widget)) + *height -= wxSTATUS_HEIGHT; #endif // wxUSE_STATUSBAR } #if wxUSE_TOOLBAR // tool bar - if (m_frameToolBar && m_frameToolBar->IsShown()) + if (m_frameToolBar && + GTK_WIDGET_VISIBLE(m_frameToolBar->m_widget) && !m_toolBarDetached) { - if (m_toolBarDetached) + if (m_frameToolBar->IsVertical()) { - if (height != NULL) - *height -= wxPLACE_HOLDER; + if (width) + *width -= m_frameToolBar->GetSize().x; } else { - int x, y; - m_frameToolBar->GetSize( &x, &y ); - if ( m_frameToolBar->IsVertical() ) - { - if (width != NULL) - *width -= x; - } - else - { - if (height != NULL) - *height -= y; - } + if (height) + *height -= m_frameToolBar->GetSize().y; } } #endif // wxUSE_TOOLBAR