-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmain.qml
33 lines (31 loc) · 877 Bytes
/
main.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
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.3
Window {
id: window
visible: true
width: 800
height: 600
title: qsTr("Dark Switch")
color: "#2c2b30"
DarkSwitch{
id: darkSwitch
anchors.centerIn: parent
}
Text{
id: switchText1
text: "Switch Left"
color: darkSwitch.checked? "#969697" : "#3ea1fd"
anchors{verticalCenter: darkSwitch.verticalCenter; right: darkSwitch.left; rightMargin: 50}
font{family: "Arial"; pointSize: 18}
}
Text{
id: switchText2
text: "Switch Right"
color: darkSwitch.checked? "#3ea1fd" : "#969697"
anchors{verticalCenter: darkSwitch.verticalCenter; left: darkSwitch.right; leftMargin: 50}
font{family: "Arial"; pointSize: 18}
}
}