Skip to content

Commit

Permalink
Merge pull request #336 from amnezia-vpn/bugfix/close_drawer_easily
Browse files Browse the repository at this point in the history
Bugfix/close drawer easily, short distance with dragging
  • Loading branch information
Nethius authored Sep 21, 2023
2 parents 18bb045 + dd039a6 commit a6d660e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions client/ui/qml/Controls2/DrawerType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import QtQuick
import QtQuick.Controls

Drawer {
id: drawer
property bool needCloseButton: true
property bool isOpened: false

Connections {
target: PageController
Expand Down Expand Up @@ -60,10 +62,39 @@ Drawer {
}
}

onOpened: {
isOpened = true
}

onClosed: {
isOpened = false

var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor()
if (initialPageNavigationBarColor !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(initialPageNavigationBarColor)
}
}


onPositionChanged: {
if (isOpened && (position <= 0.99 && position >= 0.95)) {
mouseArea.canceled()
drawer.close()
mouseArea.exited()
dropArea.exited()
}
}

DropArea {
id: dropArea
}

MouseArea {
id: mouseArea
anchors.fill: parent

onPressed: {
isOpened = true
}
}
}

0 comments on commit a6d660e

Please sign in to comment.