mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
Limit Drawer positioning by dragHeight and total page height
This commit is contained in:
@@ -5,6 +5,7 @@ Drawer {
|
|||||||
id: drawer
|
id: drawer
|
||||||
property bool needCloseButton: true
|
property bool needCloseButton: true
|
||||||
property bool isOpened: false
|
property bool isOpened: false
|
||||||
|
property int pageHeight
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: PageController
|
target: PageController
|
||||||
@@ -54,6 +55,7 @@ Drawer {
|
|||||||
if (needCloseButton) {
|
if (needCloseButton) {
|
||||||
PageController.drawerOpen()
|
PageController.drawerOpen()
|
||||||
}
|
}
|
||||||
|
position = (dragMargin / pageHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
onAboutToHide: {
|
onAboutToHide: {
|
||||||
@@ -77,9 +79,10 @@ Drawer {
|
|||||||
|
|
||||||
|
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
if (isOpened && (position <= 0.99 && position >= 0.95)) {
|
if (position < (dragMargin / root.height)) {
|
||||||
mouseArea.canceled()
|
mouseArea.canceled()
|
||||||
drawer.close()
|
drawer.close()
|
||||||
|
position = 0
|
||||||
mouseArea.exited()
|
mouseArea.exited()
|
||||||
dropArea.exited()
|
dropArea.exited()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ PageType {
|
|||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height * 0.9
|
height: parent.height * 0.9
|
||||||
|
pageHeight: root.height
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: serversMenuHeader
|
id: serversMenuHeader
|
||||||
|
|||||||
Reference in New Issue
Block a user