Commit d562419d authored by Camilo Higuita's avatar Camilo Higuita

porgressbar to slider

parent 931d8f0a
......@@ -83,10 +83,10 @@ public:
QStringList getTrackTags(const QString &path);
int getTrackStars(const QString &path);
int getTrackBabe(const QString &path);
QString getArtistArt(const QString &artist);
Q_INVOKABLE QString getArtistArt(const QString &artist);
QString getArtistWiki(const QString &artist);
// QStringList getArtistTags(const QString &artist);
QString getAlbumArt(const QString &album, const QString &artist);
Q_INVOKABLE QString getAlbumArt(const QString &album, const QString &artist);
QString getAlbumWiki(const QString &album, const QString &artist);
// QStringList getAlbumTags(const QString &album, const QString &artist);
QStringList getArtistAlbums(const QString &artist);
......
......@@ -26,6 +26,7 @@ Kirigami.ApplicationWindow
property int iconSize
property var currentTrack
property string currentArtwork
signal appendTrack(var track)
......@@ -98,11 +99,12 @@ Kirigami.ApplicationWindow
width: parent.width < columnWidth ? parent.width : columnWidth
height:parent.height
anchors.centerIn: parent
source: "qrc:/assets/test.jpg"
source: currentArtwork ? "file://"+encodeURIComponent(currentArtwork) : "qrc:/assets/cover.png"
}
}
ProgressBar
Slider
{
id: progressBar
width: parent.width
......@@ -112,6 +114,11 @@ Kirigami.ApplicationWindow
from: 0
to: 1000
value: 0
onMoved:
{
player.seek(player.duration() / 1000 * value);
}
}
Rectangle
......@@ -189,7 +196,6 @@ Kirigami.ApplicationWindow
{
Player.playTrack(model.get(index))
playIcon.text = MdiFont.Icon.pause
}
}
}
......@@ -200,7 +206,7 @@ Kirigami.ApplicationWindow
Page
{
id: views
width: parent.width /2
width: parent.width
height: parent.height
clip: true
......@@ -226,7 +232,7 @@ Kirigami.ApplicationWindow
}
AlbumsView
{
{
onRowClicked:
{
appendTrack(track)
......
......@@ -4,6 +4,7 @@ function playTrack(track)
player.source(currentTrack.url);
player.play()
root.title = currentTrack.title + " - " +currentTrack.artist
currentArtwork = con.getAlbumArt(currentTrack.album, currentTrack.artist) || con.getArtistArt(currentTrack.artist)
}
......
......@@ -12,7 +12,6 @@ Item
width: albumSize
height: parseInt(albumSize+(albumSize*0.4))
Rectangle
{
anchors.fill: parent
......@@ -35,7 +34,7 @@ Item
fillMode: Image.PreserveAspectFit
source: artwork || "qrc:/assets/cover.png"
source: (artwork && artwork !== "none")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
layer.enabled: true
layer.effect: OpacityMask
{
......@@ -62,6 +61,7 @@ Item
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: 5
Layout.topMargin: 5
Label
{
......
import QtQuick.Controls 2.2
import QtQuick 2.9
Pane
Page
{
property int albumSize : 150
property int albumSpacing: 20
......@@ -12,6 +12,7 @@ Pane
width: 500
height: 400
id: gridPage
ListModel
{
id: gridModel
......@@ -21,45 +22,42 @@ Pane
{
id: grid
// anchors.leftMargin: gridMargin
width: Math.min(model.count, Math.floor(parent.width/cellWidth))*cellWidth
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 20
cellWidth: albumSize+albumSpacing
cellWidth: albumSize + albumSpacing
cellHeight: parseInt(albumSize+(albumSize*0.6))
focus: true
model: gridModel
highlight: Rectangle
{
id: highlight
width: albumSize;
height: albumSize;
width: albumSize
height: albumSize
color: "lightsteelblue"
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
// console.log(parseInt(size,10))
}
// grid.cellWidth = size
// // grid.cellHeight = size
// }
delegate: BabeAlbum
{
id: delegate
albumSize: albumSize
borderRadius: borderRadius
Connections
{
......@@ -74,5 +72,11 @@ Pane
}
}
ScrollBar.vertical: ScrollBar
{
}
}
}
......@@ -81,6 +81,7 @@ BabeGrid
onRowClicked:
{
albumsView.rowClicked(model.get(index))
drawer.close()
}
}
......
......@@ -48,7 +48,7 @@ Pane
anchors.fill: parent
width: parent.width
height: parent.height
clip: true
ListModel
{
id: listModel
......
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