Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
trinity/qml/main.qml
Joshua Goins a825c8886d Add basic encryption support
Sorry this is a huge commit, this actually includes a ton
of stuff. Text color is now readable, multiple accounts
are supported alongside end-to-end encryption but no
cross-signing yet :-) There's also a whole lot of other
small changes, such as choosing the server you want to
request a room directory from.
2022-03-01 16:20:32 -05:00

85 lines
2.1 KiB
QML
Executable file

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
}
}
}
}