small changes and the beginning of a TextBackground.qml
This commit is contained in:
parent
9f4d426a8f
commit
7e6e8c71e0
4 changed files with 31 additions and 6 deletions
|
@ -120,7 +120,7 @@ Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
text: "Image"
|
text: "Image"
|
||||||
icon.name: "folder-pictures-symbolic"
|
icon.name: "folder-pictures-symbolic"
|
||||||
onClicked: imageFileDialog.open() & backgroundTypePopup.close()
|
onClicked: updateBackground("image") & backgroundTypePopup.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -499,10 +499,11 @@ Item {
|
||||||
songProxyModel.songModel.updateAudio(songIndex, file);
|
songProxyModel.songModel.updateAudio(songIndex, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateBackground(background, backgroundType) {
|
function updateBackground(backgroundType) {
|
||||||
song.backgroundType = backgroundType;
|
song.backgroundType = backgroundType;
|
||||||
song.background = background;
|
const file = fileHelper.loadFile("Pick Background");
|
||||||
songProxyModel.songModel.updateBackground(songIndex, background);
|
song.background = file;
|
||||||
|
songProxyModel.songModel.updateBackground(songIndex, file);
|
||||||
songProxyModel.songModel.updateBackgroundType(songIndex, backgroundType);
|
songProxyModel.songModel.updateBackgroundType(songIndex, backgroundType);
|
||||||
console.log("changed background");
|
console.log("changed background");
|
||||||
/* if (backgroundType === "image") { */
|
/* if (backgroundType === "image") { */
|
||||||
|
|
20
src/qml/presenter/TextBackground.qml
Normal file
20
src/qml/presenter/TextBackground.qml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import QtQuick 2.13
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
// Used for
|
||||||
|
property var control
|
||||||
|
property bool errorCondition
|
||||||
|
|
||||||
|
color: Kirigami.Theme.backgroundColor
|
||||||
|
implicitWidth: parent.width
|
||||||
|
implicitHeight: parent.height
|
||||||
|
radius: 10
|
||||||
|
border.color: {
|
||||||
|
if (control.enabled)
|
||||||
|
return Kirigami.Theme.highlightColor
|
||||||
|
else if (errorCondition)
|
||||||
|
return Kirigami.Theme.negativeTextColor
|
||||||
|
else
|
||||||
|
return Kirigami.Theme.positiveColor
|
||||||
|
}
|
||||||
|
}
|
|
@ -535,7 +535,11 @@ pub mod song_model {
|
||||||
{
|
{
|
||||||
song.background =
|
song.background =
|
||||||
updated_background.to_string();
|
updated_background.to_string();
|
||||||
println!("change: updated_background: {:?} model_index: {:?} roles: {:?}", updated_background, model_index, vector_roles.get(0));
|
debug!(
|
||||||
|
background = updated_background,
|
||||||
|
model_index = model_index,
|
||||||
|
roles = vector_roles.get(0)
|
||||||
|
);
|
||||||
self.as_mut().emit_data_changed(
|
self.as_mut().emit_data_changed(
|
||||||
model_index,
|
model_index,
|
||||||
model_index,
|
model_index,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue