import QtQuick 2.10 import QtQuick.Window 2.10 import QtQuick.Controls 2.3 import trinity.matrix 1.0 ApplicationWindow { id: window visible: true width: 640 height: 480 title: "Trinity " + matrix.profileName SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } property var showDialog: function(title, description, buttons) { var popup = Qt.createComponent("qrc:/Dialog.qml") var popupContainer = popup.createObject(window, {"parent": window, "title": title, "description": description, "buttons": buttons}) popupContainer.open() } property var showImage: function(url) { var popup = Qt.createComponent("qrc:/ImageViewer.qml") var popupContainer = popup.createObject(window, {"parent": window, "url": url}) } Component.onCompleted: { connect.onAccountChange() } Connections { id: connect target: app function onAccountChange() { if(matrix.settingsValid()) { desktop.showTrayIcon(false) stack.replace("qrc:/Client.qml") } else { desktop.showTrayIcon(true) stack.replace("qrc:/Login.qml") } } } StackView { id: stack anchors.fill: parent pushEnter: Transition { PropertyAnimation { property: "opacity" from: 0 to:1 duration: 200 } } pushExit: Transition { PropertyAnimation { property: "opacity" from: 1 to:0 duration: 200 } } popEnter: Transition { PropertyAnimation { property: "opacity" from: 0 to:1 duration: 200 } } popExit: Transition { PropertyAnimation { property: "opacity" from: 1 to:0 duration: 200 } } } }