adding some more library system changes

This commit is contained in:
Chris Cochrun 2022-02-15 15:31:13 -06:00
parent e6db4cd395
commit 6aab0acd27
12 changed files with 380 additions and 380 deletions

View file

@ -28,6 +28,10 @@ Kirigami.ApplicationWindow {
libraryOpen = !libraryOpen
}
Component.onCompleted: secondScreen = Qt.application.screens[1]
Component.onCompleted: {
print("checking screens")
secondScreen = Qt.application.screens[1]
print(secondScreen)
}
}

View file

@ -8,207 +8,353 @@ import "./" as Presenter
Item {
id: root
/* ColumnLayout { */
/* anchors.fill: parent */
/* spacing: 0 */
/* Rectangle { */
/* id: songLibraryPanel */
/* Layout.preferredHeight: 40 */
/* Layout.fillWidth: true */
/* color: Kirigami.Theme.backgroundColor */
property string selectedLibrary: "songs"
/* Controls.Label { */
/* anchors.centerIn: parent */
/* text: "Songs" */
/* } */
Kirigami.Theme.colorSet: Kirigami.Theme.View
/* MouseArea { */
/* anchors.fill: parent */
/* onClicked: { */
/* if (songLibraryList.state == "selected") */
/* songLibraryList.state = "deselected" */
/* else */
/* songLibraryList.state = "selected" */
/* } */
/* } */
/* } */
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
id: songLibraryPanel
Layout.preferredHeight: 40
Layout.fillWidth: true
color: Kirigami.Theme.backgroundColor
/* ListView { */
/* Layout.fillHeight: true */
/* Layout.fillWidth: true */
/* id: songLibraryList */
/* model: _songListModel */
/* delegate: itemDelegate */
Controls.Label {
anchors.centerIn: parent
text: "Songs"
}
/* Component.onCompleted: songLibraryList.state = selected */
MouseArea {
anchors.fill: parent
onClicked: {
if (selectedLibrary == "songs")
selectedLibrary = ""
else
selectedLibrary = "songs"
print(selectedLibrary)
}
}
}
/* states: [ */
/* State { */
/* name: "deselected" */
/* PropertyChanges { target: songLibraryList */
/* height: 0 */
/* Layout.fillHeight: false */
/* visible: false */
/* } */
/* }, */
/* State { */
/* name: "selected" */
/* PropertyChanges { target: songLibraryList } */
/* } */
/* ] */
ListView {
Layout.fillHeight: true
Layout.fillWidth: true
id: songLibraryList
model: _songListModel
delegate: itemDelegate
state: "selected"
/* transitions: Transition { */
/* from: "selected" */
/* to: "deselected" */
/* NumberAnimation { */
/* target: songLibraryList */
/* properties: "height" */
/* easing.type: Easing.OutCubic */
/* duration: 300 */
/* } */
/* } */
Component.onCompleted: print(selectedLibrary)
/* Component { */
/* id: itemDelegate */
/* Kirigami.BasicListItem { */
/* width: ListView.view.width */
/* height:40 */
/* label: title */
/* subtitle: author */
/* hoverEnabled: true */
/* onClicked: { */
/* ListView.view.currentIndex = index */
/* songTitle = title */
/* songLyrics = lyrics */
/* songAuthor = author */
/* showPassiveNotification(songLyrics, 3000) */
/* } */
/* } */
/* } */
states: [
State {
name: "deselected"
when: (selectedLibrary !== "songs")
PropertyChanges { target: songLibraryList
height: 0
Layout.fillHeight: false
visible: false
}
},
State {
name: "selected"
when: (selectedLibrary == "songs")
PropertyChanges { target: songLibraryList }
}
]
/* Kirigami.WheelHandler { */
/* id: wheelHandler */
/* target: songLibraryList */
/* filterMouseEvents: true */
/* keyNavigationEnabled: true */
/* } */
transitions: Transition {
to: "*"
NumberAnimation {
target: songLibraryList
properties: "height"
easing.type: Easing.OutCubic
duration: 300
}
}
/* Controls.ScrollBar.vertical: Controls.ScrollBar { */
/* anchors.right: songLibraryList.right */
/* anchors.leftMargin: 10 */
/* active: hovered || pressed */
/* } */
/* } */
Component {
id: itemDelegate
Kirigami.BasicListItem {
width: ListView.view.width
height:40
label: title
subtitle: author
hoverEnabled: true
onClicked: {
ListView.view.currentIndex = index
songTitle = title
songLyrics = lyrics
songAuthor = author
showPassiveNotification(songLyrics, 3000)
}
}
}
/* Rectangle { */
/* id: videoLibraryPanel */
/* Layout.preferredHeight: 40 */
/* Layout.fillWidth: true */
/* color: Kirigami.Theme.backgroundColor */
/* opacity: 1.0 */
Kirigami.WheelHandler {
id: wheelHandler
target: songLibraryList
filterMouseEvents: true
keyNavigationEnabled: true
}
/* Controls.Label { */
/* anchors.centerIn: parent */
/* text: "Videos" */
/* } */
Controls.ScrollBar.vertical: Controls.ScrollBar {
anchors.right: songLibraryList.right
anchors.leftMargin: 10
active: hovered || pressed
}
}
/* MouseArea { */
/* anchors.fill: parent */
/* } */
/* } */
Rectangle {
id: videoLibraryPanel
Layout.preferredHeight: 40
Layout.fillWidth: true
color: Kirigami.Theme.backgroundColor
/* ListView { */
/* id: videoLibraryList */
/* Layout.fillHeight: true */
/* Layout.fillWidth: true */
Controls.Label {
anchors.centerIn: parent
text: "Videos"
}
/* } */
/* Rectangle { */
/* id: imageLibraryPanel */
/* Layout.preferredHeight: 40 */
/* Layout.fillWidth: true */
/* color: Kirigami.Theme.backgroundColor */
MouseArea {
anchors.fill: parent
onClicked: {
if (selectedLibrary == "videos")
selectedLibrary = ""
else
selectedLibrary = "videos"
print(selectedLibrary)
}
}
}
/* Controls.Label { */
/* anchors.centerIn: parent */
/* text: "Images" */
/* } */
ListView {
id: videoLibraryList
Layout.fillHeight: true
Layout.fillWidth: true
state: "deselected"
/* MouseArea { */
/* anchors.fill: parent */
/* } */
/* } */
states: [
State {
name: "deselected"
when: (selectedLibrary !== "videos")
PropertyChanges { target: videoLibraryList
height: 0
Layout.fillHeight: false
visible: false
}
},
State {
name: "selected"
when: (selectedLibrary == "videos")
PropertyChanges { target: videoLibraryList }
}
]
/* ListView { */
/* id: imageLibraryList */
/* Layout.fillHeight: true */
/* Layout.fillWidth: true */
transitions: Transition {
to: "*"
NumberAnimation {
target: videoLibraryList
properties: "height"
easing.type: Easing.OutCubic
duration: 300
}
}
}
/* } */
/* Rectangle { */
/* id: presentationLibraryPanel */
/* Layout.preferredHeight: 40 */
/* Layout.fillWidth: true */
/* color: Kirigami.Theme.backgroundColor */
Rectangle {
id: imageLibraryPanel
Layout.preferredHeight: 40
Layout.fillWidth: true
color: Kirigami.Theme.backgroundColor
/* Controls.Label { */
/* anchors.centerIn: parent */
/* text: "Presentations" */
/* } */
Controls.Label {
anchors.centerIn: parent
text: "Images"
}
/* MouseArea { */
/* anchors.fill: parent */
/* } */
/* } */
MouseArea {
anchors.fill: parent
onClicked: {
if (selectedLibrary == "images")
selectedLibrary = ""
else
selectedLibrary = "images"
print(selectedLibrary)
}
}
}
/* ListView { */
/* id: presentationLibraryList */
/* Layout.fillHeight: true */
/* Layout.fillWidth: true */
ListView {
id: imageLibraryList
Layout.fillHeight: true
Layout.fillWidth: true
state: "deselected"
/* } */
/* Rectangle { */
/* id: slideLibraryPanel */
/* Layout.preferredHeight: 40 */
/* Layout.fillWidth: true */
/* color: Kirigami.Theme.backgroundColor */
states: [
State {
name: "deselected"
when: (selectedLibrary !== "images")
PropertyChanges { target: imageLibraryList
height: 0
Layout.fillHeight: false
visible: false
}
},
State {
name: "selected"
when: (selectedLibrary == "images")
PropertyChanges { target: imageLibraryList }
}
]
/* Controls.Label { */
/* anchors.centerIn: parent */
/* text: "Slides" */
/* } */
transitions: Transition {
to: "*"
NumberAnimation {
target: imageLibraryList
properties: "height"
easing.type: Easing.OutCubic
duration: 300
}
}
/* MouseArea { */
/* anchors.fill: parent */
/* } */
/* } */
}
Rectangle {
id: presentationLibraryPanel
Layout.preferredHeight: 40
Layout.fillWidth: true
color: Kirigami.Theme.backgroundColor
/* ListView { */
/* id: slideLibraryList */
/* Layout.fillHeight: true */
/* Layout.fillWidth: true */
Controls.Label {
anchors.centerIn: parent
text: "Presentations"
}
/* } */
MouseArea {
anchors.fill: parent
onClicked: {
if (selectedLibrary == "presentations")
selectedLibrary = ""
else
selectedLibrary = "presentations"
print(selectedLibrary)
}
}
}
ListView {
id: presentationLibraryList
Layout.fillHeight: true
Layout.fillWidth: true
state: "deselected"
states: [
State {
name: "deselected"
when: (selectedLibrary !== "presentations")
PropertyChanges { target: presentationLibraryList
height: 0
Layout.fillHeight: false
visible: false
}
},
State {
name: "selected"
when: (selectedLibrary == "presentations")
PropertyChanges { target: presentationLibraryList }
}
]
transitions: Transition {
to: "*"
NumberAnimation {
target: presentationLibraryList
properties: "height"
easing.type: Easing.OutCubic
duration: 300
}
}
}
Rectangle {
id: slideLibraryPanel
Layout.preferredHeight: 40
Layout.fillWidth: true
color: Kirigami.Theme.backgroundColor
Controls.Label {
anchors.centerIn: parent
text: "Slides"
}
MouseArea {
anchors.fill: parent
onClicked: {
if (selectedLibrary == "slides")
selectedLibrary = ""
else
selectedLibrary = "slides"
print(selectedLibrary)
}
}
}
ListView {
id: slideLibraryList
Layout.fillHeight: true
Layout.fillWidth: true
state: "deselected"
states: [
State {
name: "deselected"
when: (selectedLibrary !== "slides")
PropertyChanges { target: slideLibraryList
height: 0
Layout.fillHeight: false
visible: false
}
},
State {
name: "selected"
when: (selectedLibrary == "slides")
PropertyChanges { target: slideLibraryList }
}
]
transitions: Transition {
to: "*"
NumberAnimation {
target: slideLibraryList
properties: "height"
easing.type: Easing.OutCubic
duration: 300
}
}
}
}
/* Presenter.LibraryItem { */
/* id: songLibrary */
/* title: "Songs" */
/* model: _songListModel */
/* open: true */
/* /\* type: "song" *\/ */
/* width: parent.width */
/* anchors.top: parent.top */
/* } */
Presenter.LibraryItem {
id: songLibrary
title: "Songs"
model: _songListModel
open: true
/* type: "song" */
/* Layout.fillHeight: true */
Layout.fillWidth: true
/* Layout.preferredHeight: parent.height */
}
Presenter.LibraryItem {
id: ssongLibrary
title: "Songs"
model: _songListModel
open: false
/* type: "song" */
}
/* Presenter.LibraryItem { */
/* id: ssongLibrary */
/* title: "Songs" */
/* model: _songListModel */
/* open: false */
/* width: parent.width */
/* /\* type: "song" *\/ */
/* anchors.top: songLibrary.bottom */
/* } */
}

