Added readme and cleaned up some ui pieces
This commit is contained in:
parent
6e9e1eca0d
commit
42e772591c
9 changed files with 74 additions and 53 deletions
|
@ -25,4 +25,5 @@ Kirigami.ApplicationWindow {
|
|||
function toggleLibrary() {
|
||||
libraryOpen = !libraryOpen
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,19 +22,13 @@ Kirigami.ActionToolBar {
|
|||
displayComponent: Component {
|
||||
Kirigami.SearchField {
|
||||
id: searchField
|
||||
anchors.centerIn: parent
|
||||
width: parent.width / 3
|
||||
onAccepted: showPassiveNotification(searchField.text, 3000)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Kirigami.Action {
|
||||
icon.name: "fileopen"
|
||||
text: "VideoBG"
|
||||
onTriggered: {
|
||||
print("Action button in buttons page clicked");
|
||||
fileDialog.open()
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "view-presentation"
|
||||
text: "Go Live"
|
||||
|
|
|
@ -25,8 +25,12 @@ Item {
|
|||
label: title
|
||||
subtitle: author
|
||||
hoverEnabled: true
|
||||
onClicked: ListView.view.currentIndex = index
|
||||
|
||||
onClicked: {
|
||||
ListView.view.currentIndex = index
|
||||
songTitle = title
|
||||
songLyrics = lyrics
|
||||
showPassiveNotification(songLyrics, 3000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ import "./" as Presenter
|
|||
Controls.Page {
|
||||
id: mainPage
|
||||
padding: 0
|
||||
property var video: null
|
||||
property url videoBackground: ""
|
||||
property url imageBackground: ""
|
||||
property string songTitle: ""
|
||||
property string songLyrics: ""
|
||||
|
||||
Item {
|
||||
id: mainItem
|
||||
|
@ -57,23 +60,6 @@ Controls.Page {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: "Please choose a video"
|
||||
folder: shortcuts.home
|
||||
selectMultiple: false
|
||||
onAccepted: {
|
||||
print("You chose: " + fileDialog.fileUrls)
|
||||
video = fileDialog.fileUrl
|
||||
}
|
||||
onRejected: {
|
||||
print("Canceled")
|
||||
/* Qt.quit() */
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: presentLoader
|
||||
active: presenting
|
||||
|
@ -93,4 +79,22 @@ Controls.Page {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: "Please choose a video"
|
||||
folder: shortcuts.home
|
||||
selectMultiple: false
|
||||
onAccepted: {
|
||||
print("You chose: " + fileDialog.fileUrls)
|
||||
background = fileDialog.fileUrls
|
||||
|
||||
|
||||
|
||||
}
|
||||
onRejected: {
|
||||
print("Canceled")
|
||||
/* Qt.quit() */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,11 @@ Item {
|
|||
}
|
||||
Controls.ToolButton {
|
||||
text: "Background"
|
||||
icon.name: "fileopen"
|
||||
onClicked: {
|
||||
print("Action button in buttons page clicked");
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +62,8 @@ Item {
|
|||
Controls.TextField {
|
||||
implicitWidth: 300
|
||||
Layout.leftMargin: 20
|
||||
placeholderText: "Song Title..."
|
||||
text: songTitle
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
@ -72,6 +79,9 @@ Item {
|
|||
Layout.bottomMargin: 30
|
||||
Layout.leftMargin: 20
|
||||
placeholderText: "Put lyrics here..."
|
||||
persistentSelection: true
|
||||
text: songLyrics
|
||||
textFormat: TextEdit.MarkdownText
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
@ -82,5 +92,4 @@ Item {
|
|||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,14 +10,9 @@ SongListModel::SongListModel(QObject *parent)
|
|||
|
||||
int SongListModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
// For list models only the root node (an invalid parent) should return the list's size. For all
|
||||
// other (valid) parents, rowCount() should return 0 so that it does not become a tree model.
|
||||
if (parent.isValid())
|
||||
return 0;
|
||||
|
||||
// FIXME: Implement me!
|
||||
return m_data.count();
|
||||
|
||||
}
|
||||
|
||||
QVariant SongListModel::data(const QModelIndex &index, int role) const
|
||||
|
@ -25,7 +20,7 @@ QVariant SongListModel::data(const QModelIndex &index, int role) const
|
|||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
// FIXME: Implement me!
|
||||
// this is the returning of song data
|
||||
const Data &data = m_data.at(index.row());
|
||||
if ( role == TitleRole )
|
||||
return data.title;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue