-
Notifications
You must be signed in to change notification settings - Fork 950
Expand file tree
/
Copy pathUserStatusSelectorPage.qml
More file actions
52 lines (41 loc) · 1.31 KB
/
UserStatusSelectorPage.qml
File metadata and controls
52 lines (41 loc) · 1.31 KB
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
/*
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import com.nextcloud.desktopclient as NC
Page {
id: page
signal finished
property int userIndex: -1
property string mode: setStatusMode
property NC.UserStatusSelectorModel model: NC.UserStatusSelectorModel {
userIndex: page.userIndex
onFinished: page.finished()
}
readonly property string setStatusMode: "setStatus"
readonly property string statusMessageMode: "statusMessage"
padding: Style.standardSpacing * 2
background: Rectangle {
color: palette.base
radius: Style.trayWindowRadius
}
contentItem: StackLayout {
currentIndex: page.mode === page.statusMessageMode ? 1 : 0
UserStatusSetStatusView {
Layout.fillWidth: true
Layout.fillHeight: true
userStatusSelectorModel: model
onFinished: page.finished()
onShowStatusMessageRequested: page.mode = page.statusMessageMode
}
UserStatusMessageView {
Layout.fillWidth: true
Layout.fillHeight: true
userStatusSelectorModel: model
onFinished: page.finished()
}
}
}