QWindows11Style: Reduce menubar height in QTabWidget
Due to increased menubar height, an attached menubar to QTabWidgets was shown as >> indicator. This patch reduces the size of the menubar, in case it is attached to a QTabWidget. Fixes: QTBUG-130399 Change-Id: I0e71156cacd6acc51ede353b3b4ddf09d9c0260f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 9a06060e9ba0711ed458c19c274b7903f3d89d65) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1791b5461d
commit
d3f26e2bbd
@ -24,6 +24,9 @@
|
|||||||
#if QT_CONFIG(datetimeedit)
|
#if QT_CONFIG(datetimeedit)
|
||||||
# include <QtWidgets/qdatetimeedit.h>
|
# include <QtWidgets/qdatetimeedit.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if QT_CONFIG(tabwidget)
|
||||||
|
# include <QtWidgets/qtabwidget.h>
|
||||||
|
#endif
|
||||||
#include "qdrawutil.h"
|
#include "qdrawutil.h"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
@ -2000,7 +2003,10 @@ QSize QWindows11Style::sizeFromContents(ContentsType type, const QStyleOption *o
|
|||||||
constexpr int hPadding = 2 * 11;
|
constexpr int hPadding = 2 * 11;
|
||||||
constexpr int itemHeight = 32;
|
constexpr int itemHeight = 32;
|
||||||
contentSize.setWidth(contentSize.width() + hMargin + hPadding);
|
contentSize.setWidth(contentSize.width() + hMargin + hPadding);
|
||||||
contentSize.setHeight(itemHeight);
|
#if QT_CONFIG(tabwidget)
|
||||||
|
if (widget->parent() && !qobject_cast<const QTabWidget *>(widget->parent()))
|
||||||
|
#endif
|
||||||
|
contentSize.setHeight(itemHeight);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user