From 617721948261f170fc3f2edbe1b21c2f9d7b3e9a Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 12 Apr 2024 07:22:59 -0500 Subject: [PATCH] fixing the spinner to always be the right size --- src/qml/presenter/LoadingSpinner.qml | 8 +++----- src/qml/presenter/PreviewSlide.qml | 3 ++- src/qml/presenter/ServiceList.qml | 5 +++-- src/rust/file_helper.rs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qml/presenter/LoadingSpinner.qml b/src/qml/presenter/LoadingSpinner.qml index a351fc5..2e4b13c 100644 --- a/src/qml/presenter/LoadingSpinner.qml +++ b/src/qml/presenter/LoadingSpinner.qml @@ -11,15 +11,13 @@ Controls.BusyIndicator { visible: root.running contentItem: Item { - implicitWidth: 64 - implicitHeight: 64 + anchors.fill: parent Item { id: item x: parent.width / 2 - 32 y: parent.height / 2 - 32 - width: 64 - height: 64 + anchors.fill: parent opacity: root.running ? 1 : 0 Behavior on opacity { @@ -47,7 +45,7 @@ Controls.BusyIndicator { property: "width" running: root.running from: 0 - (index * 100) - to: root.width * 1.8 + to: Kirigami.Units.gridUnit * 5 loops: Animation.Infinite duration: 1400 easing.type: Easing.InSine diff --git a/src/qml/presenter/PreviewSlide.qml b/src/qml/presenter/PreviewSlide.qml index 750e2f0..d7f7dbd 100644 --- a/src/qml/presenter/PreviewSlide.qml +++ b/src/qml/presenter/PreviewSlide.qml @@ -6,6 +6,7 @@ import QtMultimedia 5.15 import QtGraphicalEffects 1.15 import org.kde.kirigami 2.13 as Kirigami import "./" as Presenter +import org.presenter 1.0 Item { id: root @@ -45,7 +46,7 @@ Item { Presenter.LoadingSpinner { id: loadingSpinner color: Kirigami.Theme.highlightColor - running: itemType === "video" && imageSource.length() < 1 + running: !fileHelper.validate(imageSource) anchors.fill: parent } diff --git a/src/qml/presenter/ServiceList.qml b/src/qml/presenter/ServiceList.qml index 6337894..114786a 100644 --- a/src/qml/presenter/ServiceList.qml +++ b/src/qml/presenter/ServiceList.qml @@ -461,9 +461,10 @@ Item { color: Kirigami.Theme.backgroundColor visible: false - Controls.BusyIndicator { + Presenter.LoadingSpinner { anchors.centerIn: parent - running: true + running: parent.visible + color: Kirigami.Theme.highlightColor } } } diff --git a/src/rust/file_helper.rs b/src/rust/file_helper.rs index 71bf539..b89d369 100644 --- a/src/rust/file_helper.rs +++ b/src/rust/file_helper.rs @@ -68,12 +68,12 @@ impl file_helper::FileHelper { match file_string { Some(file) => { let exists = Path::new(&file).exists(); - println!("{file} exists? {exists}"); + debug!(file, exists); exists } None => { let exists = Path::new(&file.to_string()).exists(); - println!("{file} exists? {exists}"); + debug!(?file, exists); exists } }