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/calendar.png
src/images/add.png src/images/add.png
src/images/settings.png src/images/settings.png
src/images/visible.png
src/images/not-visible.png
) )
target_link_libraries(mirai PRIVATE Qt6::Quick) 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 { Loader {
sourceComponent: sideMenuComponent sourceComponent: sideMenuComponent
Layout.preferredWidth: item.width
Layout.fillHeight: true Layout.fillHeight: true
} }
Loader { Loader {
@ -90,7 +89,6 @@ Window {
Loader { Loader {
sourceComponent: sideMenuComponent sourceComponent: sideMenuComponent
Layout.preferredWidth: item.width
Layout.fillHeight: true Layout.fillHeight: true
} }
Loader { Loader {

View file

@ -43,13 +43,25 @@ Rectangle {
} }
AppButton { RowLayout {
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
icon.color: colorPalette.selected.palette.green AppButton {
text: "Add task" icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
onClicked: { icon.color: colorPalette.selected.palette.green
root.newTask() 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 { Component {

View file

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