on xenial help sign in
Use set*Index for menu & item indexes
5339fb6Nick Dedekind
Panel/Indicators.qml+2−6
@@ -179,12 +179,8 @@ Showable {
179
179
180 Connections {
180 Connections {
181 target: indicatorRow
181 target: indicatorRow
182− onCurrentItemIndexChanged: menuContent.updateCurrentMenu();
182+ onCurrentItemIndexChanged: {
183− }
184−
185− function updateCurrentMenu() {
186− if (currentMenuIndex != indicatorRow.currentItemIndex) {
187− currentMenuIndex = indicatorRow.currentItemIndex;
183+ menuContent.setCurrentMenuIndex(indicatorRow.currentItemIndex);
188 }
184 }
189 }
185 }
190
186
Panel/MenuContent.qml+6−2
@@ -24,7 +24,7 @@ Rectangle {
24
24
25 property QtObject indicatorsModel: null
25 property QtObject indicatorsModel: null
26 property bool __contentActive: false
26 property bool __contentActive: false
27− property alias currentMenuIndex : menus.currentIndex
27+ readonly property int currentMenuIndex : menus.currentIndex
28 property color backgroundColor: "#221e1c" // FIXME not in palette yet
28 property color backgroundColor: "#221e1c" // FIXME not in palette yet
29 property int contentReleaseInterval: 20000
29 property int contentReleaseInterval: 20000
30
30
@@ -32,7 +32,11 @@ Rectangle {
32 height: units.gu(42)
32 height: units.gu(42)
33 color: backgroundColor
33 color: backgroundColor
34
34
35− signal menuSelected(int index)
35+ function setCurrentMenuIndex(index) {
36+ if (currentMenuIndex !== index) {
37+ menus.currentIndex = index;
38+ }
39+ }
36
40
37 function activateContent() {
41 function activateContent() {
38 contentReleaseTimer.stop();
42 contentReleaseTimer.stop();
Panel/MenuContentTabs.qml+8−2
@@ -23,8 +23,8 @@ MainView {
23 id: content
23 id: content
24
24
25 property QtObject indicatorsModel: null
25 property QtObject indicatorsModel: null
26− property alias currentMenuIndex : tabs.selectedTabIndex
26+ readonly property int currentMenuIndex : tabs.selectedTabIndex
27− backgroundColor: "#221e1c"
27+ backgroundColor: "#221e1c" // FIXME not in palette yet
28 property int contentReleaseInterval: 20000
28 property int contentReleaseInterval: 20000
29
29
30 width: units.gu(40)
30 width: units.gu(40)
@@ -35,6 +35,12 @@ MainView {
35 property bool contentActive: false
35 property bool contentActive: false
36 }
36 }
37
37
38+ function setCurrentMenuIndex(index) {
39+ if (currentMenuIndex !== index) {
40+ tabs.selectedTabIndex = index;
41+ }
42+ }
43+
38 function activateContent() {
44 function activateContent() {
39 contentReleaseTimer.stop();
45 contentReleaseTimer.stop();
40 d.contentActive = true;
46 d.contentActive = true;