forked from mivoligo/Zeegaree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathColourSetterSmall.qml
87 lines (72 loc) · 2.82 KB
/
ColourSetterSmall.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
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
import QtQuick 1.1
import "Storage.js" as Storage
Rectangle {
id: root
property string selectedColour
property int previousIndex: 0
width: row.width + 4
// height: row.height + 5
Row {
id: row
anchors {
top: parent.top
topMargin: 2
horizontalCenter: parent.horizontalCenter
}
spacing: 2
Image {
id: all_colors_image
Behavior on height {NumberAnimation {}}
source: "images/all_colors.png"
height: 26
MouseArea {
anchors.fill: parent
onClicked: {
var previousitems = root.previousIndex
var tasklistmodel = tasklist.todo_listmodel
repit.itemAt(previousitems).height = 15;
all_colors_image.height = 26
todo_list_name.selected_task_color = ""
tasklistmodel.clear()
if (controls_tasks_gen.hiddenfinished == true){
Storage.getNotFinishedTasksFromDB(todo_list_name.todo_list_timestamp, false, tasklistmodel);
}
else {
Storage.getTasksFromDB(todo_list_name.todo_list_timestamp, tasklistmodel)
}
}
}
}
Repeater {
id: repit
model: [ "#222222", "#1abc9c", "#27ae60", "#2980b4", "#8e44ad", "#34495e", "#f39c12", "#d35400", "#c0392b" ]
Rectangle {
id: color_rect
Behavior on height {NumberAnimation {}}
color: modelData
width: 15
height: width
MouseArea {
anchors.fill: parent
onClicked: {
var previousitems = root.previousIndex
var tasklistmodel = tasklist.todo_listmodel
root.selectedColour = color_rect.color;
repit.itemAt(previousitems).height = 15
all_colors_image.height = 15
root.previousIndex = index
repit.itemAt(index).height = 26
todo_list_name.selected_task_color = color_rect.color
tasklistmodel.clear()
if (controls_tasks_gen.hiddenfinished == true){
Storage.getNotFinishedTasksWithColor(todo_list_name.todo_list_timestamp, root.selectedColour, false, tasklistmodel)
}
else {
Storage.getTasksWithColor(todo_list_name.todo_list_timestamp, root.selectedColour, tasklistmodel)
}
}
}
}
}
}
}