moment/src/gui/UI.qml

88 lines
2.1 KiB
QML
Raw Normal View History

2019-12-19 22:46:16 +11:00
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Window 2.12
import QtGraphicalEffects 1.12
import "Base"
2019-12-11 06:17:41 +11:00
import "MainPane"
Item {
2019-04-28 11:07:20 +10:00
id: mainUI
2019-09-09 20:44:06 +10:00
focus: true
Component.onCompleted: window.mainUI = mainUI
property bool accountsPresent:
ModelStore.get("accounts").count > 0 || py.startupAnyAccountsSaved
2019-09-18 06:30:04 +10:00
readonly property alias shortcuts: shortcuts
2019-12-11 06:17:41 +11:00
readonly property alias mainPane: mainPane
2019-09-18 06:30:04 +10:00
readonly property alias pageLoader: pageLoader
readonly property alias pressAnimation: pressAnimation
function reloadSettings() {
py.loadSettings(() => { mainUI.pressAnimation.start() })
}
SequentialAnimation {
id: pressAnimation
2019-12-16 19:42:41 +11:00
HNumberAnimation {
target: mainUI; property: "scale"; from: 1.0; to: 0.9
}
HNumberAnimation {
target: mainUI; property: "scale"; from: 0.9; to: 1.0
}
}
2019-04-28 14:44:55 +10:00
GlobalShortcuts {
id: shortcuts
defaultDebugConsoleLoader: debugConsoleLoader
}
DebugConsoleLoader {
id: debugConsoleLoader
active: false
}
LinearGradient {
id: mainUIGradient
2020-03-19 15:13:38 +11:00
visible: ! image.visible
anchors.fill: parent
start: theme.ui.gradientStart
end: theme.ui.gradientEnd
gradient: Gradient {
GradientStop { position: 0.0; color: theme.ui.gradientStartColor }
GradientStop { position: 1.0; color: theme.ui.gradientEndColor }
}
}
2020-03-19 15:13:38 +11:00
HImage {
id: image
visible: Boolean(Qt.resolvedUrl(source))
fillMode: Image.PreserveAspectCrop
source: theme.ui.image
sourceSize.width: Screen.width
sourceSize.height: Screen.height
anchors.fill: parent
asynchronous: false
}
2019-12-11 06:17:41 +11:00
MainPane {
id: mainPane
maximumSize: parent.width - theme.minimumSupportedWidth * 1.5
}
PageLoader {
id: pageLoader
anchors.fill: parent
2019-12-11 06:17:41 +11:00
anchors.leftMargin: mainPane.visibleSize
visible: ! mainPane.hidden || anchors.leftMargin < width
2019-09-18 06:30:04 +10:00
}
}