Improve 'Completed tasks' button

This commit is contained in:
Vyn 2024-05-20 18:27:19 +02:00
parent 66c4048b60
commit da3f33849a
6 changed files with 20 additions and 14 deletions

View file

@ -72,6 +72,8 @@ qt_add_qml_module(mirai
src/images/calendar.png
src/images/add.png
src/images/settings.png
src/images/visible.png
src/images/not-visible.png
)
target_link_libraries(mirai PRIVATE Qt6::Quick)

BIN
src/images/not-visible.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/images/visible.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -72,7 +72,6 @@ Window {
Loader {
sourceComponent: sideMenuComponent
Layout.preferredWidth: item.width
Layout.fillHeight: true
}
Loader {
@ -90,7 +89,6 @@ Window {
Loader {
sourceComponent: sideMenuComponent
Layout.preferredWidth: item.width
Layout.fillHeight: true
}
Loader {

View file

@ -43,13 +43,25 @@ Rectangle {
}
AppButton {
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
icon.color: colorPalette.selected.palette.green
text: "Add task"
onClicked: {
root.newTask()
RowLayout {
AppButton {
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
icon.color: colorPalette.selected.palette.green
text: "Add task"
onClicked: {
root.newTask()
}
}
AppButton {
icon.source: backend.shouldHideCompletedTasks ? "qrc:/qt/qml/Mirai/src/images/not-visible.png" : "qrc:/qt/qml/Mirai/src/images/visible.png"
text: `Completed tasks`
onClicked: {
backend.hideCompletedTasks(!backend.shouldHideCompletedTasks)
}
}
}
Component {

View file

@ -129,12 +129,6 @@ Rectangle {
Layout.fillHeight: true
}
AppButton {
text: `Hide completed tasks: ${backend.shouldHideCompletedTasks ? "ON" : "OFF"}`
onClicked: {
backend.hideCompletedTasks(!backend.shouldHideCompletedTasks)
}
}
Popup {
parent: Overlay.overlay