Android Back button like home button #212
|
@ -15,7 +15,7 @@ type CwtchActivity struct {
|
||||||
|
|
||||||
_ func(string) `slot:"updateAndroidNotification"`
|
_ func(string) `slot:"updateAndroidNotification"`
|
||||||
|
|
||||||
_ func() `signal:"rootHomeButtonHandle,auto""`
|
_ func() `signal:"rootHomeButtonHandle,auto"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CwtchActivity) init() {
|
func (c *CwtchActivity) init() {
|
||||||
|
|
|
@ -200,7 +200,13 @@ ApplicationWindow {
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
if (event.key == Qt.Key_Back) {
|
if (event.key == Qt.Key_Back) {
|
||||||
event.accepted = true
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue