QMenu: Update menu action sizes if popup is (not)caused from menu bar
Menu width differs if it contains key shortcuts or not.
Amends 6634c424f8
Task-number: QTBUG-49435
Task-number: QTBUG-61181
Task-number: QTBUG-64449
Change-Id: I8c479af550128069ca91dd089dfc7bd8c24c66ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
parent
7416fc5e80
commit
c8a5f331c8
|
|
@ -2339,6 +2339,12 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
|
|||
d->updateLayoutDirection();
|
||||
d->adjustMenuScreen(p);
|
||||
|
||||
const bool contextMenu = d->isContextMenu();
|
||||
if (d->lastContextMenu != contextMenu) {
|
||||
d->itemsDirty = true;
|
||||
d->lastContextMenu = contextMenu;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(menubar)
|
||||
// if this menu is part of a chain attached to a QMenuBar, set the
|
||||
// _NET_WM_WINDOW_TYPE_DROPDOWN_MENU X11 window type
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ public:
|
|||
QMenuPrivate() :
|
||||
itemsDirty(false),
|
||||
hasCheckableItems(false),
|
||||
lastContextMenu(false),
|
||||
collapsibleSeparators(true),
|
||||
toolTipsVisible(false),
|
||||
delayedPopupGuard(false),
|
||||
|
|
@ -464,6 +465,7 @@ public:
|
|||
|
||||
mutable bool itemsDirty : 1;
|
||||
mutable bool hasCheckableItems : 1;
|
||||
bool lastContextMenu : 1;
|
||||
bool collapsibleSeparators : 1;
|
||||
bool toolTipsVisible : 1;
|
||||
bool delayedPopupGuard : 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue