on xenial help sign in
reset current item on deletion
commit1955e185c2980130555a2120da7b56e7de82cd64 authorNick Dedekind <nick.dedekind@canonical.com> dateTue 21 Oct 2014, 09:30 (12 years ago) parent1ff2631
1 file changed+10
qml/Panel/Indicators/DefaultIndicatorPage.qml+10
qml/Panel/Indicators/DefaultIndicatorPage.qml+10
@@ -123,6 +123,16 @@ IndicatorBase {
123123 }
124124 }
125125
126+ Connections {
127+ target: mainMenu.model
128+ onRowsAboutToBeRemoved: {
129+ // track current item deletion.
130+ if (mainMenu.selectedIndex >= first && mainMenu.selectedIndex <= last) {
131+ mainMenu.selectedIndex = -1;
132+ }
133+ }
134+ }
135+
126136 delegate: Loader {
127137 id: loader
128138 objectName: "menuItem" + index