From f1ea742453bb80e5ecb8eeb7b8b4edb7932d2173 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 17 Feb 2023 17:21:34 -0600 Subject: [PATCH] validation for presentation files --- src/qml/presenter/Library.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/qml/presenter/Library.qml b/src/qml/presenter/Library.qml index 2ba723f..aaa85d1 100644 --- a/src/qml/presenter/Library.qml +++ b/src/qml/presenter/Library.qml @@ -1080,6 +1080,7 @@ Item { id: presListItem property bool rightMenu: false + property bool fileValidation: fileHelper.validate(filePath) implicitWidth: presentationLibraryList.width height: selectedLibrary == "presentations" ? 50 : 0 @@ -1087,7 +1088,12 @@ Item { label: title icon: "x-office-presentation-symbolic" iconSize: Kirigami.Units.gridUnit - /* subtitle: author */ + subtitle: { + if (fileValidation) + filePath; + else + "file is missing" + } supportsMouseEvents: false backgroundColor: { if (parent.ListView.isCurrentItem) { @@ -1099,10 +1105,14 @@ Item { } } textColor: { - if (parent.ListView.isCurrentItem || presDragHandler.containsMouse) - activeTextColor; + if (fileValidation) { + if (parent.ListView.isCurrentItem || presDragHandler.containsMouse) + activeTextColor; + else + Kirigami.Theme.textColor; + } else - Kirigami.Theme.textColor; + "red" } Behavior on height {