212.4.1
by Kunal Parmar
Initial version of Cal Management |
1 |
import QtQuick 2.0 |
2 |
import Ubuntu.Components 0.1 |
|
3 |
import Ubuntu.Components.Popups 0.1 |
|
4 |
||
5 |
Dialog { |
|
6 |
id: root
|
|
7 |
title: i18n.tr("Select Color") |
|
8 |
height: units.gu(100) |
|
9 |
||
10 |
signal accepted(var color) |
|
11 |
signal rejected() |
|
12 |
||
13 |
contents: [ |
|
14 |
Grid{ |
|
15 |
height: units.gu(25) |
|
16 |
rows: 3 |
|
17 |
columns: 5 |
|
18 |
Repeater{ |
|
19 |
model: ["#2C001E","#333333","#DD4814","#DF382C","#EFB73E","#19B6EE","#38B44A","#001F5C"]; |
|
20 |
delegate:UbuntuShape{ |
|
21 |
width: (parent.width/5) |
|
22 |
height: width |
|
23 |
color: modelData |
|
24 |
||
25 |
MouseArea{ |
|
26 |
anchors.fill: parent |
|
27 |
onClicked: { |
|
28 |
root.accepted(modelData) |
|
29 |
PopupUtils.close(root) |
|
30 |
}
|
|
31 |
}
|
|
32 |
}
|
|
33 |
}
|
|
34 |
},
|
|
35 |
Button { |
|
36 |
objectName: "TimePickerCancelButton" |
|
37 |
text: i18n.tr("Cancel") |
|
38 |
onClicked: { |
|
39 |
root.rejected() |
|
40 |
PopupUtils.close(root) |
|
41 |
}
|
|
42 |
width: (parent.width) / 2 |
|
43 |
}
|
|
44 |
]
|
|
45 |
}
|