aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-06-15 00:16:57 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-21 12:14:31 +0000
commit1ffede10a0b2d2f0dc64fcce4f54263d9d30e57e (patch)
treeceb41443e1aab54322ba8afa90d3e85796c3276b /src/imports
parent39b4ac1e79415e8da2545a9a9002a9d674da77a1 (diff)
Add Menu::currentIndex
De-couple current index management from the content item. Instead of manipulating the content item's current index directly from C++, offer a currentIndex property that can be visualized by the style, also when not using a ListView. This is essentially the same technique ComboBox uses to control the highlighted index in the popup ListView. [ChangeLog][Controls][Menu] Added currentIndex property for styling purposes. Change-Id: Idf7746d9c08fc9ca9a0dfd15225ebae5a29243c9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/controls/Menu.qml3
-rw-r--r--src/imports/controls/fusion/Menu.qml3
-rw-r--r--src/imports/controls/material/Menu.qml3
-rw-r--r--src/imports/controls/universal/Menu.qml3
4 files changed, 4 insertions, 8 deletions
diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml
index 1fbf9a92..32cbfa3f 100644
--- a/src/imports/controls/Menu.qml
+++ b/src/imports/controls/Menu.qml
@@ -58,8 +58,7 @@ T.Menu {
// TODO: improve this?
interactive: ApplicationWindow.window ? contentHeight > ApplicationWindow.window.height : false
clip: true
- keyNavigationWraps: false
- currentIndex: -1
+ currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {}
}
diff --git a/src/imports/controls/fusion/Menu.qml b/src/imports/controls/fusion/Menu.qml
index d7fceb92..06886ad7 100644
--- a/src/imports/controls/fusion/Menu.qml
+++ b/src/imports/controls/fusion/Menu.qml
@@ -61,8 +61,7 @@ T.Menu {
// TODO: improve this?
interactive: ApplicationWindow.window ? contentHeight > ApplicationWindow.window.height : false
clip: true
- keyNavigationWraps: false
- currentIndex: -1
+ currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {}
}
diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml
index 1d0d368a..8410dfeb 100644
--- a/src/imports/controls/material/Menu.qml
+++ b/src/imports/controls/material/Menu.qml
@@ -77,8 +77,7 @@ T.Menu {
// TODO: improve this?
interactive: ApplicationWindow.window ? contentHeight > ApplicationWindow.window.height : false
clip: true
- keyNavigationWraps: false
- currentIndex: -1
+ currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {}
}
diff --git a/src/imports/controls/universal/Menu.qml b/src/imports/controls/universal/Menu.qml
index b2e71106..8ffefb1b 100644
--- a/src/imports/controls/universal/Menu.qml
+++ b/src/imports/controls/universal/Menu.qml
@@ -58,8 +58,7 @@ T.Menu {
// TODO: improve this?
interactive: ApplicationWindow.window ? contentHeight > ApplicationWindow.window.height : false
clip: true
- keyNavigationWraps: false
- currentIndex: -1
+ currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {}
}