forked from andreagen0r/ColorPicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
44 lines (37 loc) · 1.01 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
import QtQuick
import QtQuick.Controls
ApplicationWindow {
width: 1920
height: 1080
visible: true
title: qsTr("Color Wheel")
// Material.theme: Material.Dark
// Material.accent: Material.Orange
Pane {
height: parent.height
width: 100
Column {
width: parent.width
spacing: 24
ColorTool {
id: colorTool
width: 80
height: 80
primary: "purple"
secondary: "orange"
// onPrimaryClicked: console.log("ColorTool Primary Clicked", primary)
// onSecondaryClicked: console.log("ColorTool Secondary Clicked", secondary)
onCurrentColorChanged: colorDialog.color = currentColor
onPrimaryDoubleClicked: colorDialog.open()
onSecondaryDoubleClicked: colorDialog.open()
}
}
}
ColorPickerDialog {
id: colorDialog
width: 450
height: 700
title: qsTr("Color Picker")
onAccepted: colorTool.primaryFirstPlane ? (colorTool.primary = color) : (colorTool.secondary = color)
}
}