fixing the spinner to always be the right size
This commit is contained in:
parent
402bc08d52
commit
6177219482
4 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue