From 1566a282dcad5f5405f4e3d5ac6ecdd431513007 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 13 Jul 2021 15:16:09 +0200 Subject: [PATCH] Replace text and image if there's no projects due to search It's a bit weird if it shows that you didn't add any projects yet if you just type in a gibberish search keyword. Contributes to issue CURA-8009. --- .../resources/images/projects_not_found.svg | 62 +++++++++++++++++++ .../resources/qml/SelectProjectPage.qml | 5 +- 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 plugins/DigitalLibrary/resources/images/projects_not_found.svg diff --git a/plugins/DigitalLibrary/resources/images/projects_not_found.svg b/plugins/DigitalLibrary/resources/images/projects_not_found.svg new file mode 100644 index 0000000000..8aee7b797c --- /dev/null +++ b/plugins/DigitalLibrary/resources/images/projects_not_found.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index 08bf8aec7c..3f1799b9ae 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -93,7 +93,7 @@ Item { id: digitalFactoryImage anchors.horizontalCenter: parent.horizontalCenter - source: "../images/digital_factory.svg" + source: searchBar.text === "" ? "../images/digital_factory.svg" : "../images/projects_not_found.svg" fillMode: Image.PreserveAspectFit width: parent.width - 2 * UM.Theme.getSize("thick_margin").width sourceSize.width: width @@ -104,7 +104,7 @@ Item { id: noLibraryProjectsLabel anchors.horizontalCenter: parent.horizontalCenter - text: "It appears that you don't have any projects in the Library yet." + text: searchBar.text === "" ? "It appears that you don't have any projects in the Library yet." : "No projects found that match the search query." font: UM.Theme.getFont("medium") } @@ -114,6 +114,7 @@ Item anchors.horizontalCenter: parent.horizontalCenter text: "Visit Digital Library" onClicked: Qt.openUrlExternally(CuraApplication.ultimakerDigitalFactoryUrl + "/app/library") + visible: searchBar.text === "" //Show the link to Digital Library when there are no projects in the user's Library. } } }