diff --git a/.dir-locals.el b/.dir-locals.el index 6f98fdc..2a03574 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,2 +1,6 @@ ;;; Directory Local 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/")))) diff --git a/src/qml/main.qml b/src/qml/main.qml index 0d2225e..7eceb9c 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -13,9 +13,12 @@ Kirigami.ApplicationWindow { property bool libraryOpen: true property bool presenting: false - property bool presentMode: true property var screens - + + property bool editMode: false + + signal edit() + pageStack.initialPage: mainPage header: Presenter.Header {} width: 1800 @@ -25,6 +28,11 @@ Kirigami.ApplicationWindow { id: mainPage } + function toggleEditMode() { + editMode = !editMode; + mainPage.editSwitch(editMode); + } + function toggleLibrary() { libraryOpen = !libraryOpen } diff --git a/src/qml/presenter/Header.qml b/src/qml/presenter/Header.qml index f90bce2..e940c64 100644 --- a/src/qml/presenter/Header.qml +++ b/src/qml/presenter/Header.qml @@ -30,9 +30,9 @@ Kirigami.ActionToolBar { }, Kirigami.Action { - icon.name: "edit" - text: presentMode ? "Edit" : "Preview" - onTriggered: presentMode = !presentMode + icon.name: editMode ? "view-preview" : "edit" + text: editMode ? "Preview" : "Edit" + onTriggered: toggleEditMode() }, Kirigami.Action { diff --git a/src/qml/presenter/LeftDock.qml b/src/qml/presenter/LeftDock.qml index b48a9bd..50f0365 100644 --- a/src/qml/presenter/LeftDock.qml +++ b/src/qml/presenter/LeftDock.qml @@ -107,6 +107,7 @@ ColumnLayout { onClicked: { serviceItemList.currentIndex = index; showPassiveNotification(serviceItemList.currentIndex); + changeSlideText(text); } } @@ -140,10 +141,12 @@ ColumnLayout { ListElement { name: "10,000 Reason" type: "song" + text: "YIP YIP!" } ListElement { name: "Marvelous Light" type: "song" + text: "YIP YIP!" } ListElement { name: "10,000 Reason" diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index cdf8f27..72a10f5 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -31,7 +31,7 @@ Controls.Page { signal songLyricsUpdated(string lyrics) Component.onCompleted: { - mainPage.songLyricsUpdated.connect(library.updateSongLyrics) + mainPage.songLyricsUpdated.connect(library.updateSongLyrics); } Item { @@ -64,8 +64,7 @@ Controls.Page { Controls.SplitView.fillWidth: true Controls.SplitView.preferredWidth: 700 Controls.SplitView.minimumWidth: 500 - initialItem: presenterComp - + initialItem: Presenter.Presentation { id: presentation } } Presenter.Library { @@ -85,14 +84,6 @@ Controls.Page { } } - Component { - id: presenterComp - Presenter.Presentation { - id: presentation - } - } - - Loader { id: presentLoader active: presenting @@ -106,13 +97,15 @@ Controls.Page { Component.onCompleted: { presentationWindow.showFullScreen(); - print(Qt.application.screens[1]) + print(screens[1].name) } Presenter.Slide { id: presentationSlide + anchors.fill: parent imageSource: imageBackground videoSource: videoBackground + text: "good" Component.onCompleted: slideItem = presentationSlide } @@ -158,6 +151,21 @@ Controls.Page { 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) { songsqlmodel.updateLyrics(song, lyrics); } diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index 56711e2..b1eae3f 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -10,6 +10,8 @@ import "./" as Presenter Item { id: root + property string text: "GOOD" + GridLayout { anchors.fill: parent columns: 3 @@ -61,9 +63,11 @@ Item { } Presenter.Slide { - Layout.preferredWidth: 700 - Layout.preferredHeight: 500 + Layout.preferredWidth: 900 + Layout.preferredHeight: width / 16 * 9 Layout.alignment: Qt.AlignCenter + textSize: width / 15 + text: root.text } Kirigami.Icon { diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index ca79bbb..b2ddd76 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -20,6 +20,7 @@ Item { property url imageSource: imageBackground property url videoSource: videoBackground property string chosenFont: "Quicksand" + property string text: "This is demo text" property color backgroundColor // These properties help to determine the state of the slide @@ -82,9 +83,9 @@ Item { Controls.Label { id: lyrics - text: "This is some test lyrics" // change to song lyrics of current verse - font.pointSize: textSize - minimumPointSize: 5 + text: root.text + font.pixelSize: textSize + /* minimumPointSize: 5 */ fontSizeMode: Text.Fit font.family: chosenFont style: Text.Raised diff --git a/src/qml/presenter/SlideEditor.qml b/src/qml/presenter/SlideEditor.qml index a044d91..23c45ee 100644 --- a/src/qml/presenter/SlideEditor.qml +++ b/src/qml/presenter/SlideEditor.qml @@ -13,7 +13,8 @@ Item { Presenter.Slide { id: representation - textSize: 48 + anchors.fill: parent + textSize: width / 15 editMode: true } } diff --git a/src/qml/presenter/SongEditor.qml b/src/qml/presenter/SongEditor.qml index 20c8aa0..bd8d403 100644 --- a/src/qml/presenter/SongEditor.qml +++ b/src/qml/presenter/SongEditor.qml @@ -185,7 +185,7 @@ Item { } ColumnLayout { Controls.SplitView.fillHeight: true - Controls.SplitView.preferredWidth: 500 + Controls.SplitView.preferredWidth: 700 Controls.SplitView.minimumWidth: 300 Rectangle {