-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
StandaloneComposer.qml
61 lines (48 loc) · 1.48 KB
/
StandaloneComposer.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-FileCopyrightText: 2023 Joshua Goins <[email protected]>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import org.kde.kirigami 2 as Kirigami
import QtQuick.Controls 2 as QQC2
import QtQuick.Layouts
import QtQml.Models
import org.kde.tokodon
import "./StatusComposer"
import "./PostDelegate"
Kirigami.ApplicationWindow {
id: appwindow
minimumWidth: Kirigami.Units.gridUnit * 15
minimumHeight: Kirigami.Units.gridUnit * 20
Connections {
target: AccountManager
function onAccountsReady() {
if (!AccountManager.hasAccounts) {
missingAccountMessage.visible = true;
}
}
}
Connections {
target: Controller
function onOpenComposer(text) {
pageStack.push(Qt.resolvedUrl("./StatusComposer/StatusComposer.qml"), {
purpose: StatusComposer.New,
initialText: text,
closeApplicationWhenFinished: true,
});
}
}
Rectangle {
anchors.fill: parent
visible: !AccountManager.isReady
color: Kirigami.Theme.backgroundColor
Kirigami.LoadingPlaceholder {
anchors.centerIn: parent
}
}
Kirigami.PlaceholderMessage {
id: missingAccountMessage
anchors.centerIn: parent
width: parent.width - Kirigami.Units.gridUnit * 4
text: i18n("No accounts available")
visible: false
}
}