Commit d06eed8f authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Add number of tasks left to complete to filter header

parent 53b7cfdd
Pipeline #96447 canceled with stage
......@@ -773,6 +773,7 @@ QVariantMap CalendarManager::getCollectionDetails(QVariant collectionId)
collectionDetails[QLatin1String("name")] = collection.name();
collectionDetails[QLatin1String("displayName")] = collection.displayName();
collectionDetails[QLatin1String("color")] = m_baseModel->colorCache[QString::number(collection.id())];
collectionDetails[QLatin1String("count")] = collection.statistics().count();
collectionDetails[QLatin1String("isResource")] = Akonadi::CollectionUtils::isResource(collection);
collectionDetails[QLatin1String("readOnly")] = collection.rights().testFlag(Collection::ReadOnly);
collectionDetails[QLatin1String("isFiltered")] = isFiltered;
......
......@@ -66,14 +66,6 @@ RowLayout {
clip: true
visible: headerLayout.filter.tags.length > 0
move: Transition {
NumberAnimation {
properties: "x, y"
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
Repeater {
id: tagRepeater
model: headerLayout.filter ? headerLayout.filter.tags : {}
......@@ -95,4 +87,33 @@ RowLayout {
}
}
}
Kirigami.Heading {
id: numTasksHeading
Layout.fillWidth: true
Layout.rightMargin: Kirigami.Units.largeSpacing
horizontalAlignment: Text.AlignRight
function updateTasksCount() {
if(headerLayout.todoMode) text = applicationWindow().pageStack.currentItem.incompleteView.model.rowCount();
}
Connections {
target: applicationWindow().pageStack.currentItem.incompleteView.model
function onRowsInserted() {
numTasksHeading.updateTasksCount();
}
function onRowsRemoved() {
numTasksHeading.updateTasksCount();
}
}
font.weight: Font.Bold
color: headerLayout.todoMode && headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
headerLayout.filterCollectionDetails.color : Kirigami.Theme.textColor
elide: Text.ElideRight
visible: headerLayout.todoMode
}
}
......@@ -66,6 +66,8 @@ Kirigami.ScrollablePage {
readonly property color standardTextColor: Kirigami.Theme.textColor
readonly property bool isDark: LabelUtils.isDarkColor(Kirigami.Theme.backgroundColor)
readonly property alias incompleteView: incompleteView
padding: 0
leftPadding: Kirigami.Units.largeSpacing
......
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