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

Added reset button to tasks view collection title to easily reset filtering collection

parent 6dfab8dc
Pipeline #94047 passed with stage
in 5 minutes and 9 seconds
......@@ -12,6 +12,7 @@ import "labelutils.js" as LabelUtils
RowLayout {
id: headerLayout
signal resetFilterCollection()
signal removeFilterTag(string tagName)
signal searchTextChanged(string text)
......@@ -29,21 +30,28 @@ RowLayout {
spacing: Kirigami.Units.smallSpacing
Kirigami.Heading {
id: heading
width: implicitWidth
Layout.fillWidth: headerLayout.todoMode
RowLayout {
Layout.margins: Kirigami.Units.largeSpacing
Layout.bottomMargin: headerLayout.rows > 1 ? Kirigami.Units.smallSpacing : Kirigami.Units.largeSpacing
text: !headerLayout.todoMode ? i18n("Filtering by tags") : headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
headerLayout.filterCollectionDetails.displayName : i18n("All Tasks")
font.weight: !headerLayout.todoMode ? Font.Normal : Font.Bold
color: headerLayout.todoMode && headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
LabelUtils.getIncidenceLabelColor(headerLayout.filterCollectionDetails.color, headerLayout.isDark) : Kirigami.Theme.textColor
elide: Text.ElideRight
level: headerLayout.todoMode ? 1 : 2
Kirigami.Heading {
id: heading
Layout.alignment: Qt.AlignVCenter
width: implicitWidth
text: !headerLayout.todoMode ? i18n("Filtering by tags") : headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
headerLayout.filterCollectionDetails.displayName : i18n("All Tasks")
font.weight: !headerLayout.todoMode ? Font.Normal : Font.Bold
color: headerLayout.todoMode && headerLayout.filterCollectionDetails && headerLayout.filter.collectionId > -1 ?
LabelUtils.getIncidenceLabelColor(headerLayout.filterCollectionDetails.color, headerLayout.isDark) : Kirigami.Theme.textColor
elide: Text.ElideRight
level: headerLayout.todoMode ? 1 : 2
}
QQC2.ToolButton {
Layout.alignment: Qt.AlignVCenter
icon.name: "edit-reset"
visible: headerLayout.todoMode && headerLayout.filter.collectionId > -1
onClicked: headerLayout.resetFilterCollection()
}
}
Flow {
......
......@@ -530,6 +530,10 @@ Kirigami.ApplicationWindow {
pageStack.currentItem.filter.tags.splice(pageStack.currentItem.filter.tags.indexOf(tagName), 1);
pageStack.currentItem.filterChanged();
}
onResetFilterCollection: {
pageStack.currentItem.filter.collectionId = -1;
pageStack.currentItem.filterChanged();
}
}
Kirigami.Separator {
id: headerSeparator
......
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