Commit 3f14bad9 authored by camilo higuita's avatar camilo higuita

more fixes for new page

parent 0cb4a908
......@@ -315,6 +315,7 @@ Maui.ApplicationWindow
{
icon.name: "headphones"
visible: _drawer.modal
checked: _drawer.visible
icon.color: _drawer.visible ? babeColor : textColor
onClicked: _drawer.visible = !_drawer.visible
Kirigami.Theme.highlightColor: babeColor
......@@ -643,7 +644,7 @@ Maui.ApplicationWindow
globalDrawer: Maui.GlobalDrawer
{
id: _drawer
width: Kirigami.Units.gridUnit * 18
width: Math.min(Kirigami.Units.gridUnit * 18, root.width)
height: root.height - root.headBar.implicitHeight - root.footBar.implicitHeight
modal: !isWide
......@@ -764,162 +765,162 @@ Maui.ApplicationWindow
}
}
// AlbumsView
// {
// id: artistsView
// holder.emoji: "qrc:/assets/MusicBox.png"
// holder.isMask: false
// holder.title : qsTr("No Artists!")
// holder.body: qsTr("Add new music sources")
// holder.emojiSize: iconSizes.huge
// title: count + qsTr(" artists")
// list.query: Albums.ARTISTS
// list.sortBy: Albums.ARTIST
// table.list.sortBy: Tracks.NONE
// Connections
// {
// target: artistsView
// onRowClicked: Player.addTrack(track)
// onPlayTrack: Player.quickPlay(track)
// onAlbumCoverClicked: artistsView.populateTable(undefined, artist)
// onAlbumCoverPressedAndHold:
// {
// var query = Q.GET.artistTracks_.arg(artist)
// mainPlaylist.list.clear()
// mainPlaylist.list.sortBy = Tracks.NONE
// mainPlaylist.list.query = query
// Player.playAll()
// }
// onPlayAll:
// {
// var query = Q.GET.artistTracks_.arg(artist)
// query = query.arg(data.artist)
// mainPlaylist.list.clear()
// mainPlaylist.list.sortBy = Tracks.NONE
// mainPlaylist.list.query = query
// Player.playAll()
// }
// onAppendAll:
// {
// var query = Q.GET.artistTracks_.arg(artist)
// mainPlaylist.list.appendQuery(query)
// mainPlaylist.listView.positionViewAtEnd()
// }
// }
// }
// PlaylistsView
// {
// id: playlistsView
// Connections
// {
// target: playlistsView
// onRowClicked: Player.addTrack(track)
// onQuickPlayTrack: Player.quickPlay(track)
// onPlayAll:
// {
// var query = playlistsView.playlistQuery
// mainPlaylist.list.clear()
// mainPlaylist.list.sortBy = Tracks.NONE
// mainPlaylist.list.query = query
// Player.playAll()
// }
// onAppendAll:
// {
// var query = playlistsView.playlistQuery
// mainPlaylist.list.appendQuery(query)
// mainPlaylist.listView.positionViewAtEnd()
// }
// onPlaySync:
// {
// var query = playlistsView.playlistQuery
// mainPlaylist.list.appendQuery(query)
// Player.playAll()
// root.sync = true
// root.syncPlaylist = playlist
// root.infoMsg = qsTr("Syncing to ") + playlist
// }
// }
// }
// SearchTable
// {
// id: searchView
// Connections
// {
// target: searchView
// onRowClicked: Player.addTrack(searchView.list.get(index))
// onQuickPlayTrack: Player.quickPlay(searchView.list.get(index))
// onPlayAll:
// {
// mainPlaylist.list.clear()
// var tracks = searchView.list.getAll()
// for(var i in tracks)
// Player.appendTrack(tracks[i])
// Player.playAll()
// }
// onAppendAll: Player.appendAll(searchView.list.getAll())
// onArtworkDoubleClicked:
// {
// var query = Q.GET.albumTracks_.arg(
// searchView.searchTable.model.get(
// index).album)
// query = query.arg(searchView.searchTable.model.get(
// index).artist)
// mainPlaylist.list.clear()
// mainPlaylist.list.sortBy = Tracks.NONE
// mainPlaylist.list.query = query
// Player.playAll()
// }
// }
// }
// FoldersView
// {
// id: foldersView
// Connections
// {
// target: foldersView.list
// onRowClicked: Player.addTrack(foldersView.list.model.get(index))
// onQuickPlayTrack: Player.quickPlay(foldersView.list.model.get(index))
// onPlayAll:
// {
// mainPlaylist.list.clear()
// // mainPlaylist.list.sortBy = Tracks.NONE
// mainPlaylist.list.query = foldersView.list.list.query
// Player.playAll()
// }
// onAppendAll:
// {
// var query = foldersView.list.list.query
// mainPlaylist.list.appendQuery(query)
// mainPlaylist.listView.positionViewAtEnd()
// }
// onQueueTrack: Player.queueTracks([foldersView.list.model.get(index)], index)
// }
// }
AlbumsView
{
id: artistsView
holder.emoji: "qrc:/assets/MusicBox.png"
holder.isMask: false
holder.title : qsTr("No Artists!")
holder.body: qsTr("Add new music sources")
holder.emojiSize: iconSizes.huge
title: count + qsTr(" artists")
list.query: Albums.ARTISTS
list.sortBy: Albums.ARTIST
table.list.sortBy: Tracks.NONE
Connections
{
target: artistsView
onRowClicked: Player.addTrack(track)
onPlayTrack: Player.quickPlay(track)
onAlbumCoverClicked: artistsView.populateTable(undefined, artist)
onAlbumCoverPressedAndHold:
{
var query = Q.GET.artistTracks_.arg(artist)
mainPlaylist.list.clear()
mainPlaylist.list.sortBy = Tracks.NONE
mainPlaylist.list.query = query
Player.playAll()
}
onPlayAll:
{
var query = Q.GET.artistTracks_.arg(artist)
query = query.arg(data.artist)
mainPlaylist.list.clear()
mainPlaylist.list.sortBy = Tracks.NONE
mainPlaylist.list.query = query
Player.playAll()
}
onAppendAll:
{
var query = Q.GET.artistTracks_.arg(artist)
mainPlaylist.list.appendQuery(query)
mainPlaylist.listView.positionViewAtEnd()
}
}
}
PlaylistsView
{
id: playlistsView
Connections
{
target: playlistsView
onRowClicked: Player.addTrack(track)
onQuickPlayTrack: Player.quickPlay(track)
onPlayAll:
{
var query = playlistsView.playlistQuery
mainPlaylist.list.clear()
mainPlaylist.list.sortBy = Tracks.NONE
mainPlaylist.list.query = query
Player.playAll()
}
onAppendAll:
{
var query = playlistsView.playlistQuery
mainPlaylist.list.appendQuery(query)
mainPlaylist.listView.positionViewAtEnd()
}
onPlaySync:
{
var query = playlistsView.playlistQuery
mainPlaylist.list.appendQuery(query)
Player.playAll()
root.sync = true
root.syncPlaylist = playlist
root.infoMsg = qsTr("Syncing to ") + playlist
}
}
}
SearchTable
{
id: searchView
Connections
{
target: searchView
onRowClicked: Player.addTrack(searchView.list.get(index))
onQuickPlayTrack: Player.quickPlay(searchView.list.get(index))
onPlayAll:
{
mainPlaylist.list.clear()
var tracks = searchView.list.getAll()
for(var i in tracks)
Player.appendTrack(tracks[i])
Player.playAll()
}
onAppendAll: Player.appendAll(searchView.list.getAll())
onArtworkDoubleClicked:
{
var query = Q.GET.albumTracks_.arg(
searchView.searchTable.model.get(
index).album)
query = query.arg(searchView.searchTable.model.get(
index).artist)
mainPlaylist.list.clear()
mainPlaylist.list.sortBy = Tracks.NONE
mainPlaylist.list.query = query
Player.playAll()
}
}
}
FoldersView
{
id: foldersView
Connections
{
target: foldersView.list
onRowClicked: Player.addTrack(foldersView.list.model.get(index))
onQuickPlayTrack: Player.quickPlay(foldersView.list.model.get(index))
onPlayAll:
{
mainPlaylist.list.clear()
// mainPlaylist.list.sortBy = Tracks.NONE
mainPlaylist.list.query = foldersView.list.list.query
Player.playAll()
}
onAppendAll:
{
var query = foldersView.list.list.query
mainPlaylist.list.appendQuery(query)
mainPlaylist.listView.positionViewAtEnd()
}
onQueueTrack: Player.queueTracks([foldersView.list.model.get(index)], index)
}
}
// CloudView
// {
......
......@@ -114,7 +114,10 @@ void BaseModel::setList(BaseList *value)
QVariantMap BaseModel::get(const int &index) const
{
if(this->mList)
return this->mList->get(index);
return QVariantMap();
}
void BaseModel::clear()
......
......@@ -80,6 +80,8 @@ void PlaylistsModel::setList()
this->list << this->db->getPlaylists();
this->list << this->defaultPlaylists();
qDebug()<< this->list;
// this->sortList();
emit this->postListChanged();
}
......
......@@ -14,6 +14,7 @@ Maui.Dialog
property var tracks : []
maxHeight: 400 * unit
page.padding: space.medium
ColumnLayout
{
......
......@@ -102,6 +102,8 @@ BabeGrid
maxHeight: maxWidth
maxWidth: unit * 600
defaultButtons: false
page.padding: 0
// verticalAlignment: Qt.AlignBottom
ColumnLayout
......
......@@ -108,7 +108,7 @@ ListView
{
anchors.fill : parent
preventStealing: true
parent: applicationWindow().overlay.parent
// parent: applicationWindow().overlay.parent
onPressed:
{
......
......@@ -51,51 +51,50 @@ Maui.Page
id: albumsRoll
}
// footBar.background: Rectangle
// {
// id: footerBg
// clip : true
// height: footBar.implicitHeight
// color: "transparent"
// Image
// {
// id: artworkBg
// height: parent.height
// width: parent.width
// sourceSize.width: parent.width
// sourceSize.height: parent.height
// fillMode: Image.PreserveAspectCrop
// cache: true
// antialiasing: true
// smooth: true
// asynchronous: true
// source: "file://"+encodeURIComponent(currentArtwork)
// }
// FastBlur
// {
// id: fastBlur
// anchors.fill: parent
// y:1
// source: artworkBg
// radius: 100
// transparentBorder: false
// cached: true
// z:1
// clip: true
// Rectangle
// {
// anchors.fill: parent
// color: viewBackgroundColor
// opacity: 0.85
// }
// }
// }
footBar.background: Item
{
id: footerBg
clip : true
height: footBar.implicitHeight
Image
{
id: artworkBg
height: parent.height
width: parent.width
sourceSize.width: parent.width
sourceSize.height: parent.height
fillMode: Image.PreserveAspectCrop
cache: true
antialiasing: true
smooth: true
asynchronous: true
source: "file://"+encodeURIComponent(currentArtwork)
}
FastBlur
{
id: fastBlur
anchors.fill: parent
y:1
source: artworkBg
radius: 100
transparentBorder: false
cached: true
z:1
clip: true
Rectangle
{
anchors.fill: parent
color: viewBackgroundColor
opacity: 0.85
}
}
}
ColumnLayout
......
......@@ -44,6 +44,7 @@ ColumnLayout
BabeList
{
id: playlistViewModelFilter
// headBarExitIcon: "go-previous"
headBar.leftContent: ToolButton
{
icon.name: "go-previous"
......@@ -58,6 +59,7 @@ ColumnLayout
Connections
{
target: delegate
onClicked: {}
}
}
......
......@@ -19,6 +19,8 @@ BabeList
id: control
property alias list: _playlistsList
signal playSync(int index)
title: "Playlists"
Maui.NewDialog
......@@ -30,7 +32,6 @@ BabeList
rejectButton.visible: false
}
signal playSync(int index)
headBar.rightContent: Kirigami.ActionToolBar
{
......
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