Commit 0f53a12e authored by Camilo Higuita's avatar Camilo Higuita

fixes on delegates

parent 41d71767
......@@ -55,7 +55,12 @@ Item
cache: false
antialiasing: true
source: (artwork.length>0 && artwork !== "none" && artwork)? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
source:
{
if(artwork)
(artwork.length > 0 && artwork !== "NONE")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
else "qrc:/assets/cover.png"
}
// layer.enabled: true
// layer.effect: OpacityMask
// {
......
......@@ -9,6 +9,7 @@ ListView
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
id: list
// cacheBuffer : 300
property int currentRow : -1
property bool headerBar: false
......@@ -42,14 +43,16 @@ ListView
highlight: highlight
highlightFollowsCurrentItem: false
keyNavigationWraps: bae.isMobile()
focus: true
boundsBehavior: Flickable.StopAtBounds
// boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.AutoFlickDirection
// flickableDirection: Flickable.AutoFlickDirection
snapMode: ListView.SnapToItem
addDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
function clearTable()
{
listModel.clear()
......@@ -154,10 +157,10 @@ ListView
{
width: list.width
height: list.currentItem.height
color: bae.hightlightColor() || myPalette.highlight
opacity: 0.2
opacity: 0.7
y: list.currentItem.y
// Behavior on y
// {
// SpringAnimation
......
......@@ -16,6 +16,15 @@ ItemDelegate
signal artworkCoverDoubleClicked()
signal artworkCoverClicked()
readonly property bool sameAlbum :
{
if(listModel.get(index-1))
{
if(listModel.get(index-1).album === album) true
else false
}else false
}
property string textColor: bae.foregroundColor()
property bool number : false
property bool quickPlay : true
......@@ -38,9 +47,9 @@ ItemDelegate
else
index % 2 === 0 ? bae.midColor() : "transparent"
}
opacity: 0.3
}
MouseArea
{
anchors.fill: parent
......@@ -65,9 +74,8 @@ ItemDelegate
{
if(coverArt)
{
if(listModel.get(index-1))
if(listModel.get(index-1).album === album)
artworkCover.source = ""
if(sameAlbum)
artworkCover.source = ""
true
}else false
......@@ -90,7 +98,7 @@ ItemDelegate
source:
{
if(artwork)
(artwork.length>0 && artwork !== "none")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
(artwork.length > 0 && artwork !== "NONE")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
else "qrc:/assets/cover.png"
}
fillMode: Image.PreserveAspectFit
......@@ -180,11 +188,12 @@ ItemDelegate
Label
{
id: trackInfo
visible: coverArt ? !sameAlbum : true
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 2
Layout.column: 2
Layout.rowSpan: sameAlbum && coverArt ? 2 : 1
verticalAlignment: Qt.AlignVCenter
text: artist + " | " + album
font.bold: false
......
......@@ -68,7 +68,7 @@ BabeGrid
trackNumberVisible: true
headerBar: true
headerClose: true
coverArtVisible: true
onRowClicked:
{
......
......@@ -68,7 +68,7 @@ BabeGrid
trackNumberVisible: true
headerBar: true
headerClose: true
coverArtVisible: true
onRowClicked:
{
drawer.close()
......
......@@ -10,6 +10,8 @@ BabeTable
trackRating: true
headerBar: true
headerTitle: count + " tracks"
coverArtVisible: false
function populate()
{
var map = bae.get(Q.Query.allTracks)
......
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