From 418cb72b9346ddb258cb1384fd6b95af143c2059 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 17 Mar 2020 20:19:41 +0100 Subject: Account for the padding around a menu when checking if it is interactive If there is padding around the menu then it will mean the available height is smaller than the containing item and as such should be interactive. Fixes: QTBUG-82473 Change-Id: Ie3e7568ab66aa3da93e5448c1a27c9bd2a5e486a Reviewed-by: Mitch Curtis --- src/imports/controls/Menu.qml | 4 +++- src/imports/controls/fusion/Menu.qml | 4 +++- src/imports/controls/imagine/Menu.qml | 4 +++- src/imports/controls/material/Menu.qml | 4 +++- src/imports/controls/universal/Menu.qml | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/imports') diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml index 041942f5..cf3a52f2 100644 --- a/src/imports/controls/Menu.qml +++ b/src/imports/controls/Menu.qml @@ -56,7 +56,9 @@ T.Menu { contentItem: ListView { implicitHeight: contentHeight model: control.contentModel - interactive: Window.window ? contentHeight > Window.window.height : false + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false clip: true currentIndex: control.currentIndex diff --git a/src/imports/controls/fusion/Menu.qml b/src/imports/controls/fusion/Menu.qml index e06b70fd..8bace6b9 100644 --- a/src/imports/controls/fusion/Menu.qml +++ b/src/imports/controls/fusion/Menu.qml @@ -59,7 +59,9 @@ T.Menu { contentItem: ListView { implicitHeight: contentHeight model: control.contentModel - interactive: Window.window ? contentHeight > Window.window.height : false + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false clip: true currentIndex: control.currentIndex diff --git a/src/imports/controls/imagine/Menu.qml b/src/imports/controls/imagine/Menu.qml index 20a34467..832565e6 100644 --- a/src/imports/controls/imagine/Menu.qml +++ b/src/imports/controls/imagine/Menu.qml @@ -69,7 +69,9 @@ T.Menu { contentItem: ListView { implicitHeight: contentHeight model: control.contentModel - interactive: Window.window ? contentHeight > Window.window.height : false + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false clip: true currentIndex: control.currentIndex diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml index d28713a7..94bcc15e 100644 --- a/src/imports/controls/material/Menu.qml +++ b/src/imports/controls/material/Menu.qml @@ -74,7 +74,9 @@ T.Menu { implicitHeight: contentHeight model: control.contentModel - interactive: Window.window ? contentHeight > Window.window.height : false + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false clip: true currentIndex: control.currentIndex diff --git a/src/imports/controls/universal/Menu.qml b/src/imports/controls/universal/Menu.qml index 619cfa40..4814d006 100644 --- a/src/imports/controls/universal/Menu.qml +++ b/src/imports/controls/universal/Menu.qml @@ -56,7 +56,9 @@ T.Menu { contentItem: ListView { implicitHeight: contentHeight model: control.contentModel - interactive: Window.window ? contentHeight > Window.window.height : false + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false clip: true currentIndex: control.currentIndex -- cgit v1.2.3