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 Pick-to: 6.8 Change-Id: I0e71156cacd6acc51ede353b3b4ddf09d9c0260f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
e5f9738385
commit
9a06060e9b
@ -24,6 +24,9 @@
|
||||
#if QT_CONFIG(datetimeedit)
|
||||
# include <QtWidgets/qdatetimeedit.h>
|
||||
#endif
|
||||
#if QT_CONFIG(tabwidget)
|
||||
# include <QtWidgets/qtabwidget.h>
|
||||
#endif
|
||||
#include "qdrawutil.h"
|
||||
#include <chrono>
|
||||
|
||||
@ -2030,6 +2033,9 @@ QSize QWindows11Style::sizeFromContents(ContentsType type, const QStyleOption *o
|
||||
constexpr int hPadding = 2 * 11;
|
||||
constexpr int itemHeight = 32;
|
||||
contentSize.setWidth(contentSize.width() + hMargin + hPadding);
|
||||
#if QT_CONFIG(tabwidget)
|
||||
if (widget->parent() && !qobject_cast<const QTabWidget *>(widget->parent()))
|
||||
#endif
|
||||
contentSize.setHeight(itemHeight);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user