diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e717ce..f7c9abe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/images/not-visible.png b/src/images/not-visible.png new file mode 100644 index 0000000..02386ad Binary files /dev/null and b/src/images/not-visible.png differ diff --git a/src/images/visible.png b/src/images/visible.png new file mode 100644 index 0000000..a5190e3 Binary files /dev/null and b/src/images/visible.png differ diff --git a/src/qml/Main.qml b/src/qml/Main.qml index 006cd13..8be973e 100644 --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -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 { diff --git a/src/qml/MainPanel.qml b/src/qml/MainPanel.qml index 7c8f2d9..896a2f4 100644 --- a/src/qml/MainPanel.qml +++ b/src/qml/MainPanel.qml @@ -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 { diff --git a/src/qml/SideMenu.qml b/src/qml/SideMenu.qml index 8f585a6..20b95a3 100644 --- a/src/qml/SideMenu.qml +++ b/src/qml/SideMenu.qml @@ -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