diff options
-rw-r--r-- | src/controls/Private/ColumnMenuContent.qml | 1 | ||||
-rw-r--r-- | src/controls/Private/MenuContentItem.qml | 2 | ||||
-rw-r--r-- | src/controls/Styles/Base/MenuStyle.qml | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/controls/Private/ColumnMenuContent.qml b/src/controls/Private/ColumnMenuContent.qml index ff608b473..9c0b2345c 100644 --- a/src/controls/Private/ColumnMenuContent.qml +++ b/src/controls/Private/ColumnMenuContent.qml @@ -50,6 +50,7 @@ Item { property var itemsModel property int minWidth: 100 property real maxHeight: 800 + readonly property bool mousePressed: hoverArea.pressed signal triggered(var item) diff --git a/src/controls/Private/MenuContentItem.qml b/src/controls/Private/MenuContentItem.qml index 669cde2fa..62e5d0333 100644 --- a/src/controls/Private/MenuContentItem.qml +++ b/src/controls/Private/MenuContentItem.qml @@ -178,6 +178,8 @@ Loader { readonly property int index: __menuItemIndex readonly property int type: __menuItem ? __menuItem.type : -1 readonly property bool selected: type !== MenuItemType.Separator && __menu.__currentIndex === index + readonly property bool pressed: type !== MenuItemType.Separator && __menu.__currentIndex === index + && content.mousePressed // TODO Add key pressed condition once we get delayed menu closing readonly property string text: type === MenuItemType.Menu ? __menuItem.title : type !== MenuItemType.Separator ? __menuItem.text : "" readonly property bool underlineMnemonic: __menu.__contentItem.altPressed diff --git a/src/controls/Styles/Base/MenuStyle.qml b/src/controls/Styles/Base/MenuStyle.qml index bfe78f7c2..032cc74e1 100644 --- a/src/controls/Styles/Base/MenuStyle.qml +++ b/src/controls/Styles/Base/MenuStyle.qml @@ -56,6 +56,7 @@ import QtQuick.Controls.Private 1.0 \row \li \b {styleData.index} : int \li The index of the menu item in its menu. \row \li \b {styleData.type} : enumeration \li The type of menu item. See below for possible values. \row \li \b {styleData.selected} : bool \li \c true if the menu item is selected. + \row \li \b {styleData.pressed} : bool \li \c true if the menu item is pressed. Available since 5.4. \row \li \b {styleData.text} : string \li The menu item's text, or title if it's a submenu. \row \li \b {styleData.underlineMnemonic} : bool \li Whether the style should underline the menu item's label mnemonic. \row \li \b {styleData.shortcut} : string \li The text for the menu item's shortcut. |