Android Back button like home button #212

Merged
erinn merged 2 commits from :androidBack into master 2019-09-13 23:24:59 +00:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 049087c080 - Show all commits

View File

@ -15,7 +15,7 @@ type CwtchActivity struct {
_ func(string) `slot:"updateAndroidNotification"`
_ func() `signal:"rootHomeButtonHandle,auto""`
_ func() `signal:"rootHomeButtonHandle,auto"`
}
func (c *CwtchActivity) init() {

View File

@ -200,7 +200,13 @@ ApplicationWindow {
Keys.onPressed: {
if (event.key == Qt.Key_Back) {
event.accepted = true
androidCwtchActivity.rootHomeButtonHandle()
if (theStack.currentIndex == theStack.emptyPane) {
androidCwtchActivity.rootHomeButtonHandle()
} else if (theStack.currentIndex == theStack.userProfilePane || theStack.currentIndex == theStack.groupProfilePane) {
theStack.currentIndex = theStack.messagePane
} else {
theStack.currentIndex = theStack.emptyPane
}
}
}
}