diff options
author | Liang Qi <[email protected]> | 2016-01-30 21:11:09 +0100 |
---|---|---|
committer | Liang Qi <[email protected]> | 2016-01-30 21:11:13 +0100 |
commit | e2d7c49923c946eacb4ea635b78f1a06eeffd5c6 (patch) | |
tree | 58cc98de3bad24e9937d36f260ebcf3d44ac4294 | |
parent | b834f742994e5dce69c3fdc161099f2ed20deff9 (diff) | |
parent | 4998538c94ed8cb029b8849a60b3f7528eae8311 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6.0
Change-Id: Ideb3ff546c83f52df6fa6a61fa7f91c628c43021
-rw-r--r-- | src/controls/MenuBar.qml | 2 | ||||
-rw-r--r-- | src/controls/Private/MenuContentItem.qml | 6 | ||||
-rw-r--r-- | src/controls/qquickmenupopupwindow.cpp | 7 | ||||
-rw-r--r-- | src/controls/qquickmenupopupwindow_p.h | 1 |
4 files changed, 15 insertions, 1 deletions
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml index a16635ffa..cb31ed71f 100644 --- a/src/controls/MenuBar.qml +++ b/src/controls/MenuBar.qml @@ -247,6 +247,8 @@ MenuBarPrivate { } } + Keys.forwardTo: d.openedMenuIndex !== -1 ? [root.menus[d.openedMenuIndex].__contentItem] : [] + Row { id: row x: d.style ? d.style.padding.left : 0 diff --git a/src/controls/Private/MenuContentItem.qml b/src/controls/Private/MenuContentItem.qml index e3be2e444..5a827b618 100644 --- a/src/controls/Private/MenuContentItem.qml +++ b/src/controls/Private/MenuContentItem.qml @@ -138,9 +138,13 @@ Loader { Keys.onRightPressed: { var item = content.menuItemAt(__menu.__currentIndex) - if ((event.accepted = (item && item.styleData.type === MenuItemType.Menu))) { + if (item && item.styleData.type === MenuItemType.Menu + && !item.__menuItem.__popupVisible) { item.__showSubMenu(true) item.__menuItem.__currentIndex = 0 + event.accepted = true + } else { + event.accepted = false } } diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp index 8d821d848..670ad6aa3 100644 --- a/src/controls/qquickmenupopupwindow.cpp +++ b/src/controls/qquickmenupopupwindow.cpp @@ -148,6 +148,13 @@ void QQuickMenuPopupWindow::updatePosition() setGeometry(newPos.x(), newPos.y(), width(), height()); } +void QQuickMenuPopupWindow::focusInEvent(QFocusEvent *e) +{ + QQuickWindow::focusInEvent(e); + if (m_menu && m_menu->menuContentItem()) + m_menu->menuContentItem()->forceActiveFocus(); +} + void QQuickMenuPopupWindow::exposeEvent(QExposeEvent *e) { // the popup will reposition at the last moment, so its diff --git a/src/controls/qquickmenupopupwindow_p.h b/src/controls/qquickmenupopupwindow_p.h index 5cff75af0..abee1f83d 100644 --- a/src/controls/qquickmenupopupwindow_p.h +++ b/src/controls/qquickmenupopupwindow_p.h @@ -68,6 +68,7 @@ Q_SIGNALS: void willBeDeletedLater(); protected: + void focusInEvent(QFocusEvent *); void exposeEvent(QExposeEvent *); bool shouldForwardEventAfterDismiss(QMouseEvent *) const; |