Merge branch 'feature/new-gui' into fixbug/not_hide_topright_corner_button

This commit is contained in:
ronoaer 2023-09-22 06:28:02 +08:00 committed by GitHub
commit 81b77c9688
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 2309 additions and 79 deletions

View file

@ -2,7 +2,9 @@ import QtQuick
import QtQuick.Controls
Drawer {
id: drawer
property bool needCloseButton: true
property bool isOpened: false
Connections {
target: PageController
@ -51,12 +53,16 @@ Drawer {
}
onOpened: {
isOpened = true
if (needCloseButton) {
PageController.drawerOpen()
}
}
onClosed: {
isOpened = false
if (needCloseButton) {
PageController.drawerClose()
}
@ -66,4 +72,27 @@ Drawer {
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
}
}
}