Repository navigation
Expand file tree
/
Copy pathUpdateChannelPanel.qml
More file actions
92 lines (81 loc) · 2.6 KB
/
Copy pathUpdateChannelPanel.qml
File metadata and controls
92 lines (81 loc) · 2.6 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import QtQuick
import qs.Commons
import qs.Ui
KeyboardPanel {
id: root
required property bool assumeYes
required property bool checking
required property string currentChannel
required property string pulseColor
required property var pulseColorPresets
required property string visibilityMode
property alias selectedChannel: mainPage.selectedChannel
readonly property bool channelChanged: mainPage.channelChanged
property bool _settingsPage: false
signal applyChannelRequested(string channel)
signal applySettingsRequested(
bool assumeYes,
string color,
string visibility)
signal closeRequested()
signal refreshRequested()
signal switchRequested(int direction)
signal visitRequested(string channel, string content)
function showMain() {
root._settingsPage = false
}
function _showSettings() {
settingsPageContent.reset()
root._settingsPage = true
}
function reset() {
mainPage.linkKind = "changelog"
root.showMain()
}
focusTarget: keyCatcher
contentWidth: fittedContentWidth(Style.space(340))
contentHeight: fittedContentHeight(panelColumn.implicitHeight)
PanelKeyCatcher {
id: keyCatcher
anchors.fill: parent
blocked: mainPage.popupOpen || settingsPageContent.popupOpen
onCloseRequested: {
if (root._settingsPage) root.showMain()
else root.closeRequested()
}
onTabRequested: function(direction) { root.switchRequested(direction) }
Column {
id: panelColumn
width: parent.width
spacing: Style.space(8)
UpdateChannelMainPage {
id: mainPage
visible: !root._settingsPage
width: parent.width
checking: root.checking
currentChannel: root.currentChannel
fontFamily: root.bar.fontFamily
foreground: root.bar.foreground
onApplyRequested: root.applyChannelRequested(selectedChannel)
onRefreshRequested: root.refreshRequested()
onSettingsRequested: root._showSettings()
onVisitRequested: root.visitRequested(selectedChannel, linkKind)
}
UpdateChannelSettingsPage {
id: settingsPageContent
visible: root._settingsPage
width: parent.width
assumeYes: root.assumeYes
fontFamily: root.bar.fontFamily
foreground: root.bar.foreground
pulseColor: root.pulseColor
pulseColorPresets: root.pulseColorPresets
visibilityMode: root.visibilityMode
onApplyRequested: function(assumeYes, color, visibility) {
root.applySettingsRequested(assumeYes, color, visibility)
}
onBackRequested: root.showMain()
}
}
}
}