From 058f8b544e5c16dd6128bc54d3d9c57d645e4785 Mon Sep 17 00:00:00 2001 From: Matthew Schwiebert Date: Thu, 28 Sep 2023 10:14:01 -0400 Subject: [PATCH] Limit Drawer positioning by dragHeight and total page height --- client/ui/qml/Controls2/DrawerType.qml | 5 ++++- client/ui/qml/Pages2/PageHome.qml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/ui/qml/Controls2/DrawerType.qml b/client/ui/qml/Controls2/DrawerType.qml index c22d00c2..bb2ee4aa 100644 --- a/client/ui/qml/Controls2/DrawerType.qml +++ b/client/ui/qml/Controls2/DrawerType.qml @@ -5,6 +5,7 @@ Drawer { id: drawer property bool needCloseButton: true property bool isOpened: false + property int pageHeight Connections { target: PageController @@ -54,6 +55,7 @@ Drawer { if (needCloseButton) { PageController.drawerOpen() } + position = (dragMargin / pageHeight) } onAboutToHide: { @@ -77,9 +79,10 @@ Drawer { onPositionChanged: { - if (isOpened && (position <= 0.99 && position >= 0.95)) { + if (position < (dragMargin / root.height)) { mouseArea.canceled() drawer.close() + position = 0 mouseArea.exited() dropArea.exited() } diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index d8796524..bfebbb21 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -148,6 +148,7 @@ PageType { width: parent.width height: parent.height * 0.9 + pageHeight: root.height ColumnLayout { id: serversMenuHeader