Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kalendar
Commits
bd32795b
Commit
bd32795b
authored
Nov 04, 2021
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/FilterHeader.qml
View file @
bd32795b
...
...
@@ -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
{
...
...
src/contents/ui/main.qml
View file @
bd32795b
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment