diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-15 00:16:57 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-21 12:14:31 +0000 |
commit | 1ffede10a0b2d2f0dc64fcce4f54263d9d30e57e (patch) | |
tree | ceb41443e1aab54322ba8afa90d3e85796c3276b /src/imports/controls/fusion/Menu.qml | |
parent | 39b4ac1e79415e8da2545a9a9002a9d674da77a1 (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/controls/fusion/Menu.qml')
-rw-r--r-- | src/imports/controls/fusion/Menu.qml | 3 |
1 files changed, 1 insertions, 2 deletions
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 {} } |