Working move, and insert, added some changing of slides functionality
This commit is contained in:
parent
105c958810
commit
9b6949090e
6 changed files with 73 additions and 51 deletions
|
@ -111,10 +111,7 @@ ColumnLayout {
|
|||
onMoveRequested: serviceItemModel.move(oldIndex, newIndex)
|
||||
onClicked: {
|
||||
serviceItemList.currentIndex = index;
|
||||
/* showPassiveNotification(serviceItemList.currentIndex); */
|
||||
changeSlideBackground(background, backgroundType);
|
||||
changeSlideText(text);
|
||||
changeSlideType(type);
|
||||
changeServiceItem(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,9 +122,9 @@ ColumnLayout {
|
|||
addItem(index,
|
||||
dragItemTitle,
|
||||
dragItemType,
|
||||
dragItemText,
|
||||
dragItemBackgroundType,
|
||||
dragItemBackground,
|
||||
dragItemBackgroundType,
|
||||
dragItemText,
|
||||
dragItemIndex);
|
||||
}
|
||||
keys: ["library"]
|
||||
|
@ -152,9 +149,10 @@ ColumnLayout {
|
|||
|
||||
function addItem(index, name, type,
|
||||
background, backgroundType, text, itemID) {
|
||||
const newtext = songsqlmodel.getLyricList(itemID);
|
||||
serviceItemModel.insertItem(index, name,
|
||||
type, text, background,
|
||||
backgroundType)
|
||||
type, background,
|
||||
backgroundType, newtext);
|
||||
}
|
||||
|
||||
function appendItem(name, type, background, backgroundType, text, itemID) {
|
||||
|
|
|
@ -133,48 +133,29 @@ Controls.Page {
|
|||
id: serviceItemModel
|
||||
}
|
||||
|
||||
function changeSlideType(type) {
|
||||
presentation.itemType = type;
|
||||
if (slideItem)
|
||||
slideItem.itemType = type;
|
||||
}
|
||||
function changeServiceItem(index) {
|
||||
const item = serviceItemModel.getItem(index);
|
||||
|
||||
function changeSlideText(text) {
|
||||
presentation.text = text;
|
||||
if (slideItem)
|
||||
slideItem.text = text;
|
||||
}
|
||||
|
||||
function changeSlideBackground(background, type) {
|
||||
showPassiveNotification("starting background change..");
|
||||
showPassiveNotification(background);
|
||||
showPassiveNotification(type);
|
||||
if (type == "image") {
|
||||
presentation.itemType = item.type;
|
||||
|
||||
if (item.backgroundType === "image") {
|
||||
presentation.vidbackground = "";
|
||||
presentation.imagebackground = background;
|
||||
if (slideItem) {
|
||||
slideItem.videoSource = "";
|
||||
slideItem.stopVideo();
|
||||
slideItem.imageSource = background;
|
||||
}
|
||||
presentation.imagebackground = item.background;
|
||||
} else {
|
||||
presentation.imagebackground = "";
|
||||
presentation.vidbackground = background;
|
||||
presentation.vidbackground = item.background;
|
||||
presentation.loadVideo()
|
||||
if (slideItem) {
|
||||
slideItem.imageSource = "";
|
||||
slideItem.videoSource = background;
|
||||
slideItem.loadVideo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeSlideNext() {
|
||||
showPassiveNotification("next slide please")
|
||||
}
|
||||
if (item.text.length === 0) {
|
||||
presentation.text = [""];
|
||||
}
|
||||
else
|
||||
presentation.text = item.text;
|
||||
presentation.textIndex = 0;
|
||||
presentation.nextSlideText();
|
||||
|
||||
function changeSlidePrevious() {
|
||||
showPassiveNotification("previous slide please")
|
||||
print("Slide changed to: " + item.name);
|
||||
}
|
||||
|
||||
function editSwitch(item) {
|
||||
|
|
|
@ -10,11 +10,14 @@ import "./" as Presenter
|
|||
Item {
|
||||
id: root
|
||||
|
||||
property string text
|
||||
property var text
|
||||
property int textIndex: 0
|
||||
property string itemType
|
||||
property url imagebackground
|
||||
property url vidbackground
|
||||
|
||||
Component.onCompleted: nextSlideText()
|
||||
|
||||
GridLayout {
|
||||
anchors.fill: parent
|
||||
columns: 3
|
||||
|
@ -81,7 +84,6 @@ Item {
|
|||
Layout.minimumWidth: 300
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
textSize: width / 15
|
||||
text: root.text
|
||||
itemType: root.itemType
|
||||
imageSource: imagebackground
|
||||
videoSource: vidbackground
|
||||
|
@ -95,7 +97,7 @@ Item {
|
|||
Layout.alignment: Qt.AlignLeft
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: changeSlideNext()
|
||||
onPressed: nextSlideText()
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
}
|
||||
|
@ -112,4 +114,24 @@ Item {
|
|||
function loadVideo() {
|
||||
previewSlide.loadVideo();
|
||||
}
|
||||
|
||||
function nextSlideText() {
|
||||
if (textIndex === 0) {
|
||||
previewSlide.text = root.text[textIndex];
|
||||
print(root.text[textIndex]);
|
||||
textIndex++;
|
||||
} else if (textIndex < root.text.length) {
|
||||
previewSlide.text = root.text[textIndex];
|
||||
print(root.text[textIndex]);
|
||||
textIndex++;
|
||||
} else {
|
||||
print("Next slide time");
|
||||
nextSlide();
|
||||
textIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function nextSlide() {
|
||||
print(slideItem);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,13 +15,15 @@ Item {
|
|||
property bool editMode: false
|
||||
|
||||
// These properties are for the slides visuals
|
||||
property real textSize: 72
|
||||
property real textSize: 50
|
||||
property bool dropShadow: false
|
||||
property url imageSource: imageBackground
|
||||
property url videoSource: videoBackground
|
||||
property string chosenFont: "Quicksand"
|
||||
property string text: "This is demo text"
|
||||
property var text: "This is demo text"
|
||||
property color backgroundColor
|
||||
property var horizontalAlignment
|
||||
property var verticalAlignment
|
||||
|
||||
//these properties are for giving video info to parents
|
||||
property int mpvPosition: mpv.position
|
||||
|
@ -97,9 +99,10 @@ Item {
|
|||
/* minimumPointSize: 5 */
|
||||
fontSizeMode: Text.Fit
|
||||
font.family: chosenFont
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
style: Text.Raised
|
||||
anchors.centerIn: parent
|
||||
/* width: parent.width */
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
|
||||
layer.enabled: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue