on xenial help sign in
Disable Dash horizontal scroll while Navigation InverseMouseArea is pressed
commitdc3ac5d953922624a7e17c2484fe1bf104cad399 authorAlbert Astals <albert.astals@canonical.com> dateMon 5 Jan 2015, 16:08 (12 years ago) parentab98493
4 files changed+9−3
qml/Dash/DashContent.qml+2−2 qml/Dash/DashNavigation.qml+4 qml/Dash/DashNavigationButton.qml+2 qml/Dash/GenericScopeView.qml+1−1
qml/Dash/DashContent.qml+2−2
@@ -113,7 +113,7 @@ Item {
113113 objectName: "dashContentList"
114114
115115 interactive: !dashContent.forceNonInteractive && dashContent.scopes.loaded && currentItem
116− && !currentItem.moving && !currentItem.navigationShown && !currentItem.subPageShown
116+ && !currentItem.moving && !currentItem.navigationDisableParentInteractive && !currentItem.subPageShown
117117 anchors.fill: parent
118118 orientation: ListView.Horizontal
119119 boundsBehavior: Flickable.DragAndOvershootBounds
@@ -175,7 +175,7 @@ Item {
175175 objectName: "scopeLoader" + index
176176
177177 readonly property bool moving: item ? item.moving : false
178− readonly property bool navigationShown: item ? item.navigationShown : false
178+ readonly property bool navigationDisableParentInteractive: item ? item.navigationDisableParentInteractive : false
179179 readonly property bool subPageShown: item ? item.subPageShown : false
180180 readonly property var categoryView: item ? item.categoryView : null
181181 readonly property var theScope: scope
qml/Dash/DashNavigation.qml+4
@@ -33,6 +33,10 @@ Item {
3333 if (altNavigationButton.showList) return altNavigationButton.listView;
3434 return null;
3535 }
36+ readonly property bool disableParentInteractive: {
37+ return navigationButton.showList || altNavigationButton.showList ||
38+ navigationButton.inverseMousePressed || altNavigationButton.inverseMousePressed;
39+ }
3640
3741 // FIXME this is only here for highlight purposes (see Background.qml, too)
3842 readonly property var background: backgroundItem
qml/Dash/DashNavigationButton.qml+2
@@ -31,6 +31,7 @@ AbstractButton {
3131 // Used by parent
3232 readonly property var currentNavigation: scope && scope[hasNavigation] ? getNavigation(scope[currentNavigationId]) : null
3333 readonly property alias listView: navigationListView
34+ readonly property bool inverseMousePressed: inverseMouseArea.pressed
3435 property bool showList: false
3536
3637 // Internal
@@ -210,6 +211,7 @@ AbstractButton {
210211 onCurrentNavigationChanged: setNewNavigation();
211212
212213 InverseMouseArea {
214+ id: inverseMouseArea
213215 anchors.fill: navigationListView
214216 enabled: root.showList
215217 onPressed: root.showList = false
qml/Dash/GenericScopeView.qml+1−1
@@ -25,7 +25,7 @@ import "../Components/ListItems" as ListItems
2525FocusScope {
2626 id: scopeView
2727
28− readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].openList : false
28+ readonly property bool navigationDisableParentInteractive: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].disableParentInteractive : false
2929 property bool forceNonInteractive: false
3030 property var scope: null
3131 property SortFilterProxyModel categories: categoryFilter