From 475a0abe3c5d85bc8b302dddbc5e2563a615a8f3 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 11 Mar 2022 11:21:36 -0600 Subject: [PATCH] adding some fixes to the library --- src/qml/presenter/Library.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qml/presenter/Library.qml b/src/qml/presenter/Library.qml index 8704957..9e00935 100644 --- a/src/qml/presenter/Library.qml +++ b/src/qml/presenter/Library.qml @@ -105,15 +105,17 @@ Item { header: Component { Kirigami.ActionToolBar { - height: selectedLibrary == "songs" ? 40 : 0 + height: 40 width: parent.width display: Button.IconOnly + visible: selectedLibrary == "songs" actions: [ Kirigami.Action { icon.name: "document-new" text: "New Song" tooltip: "Add a new song" onTriggered: songLibraryList.newSong() + /* visible: selectedLibrary == "songs" */ }, Kirigami.Action { @@ -125,8 +127,9 @@ Item { onAccepted: showPassiveNotification(searchField.text, 3000) } } + /* visible: selectedLibrary == "songs" */ } - ] + ] Behavior on height { NumberAnimation { @@ -269,6 +272,13 @@ Item { function newSong() { songsqlmodel.newSong(); songLibraryList.currentIndex = songsqlmodel.rowCount(); + if (!editMode) + toggleEditMode(); + song = songLibraryList.currentItem + songTitle = songLibraryList.currentItem.title + songLyrics = songLibraryList.currentItem.lyrics + songAuthor = songLibraryList.currentItem.author + songVorder = songLibraryList.currentItem.vorder showPassiveNotification("newest song index: " + songLibraryList.currentIndex) } }