Commit cadd0ddd authored by Camilo Higuita's avatar Camilo Higuita

more fixes

parent cdff62ab
......@@ -103,9 +103,10 @@ Kirigami.ApplicationWindow
{
id: artwork
width: parent.width < columnWidth ? parent.width : columnWidth
height:parent.height
height: parent.height
anchors.centerIn: parent
source: currentArtwork ? "file://"+encodeURIComponent(currentArtwork) : "qrc:/assets/cover.png"
fillMode: Image.PreserveAspectFit
}
}
......@@ -265,18 +266,18 @@ Kirigami.ApplicationWindow
Player.playTrack(mainPlaylistTable.model.get(0))
playIcon.text= MdiFont.Icon.pause
}
onAppendAlbum:
{
for(var i in tracks)
appendTrack(tracks[i])
}
}
PlaylistsView {}
SettingsView
{
onIconSizeChanged:
{
iconSize = size
console.log(size)
}
onIconSizeChanged: iconSize = size
}
onCurrentIndexChanged:
......
......@@ -21,7 +21,7 @@ Pane
{
id: grid
width: Math.min(model.count, Math.floor(parent.width/cellWidth))*cellWidth
width: parent.width
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
......@@ -41,17 +41,17 @@ Pane
// radius: borderRadius
// }
// onWidthChanged:
// {
// var amount = parseInt(grid.width/(albumSize+albumSpacing),10)
// var leftSpace = parseInt(grid.width-(amount*albumSize), 10)
// var size = parseInt(albumSize+(parseInt(leftSpace/amount, 10)), 10)
onWidthChanged:
{
var amount = parseInt(grid.width/(albumSize+albumSpacing),10)
var leftSpace = parseInt(grid.width-(amount*albumSize), 10)
var size = parseInt(albumSize+(parseInt(leftSpace/amount, 10)), 10)
// size = size > albumSize+albumSpacing ? size : albumSize+albumSpacing
size = size > albumSize+albumSpacing ? size : albumSize+albumSpacing
// grid.cellWidth = size
// // grid.cellHeight = size
// }
grid.cellWidth = size
// grid.cellHeight = size
}
delegate: BabeAlbum
{
......
......@@ -8,6 +8,8 @@ ListView
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
property int currentRow : -1
property bool trackNumberVisible
signal rowClicked(int index)
signal rowPressed(int index)
......@@ -167,7 +169,7 @@ ListView
{
id: delegate
width: list.width
numberVisible : trackNumberVisible ? true : false
Connections
{
target: delegate
......
......@@ -7,19 +7,48 @@ ItemDelegate
id: delegate
signal rowSelected(int index)
property bool numberVisible : false
checkable: true
contentItem: ColumnLayout
contentItem: GridLayout
{
spacing: 2
id: gridLayout
rows:2
columns:3
Label
{
id: trackNumber
visible: numberVisible
width: 16
Layout.fillHeight: true
Layout.row: 1
Layout.column: 1
Layout.rowSpan: 2
Layout.alignment: Qt.AlignLeft
text: track
font.bold: true
elide: Text.ElideRight
font.pointSize: 10
}
Label
{
id: trackTitle
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 1
Layout.column: 2
text: title
font.bold: true
elide: Text.ElideRight
Layout.fillWidth: true
font.pointSize: 10
}
......@@ -27,81 +56,17 @@ ItemDelegate
Label
{
id: trackInfo
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 2
Layout.column: 2
text: artist + " | " + album
font.bold: false
elide: Text.ElideRight
Layout.fillWidth: true
font.pointSize: 9
}
}
// GridLayout
// {
// id: grid
// visible: false
// columns: 2
// rowSpacing: 10
// columnSpacing: 10
// Label
// {
// text: qsTr("Address:")
// Layout.leftMargin: 60
// }
// Label
// {
// text: address
// font.bold: true
// elide: Text.ElideRight
// Layout.fillWidth: true
// }
// Label
// {
// text: qsTr("City:")
// Layout.leftMargin: 60
// }
// Label
// {
// text: city
// font.bold: true
// elide: Text.ElideRight
// Layout.fillWidth: true
// }
// Label
// {
// text: qsTr("Number:")
// Layout.leftMargin: 60
// }
// Label
// {
// text: number
// font.bold: true
// elide: Text.ElideRight
// Layout.fillWidth: true
// }
// }
// }
// states: [
// State
// {
// name: "expanded"
// when: delegate.checked
// PropertyChanges
// {
// target: grid
// visible: true
// }
// }
// ]
}
......@@ -116,6 +116,7 @@ BabeGrid
id: drawerList
width: parent.width
height: parent.height - titleBar.height
trackNumberVisible: true
onRowClicked:
{
albumsView.rowClicked(model.get(index))
......@@ -132,7 +133,7 @@ BabeGrid
drawer.open()
drawerList.clearTable()
var query = "select * from tracks where album = \""+album+"\" and artist = \""+artist+"\""
var query = "select * from tracks where album = \""+album+"\" and artist = \""+artist+"\" order by track"
console.log(query)
var map = con.get(query)
......
......@@ -69,8 +69,8 @@ BabeGrid
onClicked:
{
var data = albumsView.gridModel.get(albumsView.grid.currentIndex)
var query = "select * from tracks where album = \""+data.album+"\" and artist = \""+data.artist+"\""
var data = artistsView.gridModel.get(artistsView.grid.currentIndex)
var query = "select * from tracks where artist = \""+data.artist+"\""
var tracks = con.get(query)
appendAlbum(tracks)
drawer.close()
......@@ -117,10 +117,11 @@ BabeGrid
id: drawerList
width: parent.width
height: parent.height - titleBar.height
trackNumberVisible: true
onRowClicked:
{
artistsView.rowClicked(model.get(index))
drawer.close()
}
}
......@@ -136,7 +137,7 @@ BabeGrid
drawerList.clearTable()
var query = "select * from tracks where artist = \""+artist+"\""
var query = "select * from tracks where artist = \""+artist+"\" order by album, track"
var map = con.get(query)
for(var i in map)
......
......@@ -5,6 +5,7 @@ import "../view_models"
BabeTable
{
id: tracksView
trackNumberVisible: false
Component.onCompleted:
{
var map = con.get("select * from tracks")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment