validation for presentation files

This commit is contained in:
Chris Cochrun 2023-02-17 17:21:34 -06:00
parent c9f6fc4d1b
commit f1ea742453

View file

@ -1080,6 +1080,7 @@ Item {
id: presListItem id: presListItem
property bool rightMenu: false property bool rightMenu: false
property bool fileValidation: fileHelper.validate(filePath)
implicitWidth: presentationLibraryList.width implicitWidth: presentationLibraryList.width
height: selectedLibrary == "presentations" ? 50 : 0 height: selectedLibrary == "presentations" ? 50 : 0
@ -1087,7 +1088,12 @@ Item {
label: title label: title
icon: "x-office-presentation-symbolic" icon: "x-office-presentation-symbolic"
iconSize: Kirigami.Units.gridUnit iconSize: Kirigami.Units.gridUnit
/* subtitle: author */ subtitle: {
if (fileValidation)
filePath;
else
"file is missing"
}
supportsMouseEvents: false supportsMouseEvents: false
backgroundColor: { backgroundColor: {
if (parent.ListView.isCurrentItem) { if (parent.ListView.isCurrentItem) {
@ -1099,10 +1105,14 @@ Item {
} }
} }
textColor: { textColor: {
if (parent.ListView.isCurrentItem || presDragHandler.containsMouse) if (fileValidation) {
activeTextColor; if (parent.ListView.isCurrentItem || presDragHandler.containsMouse)
activeTextColor;
else
Kirigami.Theme.textColor;
}
else else
Kirigami.Theme.textColor; "red"
} }
Behavior on height { Behavior on height {