Commit 40cb79e7 authored by Carl Schwan's avatar Carl Schwan 🚴 Committed by Claudio Cambra
Browse files

Add process to the icons in the task view

Fix #34 

![image](/uploads/dd9c645f494d5784dade8ac3077f2a47/image.png)
parent 62f97778
Pipeline #119845 passed with stage
in 4 minutes and 40 seconds
......@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.16)
project(kalendar VERSION 0.4.0)
set(QT_MIN_VERSION "5.15.2")
set(KF5_MIN_VERSION "5.86.0")
set(KF5_MIN_VERSION "5.88.0")
set(AKONADI_VERSION "5.18.0")
set(CALENDARSUPPORT_LIB_VERSION "5.18")
set(EVENTVIEW_LIB_VERSION "5.18.0")
......
......@@ -237,7 +237,52 @@ TreeListView {
Layout.row: 0
Layout.column: 0
Layout.rowSpan: root.width < Kirigami.Units.gridUnit * 28 || recurIcon.visible || dateLabel.visible ? 1 : 2
indicator: Item {
height: parent.height
width: height
x: todoCheckbox.leftPadding
y: parent.height / 2 - height / 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
// The icon provides the main circle for the checkbox when not checked,
// whereas the rectangle provides the circle when it is checked.
// The rectangle always provides the tinted background.
Kirigami.Icon {
isMask: true
color: model.color
anchors.fill: parent
anchors.margins: parent.height * -0.16
visible: !todoCheckbox.checked
source: {
if (model.percent >= 75) {
return 'task-process-3';
}
if (model.percent >= 50) {
return 'task-process-2';
}
if (model.percent >= 25) {
return 'task-process-1';
}
return 'task-process-0';
}
}
Rectangle {
anchors.fill: parent
radius: todoCheckbox.radius
border.color: todoCheckbox.checked ? todoCheckbox.color : Qt.rgba(0,0,0,0)
color: Qt.rgba(todoCheckbox.color.r, todoCheckbox.color.g, todoCheckbox.color.b, 0.1)
Rectangle {
anchors.margins: parent.height * 0.2
anchors.fill: parent
radius: todoCheckbox.radius / 3
color: todoCheckbox.color
visible: todoCheckbox.checked
}
}
}
color: model.color
radius: 100
checked: model.todoCompleted
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment