Setting slide changes on changing service item

This commit is contained in:
Chris Cochrun 2022-03-04 16:50:01 -06:00
parent 3e646d8728
commit 4c84fdc614
9 changed files with 53 additions and 24 deletions

View file

@ -1,2 +1,6 @@
;;; Directory Local Variables ;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables") ;;; For more information see (info "(emacs) Directory Variables")
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((nil . ((compile-command . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/"))))

View file

@ -13,9 +13,12 @@ Kirigami.ApplicationWindow {
property bool libraryOpen: true property bool libraryOpen: true
property bool presenting: false property bool presenting: false
property bool presentMode: true
property var screens property var screens
property bool editMode: false
signal edit()
pageStack.initialPage: mainPage pageStack.initialPage: mainPage
header: Presenter.Header {} header: Presenter.Header {}
width: 1800 width: 1800
@ -25,6 +28,11 @@ Kirigami.ApplicationWindow {
id: mainPage id: mainPage
} }
function toggleEditMode() {
editMode = !editMode;
mainPage.editSwitch(editMode);
}
function toggleLibrary() { function toggleLibrary() {
libraryOpen = !libraryOpen libraryOpen = !libraryOpen
} }

View file

@ -30,9 +30,9 @@ Kirigami.ActionToolBar {
}, },
Kirigami.Action { Kirigami.Action {
icon.name: "edit" icon.name: editMode ? "view-preview" : "edit"
text: presentMode ? "Edit" : "Preview" text: editMode ? "Preview" : "Edit"
onTriggered: presentMode = !presentMode onTriggered: toggleEditMode()
}, },
Kirigami.Action { Kirigami.Action {

View file

@ -107,6 +107,7 @@ ColumnLayout {
onClicked: { onClicked: {
serviceItemList.currentIndex = index; serviceItemList.currentIndex = index;
showPassiveNotification(serviceItemList.currentIndex); showPassiveNotification(serviceItemList.currentIndex);
changeSlideText(text);
} }
} }
@ -140,10 +141,12 @@ ColumnLayout {
ListElement { ListElement {
name: "10,000 Reason" name: "10,000 Reason"
type: "song" type: "song"
text: "YIP YIP!"
} }
ListElement { ListElement {
name: "Marvelous Light" name: "Marvelous Light"
type: "song" type: "song"
text: "YIP YIP!"
} }
ListElement { ListElement {
name: "10,000 Reason" name: "10,000 Reason"

View file

@ -31,7 +31,7 @@ Controls.Page {
signal songLyricsUpdated(string lyrics) signal songLyricsUpdated(string lyrics)
Component.onCompleted: { Component.onCompleted: {
mainPage.songLyricsUpdated.connect(library.updateSongLyrics) mainPage.songLyricsUpdated.connect(library.updateSongLyrics);
} }
Item { Item {
@ -64,8 +64,7 @@ Controls.Page {
Controls.SplitView.fillWidth: true Controls.SplitView.fillWidth: true
Controls.SplitView.preferredWidth: 700 Controls.SplitView.preferredWidth: 700
Controls.SplitView.minimumWidth: 500 Controls.SplitView.minimumWidth: 500
initialItem: presenterComp initialItem: Presenter.Presentation { id: presentation }
} }
Presenter.Library { Presenter.Library {
@ -85,14 +84,6 @@ Controls.Page {
} }
} }
Component {
id: presenterComp
Presenter.Presentation {
id: presentation
}
}
Loader { Loader {
id: presentLoader id: presentLoader
active: presenting active: presenting
@ -106,13 +97,15 @@ Controls.Page {
Component.onCompleted: { Component.onCompleted: {
presentationWindow.showFullScreen(); presentationWindow.showFullScreen();
print(Qt.application.screens[1]) print(screens[1].name)
} }
Presenter.Slide { Presenter.Slide {
id: presentationSlide id: presentationSlide
anchors.fill: parent
imageSource: imageBackground imageSource: imageBackground
videoSource: videoBackground videoSource: videoBackground
text: "good"
Component.onCompleted: slideItem = presentationSlide Component.onCompleted: slideItem = presentationSlide
} }
@ -158,6 +151,21 @@ Controls.Page {
id: songsqlmodel id: songsqlmodel
} }
function changeSlideText(text) {
showPassiveNotification("used to be: " + presentation.text);
presentation.text = text;
showPassiveNotification("next");
presentationSlide.text = text;
showPassiveNotification("last");
}
function editSwitch(edit) {
if (edit)
mainPageArea.push(songEditorComp, Controls.StackView.Immediate)
else
mainPageArea.pop(Controls.StackView.Immediate)
}
function updateLyrics(lyrics) { function updateLyrics(lyrics) {
songsqlmodel.updateLyrics(song, lyrics); songsqlmodel.updateLyrics(song, lyrics);
} }

View file

@ -10,6 +10,8 @@ import "./" as Presenter
Item { Item {
id: root id: root
property string text: "GOOD"
GridLayout { GridLayout {
anchors.fill: parent anchors.fill: parent
columns: 3 columns: 3
@ -61,9 +63,11 @@ Item {
} }
Presenter.Slide { Presenter.Slide {
Layout.preferredWidth: 700 Layout.preferredWidth: 900
Layout.preferredHeight: 500 Layout.preferredHeight: width / 16 * 9
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
textSize: width / 15
text: root.text
} }
Kirigami.Icon { Kirigami.Icon {

View file

@ -20,6 +20,7 @@ Item {
property url imageSource: imageBackground property url imageSource: imageBackground
property url videoSource: videoBackground property url videoSource: videoBackground
property string chosenFont: "Quicksand" property string chosenFont: "Quicksand"
property string text: "This is demo text"
property color backgroundColor property color backgroundColor
// These properties help to determine the state of the slide // These properties help to determine the state of the slide
@ -82,9 +83,9 @@ Item {
Controls.Label { Controls.Label {
id: lyrics id: lyrics
text: "This is some test lyrics" // change to song lyrics of current verse text: root.text
font.pointSize: textSize font.pixelSize: textSize
minimumPointSize: 5 /* minimumPointSize: 5 */
fontSizeMode: Text.Fit fontSizeMode: Text.Fit
font.family: chosenFont font.family: chosenFont
style: Text.Raised style: Text.Raised

View file

@ -13,7 +13,8 @@ Item {
Presenter.Slide { Presenter.Slide {
id: representation id: representation
textSize: 48 anchors.fill: parent
textSize: width / 15
editMode: true editMode: true
} }
} }

View file

@ -185,7 +185,7 @@ Item {
} }
ColumnLayout { ColumnLayout {
Controls.SplitView.fillHeight: true Controls.SplitView.fillHeight: true
Controls.SplitView.preferredWidth: 500 Controls.SplitView.preferredWidth: 700
Controls.SplitView.minimumWidth: 300 Controls.SplitView.minimumWidth: 300
Rectangle { Rectangle {