From 5a877535a868991099550ecf8937a6e3aafeae3e Mon Sep 17 00:00:00 2001 From: Naser Buhamad Date: Wed, 13 Jun 2018 23:53:58 +0200 Subject: [PATCH] Take menu bar into account for wxFrame client size in wxQt Subtract the height of the menu bar too, just as we already did for the status bar. --- src/qt/frame.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index 34572ba3df..fd23be2c56 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -178,6 +178,15 @@ void wxFrame::DoGetClientSize(int *width, int *height) const sb->GetSize(NULL, &sbh); *height -= sbh; } + + + // also for menubar , we must subtract it's height here + QMenuBar *qmb = GetQMainWindow()->menuBar(); + if (height && qmb) + { + QRect geometry = qmb->geometry(); + *height -= geometry.height(); + } } QMainWindow *wxFrame::GetQMainWindow() const