on xenial help sign in
aboutToShow for parent menubar items
commitd25c17523dd4a0850eec27bd04802e9bbeb5048f authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 7 Mar 2017, 11:35 (10 years ago) parent444646a
3 files changed+9
qml/Panel/Panel.qml+1 qml/Panel/PanelMenu.qml+1 qml/Panel/PanelMenuPage.qml+7
qml/Panel/Panel.qml+1
@@ -292,6 +292,7 @@ Item {
292292 pageDelegate: PanelMenuPage {
293293 menuModel: __applicationMenus.model
294294 submenuIndex: modelIndex
295+ isCurrent: modelIndex == __applicationMenus.currentMenuIndexChanged
295296
296297 factory: ApplicationMenuItemFactory {
297298 rootModel: __applicationMenus.model
qml/Panel/PanelMenu.qml+1
@@ -46,6 +46,7 @@ Showable {
4646 readonly property bool fullyClosed: unitProgress == 0
4747 readonly property alias expanded: bar.expanded
4848 readonly property int barWidth: Math.min(bar.width, bar.implicitWidth)
49+ readonly property alias currentMenuIndexChanged: bar.currentItemIndex
4950
5051 signal showTapped()
5152
qml/Panel/PanelMenuPage.qml+7
@@ -27,6 +27,13 @@ PageStack {
2727 property var submenuIndex: undefined
2828 property QtObject menuModel: null
2929 property Component factory
30+ property bool isCurrent: false
31+
32+ onIsCurrentChanged: {
33+ if (isCurrent && menuModel && submenuIndex) {
34+ menuModel.aboutToShow(submenuIndex);
35+ }
36+ }
3037
3138 Connections {
3239 id: dynamicChanges