View file

@ -1,4 +1,3 @@
import QtQuick 2.13
import QtQuick.Dialogs 1.0
import QtQuick.Controls 2.0 as Controls

View file

@ -11,8 +11,7 @@ import "./" as Presenter
Controls.Page {
id: mainPage
padding: 0
property url videoBackground: ""
property url imageBackground: ""
property url background: ""
property string songTitle: ""
property string songLyrics: ""
property string songAuthor: ""
@ -93,10 +92,13 @@ Controls.Page {
nameFilters: ["Video files (*.mp4 *.mkv *.mov *.wmv *.avi *.MP4 *.MOV *.MKV)",
"Image files (*.jpg *.jpeg *.png *.JPG *.JPEG *.PNG)"]
onAccepted: {
print("You chose: " + fileDialog.fileUrls)
background = fileDialog.fileUrls
print("You chose: " + fileDialog.fileUrls);
videoBackground = fileDialog.fileUrl;
print(videoBackground);
str = videoBackground.toString();
if (str.endsWith("mp4"))
videoBackground = fileDialog.fileUrl; print("WE DID IT!!");
}
onRejected: {
@ -106,4 +108,8 @@ Controls.Page {
}
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
}

View file

@ -0,0 +1,18 @@
import QtQuick 2.13
import QtQuick.Dialogs 1.0
import QtQuick.Controls 2.15 as Controls
import QtQuick.Window 2.13
import QtQuick.Layouts 1.2
import QtMultimedia 5.15
import QtAudioEngine 1.15
import org.kde.kirigami 2.13 as Kirigami
import "./" as Presenter
Item {
id: root
Presenter.Slide {
id: representation
}
}

View file

@ -106,14 +106,13 @@ Item {
text: songLyrics
textFormat: TextEdit.MarkdownText
padding: 10
onEditingFinished: showPassiveNotification("updated...", 2000)
onEditingFinished: editorTimer.running = false
onPressed: editorTimer.running = true
}
}
Rectangle {
Presenter.SlideEditor {
id: slideEditor
color: "red"
Layout.preferredHeight: 800
Layout.fillWidth: true
Layout.fillHeight: true
@ -138,7 +137,7 @@ Item {
Timer {
id: editorTimer
interval: 1000
interval: 2000
repeat: true
running: false
onTriggered: showPassiveNotification("updating song...")

View file

@ -13,6 +13,7 @@
<file>qml/presenter/PanelItem.qml</file>
<file>qml/presenter/SongEditor.qml</file>
<file>qml/presenter/Slide.qml</file>
<file>qml/presenter/SlideEditor.qml</file>
<file>assets/parallel.jpg</file>
</qresource>
</RCC>