Files
amnezia-client/client/ui/qml/main2.qml
T
vladimir.kuznetsov 0411792ca5 added qr-code decoder for android
- added color change for status and navigation bar for android
2023-07-25 16:56:10 +09:00

68 lines
1.5 KiB
QML

import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "Config"
import "Controls2"
Window {
id: root
visible: true
width: GC.screenWidth
height: GC.screenHeight
minimumWidth: GC.isDesktop() ? 360 : 0
minimumHeight: GC.isDesktop() ? 640 : 0
color: "#0E0E11"
onClosing: function() {
console.debug("QML onClosing signal")
PageController.closeWindow()
}
title: "AmneziaVPN"
StackViewType {
id: rootStackView
anchors.fill: parent
focus: true
Component.onCompleted: {
var pagePath = PageController.getInitialPage()
rootStackView.push(pagePath, { "objectName" : pagePath })
}
Keys.onPressed: function(event) {
PageController.keyPressEvent(event.key)
event.accepted = true
}
}
Connections {
target: PageController
function onReplaceStartPage() {
var pagePath = PageController.getInitialPage()
while (rootStackView.depth > 1) {
rootStackView.pop()
}
PageController.updateNavigationBarColor(PageController.getInitialPageNavigationBarColor())
rootStackView.replace(pagePath, { "objectName" : pagePath })
}
function onRaiseMainWindow() {
root.show()
root.raise()
root.requestActivate()
}
function onHideMainWindow() {
root.hide()
}
}
}