summaryrefslogtreecommitdiff
path: root/src/controls/MenuBar.qml
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-26 10:56:26 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-09-30 15:27:06 +0200
commite1ba563285270fd20e0aa8b9692b1bf1686b0128 (patch)
tree642863bfafe1287b45a10a14d3839a8951a16a41 /src/controls/MenuBar.qml
parent00665083ce5ccccab00b852164f03fe1efa9c504 (diff)
downloadqtquickcontrols-e1ba563285270fd20e0aa8b9692b1bf1686b0128.tar.gz
qquickmenu: add support for providing a target rect to __popup()
Using a target rect as menu location instead of a position has been supported in QPlatformMenu for a while. The reason for specifying a rect instead of a position is that then the OS can decide if the popup should be placed above or below the target rect so that it fits inside the screen. A typical example is when showing an edit menu around a text selection. If the selection (target rectangle) is far up on the screen, the popup (with arrow) will be placed below the selection instead of above, which is the normal. Change-Id: Ie6cd6a92f1d9ef480c1e455960021c7f18f86569 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/MenuBar.qml')
-rw-r--r--src/controls/MenuBar.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml
index 9c9fa698..5d90f91d 100644
--- a/src/controls/MenuBar.qml
+++ b/src/controls/MenuBar.qml
@@ -252,8 +252,8 @@ MenuBarPrivate {
if (d.openedMenuIndex === index) {
if (__menuItem.__usingDefaultStyle)
__menuItem.style = d.style.menuStyle
- __menuItem.__popup(row.LayoutMirroring.enabled ? menuItemLoader.width : 0,
- menuBarLoader.height - d.heightPadding, 0)
+ __menuItem.__popup(Qt.rect(row.LayoutMirroring.enabled ? menuItemLoader.width : 0,
+ menuBarLoader.height - d.heightPadding, 0, 0), 0)
if (d.preselectMenuItem)
__menuItem.__currentIndex = 0
} else {