Commit 1e7b4248 authored by Michail Vourlakos's avatar Michail Vourlakos
Browse files

dont initialize app menu index in every hiding

Summary:
-- hiding a menu shouldnt initialize the currentIndex to -1
at all cases. When a secondary menu is already shown then
the currentIndex should be only the index of the new menu.
This improves also the qml bindings because currentIndex
doesnt change all the time with no reason.

Test Plan:
added debug messages in qml side to check the value of
currentIndex

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10695
parent e1fe26f1
......@@ -223,6 +223,8 @@ void AppMenuApplet::trigger(QQuickItem *ctx, int idx)
QMenu *oldMenu = m_currentMenu;
m_currentMenu = actionMenu;
if (oldMenu && oldMenu != actionMenu) {
//dont initialize the currentIndex when another menu is already shown
disconnect(oldMenu, &QMenu::aboutToHide, this, &AppMenuApplet::onMenuAboutToHide);
oldMenu->hide();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment