forked from IgorYbema/tscSettings
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCustomToonLogoScreen.qml
More file actions
80 lines (66 loc) · 1.79 KB
/
CustomToonLogoScreen.qml
File metadata and controls
80 lines (66 loc) · 1.79 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
import QtQuick 2.1
import qb.components 1.0
import BxtClient 1.0
Screen {
id: customToonLogoScreen
isSaveCancelDialog: true
screenTitle: "Custom Toon Logo"
property bool firstShown: true; // we need this because exiting a keyboard will load onShown again. Without this the input will be overwritten with the app settings again
onShown: {
if (firstShown) {
radioButtonList.currentIndex = globals.tsc["customToonLogo"]
customToonLogoURLLabel.rightText = globals.tsc["customToonLogoURL"]
firstShown = false;
}
}
onSaved: {
var myTsc = globals.tsc
myTsc["customToonLogo"] = radioButtonList.currentIndex
myTsc["customToonLogoURL"] = customToonLogoURLLabel.rightText
globals.tsc = myTsc
app.saveSettingsTsc();
}
function saveURL(text) {
if (text) {
customToonLogoURLLabel.rightText = text;
}
}
RadioButtonList {
id: radioButtonList
width: Math.round(220 * 1.28)
height: Math.round(250 * app.nxtScale)
anchors.centerIn: parent
title: "Toon Custom 'TOON' logo?"
Component.onCompleted: {
addItem("Disabled");
addItem("Enabled");
forceLayout();
currentIndex = 0;
}
}
SingleLabel {
id: customToonLogoURLLabel
width: isNxt ? 800 : 650
leftText: "Icon Url:"
anchors {
top: radioButtonList.bottom
left: parent.left
leftMargin: isNxt ? 60 : 50
}
}
IconButton {
id: customToonLogoURLButton
width: 45
height: customToonLogoLabel.height
iconSource: "qrc:/images/edit.svg"
anchors {
top: customToonLogoURLLabel.top
left: customToonLogoURLLabel.right
leftMargin: 10
}
topClickMargin: 3
onClicked: {
qkeyboard.open("Custom logo URL", customToonLogoURLLabel.rightText, saveURL);
}
}
}