Commit 0cb4a908 authored by camilo higuita's avatar camilo higuita

work for new mauikit simple rpage

parent fc9431d5
......@@ -152,14 +152,11 @@ Maui.ApplicationWindow
/* UI */
altToolBars: false
accentColor: babeColor
// headBarFGColor: altColorText
// headBarBGColor: "#212121"
// altColorText: darkTextColor
floatingBar: false
headBar.spacing: space.big
headBar.middleContent : Kirigami.ActionToolBar
{
......@@ -250,7 +247,7 @@ Maui.ApplicationWindow
footBar.visible: !mainlistEmpty
footBar.implicitHeight: footBar.visible ? toolBarHeight * 1.2 : 0
page.footBarItem: ColumnLayout
page.footer: ColumnLayout
{
id: _footerLayout
......@@ -722,7 +719,7 @@ Maui.ApplicationWindow
holder.title : "No Albums!"
holder.body: "Add new music sources"
holder.emojiSize: iconSizes.huge
headBarTitle: count + qsTr(" albums")
title: count + qsTr(" albums")
list.query: Albums.ALBUMS
list.sortBy: Albums.ALBUM
......@@ -767,162 +764,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
headBarTitle: 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
// {
......@@ -1033,10 +1030,10 @@ Maui.ApplicationWindow
{
target: vvave
onRefreshTables: H.refreshCollection(size)
onRefreshTracks: H.refreshTracks()
onRefreshAlbums: H.refreshAlbums()
onRefreshArtists: H.refreshArtists()
// onRefreshTables: H.refreshCollection(size)
// onRefreshTracks: H.refreshTracks()
// onRefreshAlbums: H.refreshAlbums()
// onRefreshArtists: H.refreshArtists()
// onCoverReady:
// {
......
......@@ -11,7 +11,6 @@ Maui.Page
id: youtubeViewRoot
property var searchRes : []
clip: true
margins: 0
property alias viewer : youtubeViewer
property int openVideo : 0
headBar.visible: false
......@@ -178,9 +177,6 @@ Maui.Page
id: youtubeTable
trackNumberVisible: false
headBar.visible: true
headBarExit: true
headBarExitIcon: "edit-clear"
headBarTitle: "YouTube"
holder.emoji: "qrc:/assets/Astronaut.png"
holder.isMask: false
holder.title : "No Results!"
......@@ -189,7 +185,6 @@ Maui.Page
coverArtVisible: true
trackDuration: true
trackRating: true
onExit: clearSearch()
isArtworkRemote: true
allowMenu: false
......@@ -198,6 +193,17 @@ Maui.Page
// appendBtn.visible: false
// playAllBtn.visible: false
headBar.leftContent: ToolButton
{
icon.name: "edit-clear"
onClicked: clearSearch()
}
headBar.middleContent: Label
{
text: "YouTube"
}
headBar.rightContent: ToolButton
{
id: menuBtn
......
......@@ -12,11 +12,14 @@ Maui.Page
property alias webView: webViewer.item
property bool wasPlaying: false
property var currentYt : ({})
margins: 0
headBarExitIcon: "go-previous"
onExit: stackView.pop(youtubeTable)
headBarTitle: currentYt ? currentYt.title : "YouTube"
title: currentYt ? currentYt.title : "YouTube"
headBar.leftContent: ToolButton
{
icon.name: "go-previous"
onClicked: stackView.pop(youtubeTable)
}
headBar.rightContent: [
......
......@@ -30,8 +30,8 @@ Maui.Page
signal albumCoverPressed(string album, string artist)
signal bgClicked()
margins: space.medium
topMargin: space.big
// margins: space.medium
// topMargin: space.big
MouseArea
{
......@@ -61,8 +61,8 @@ Maui.Page
id: grid
onAreaClicked: bgClicked()
adaptContent: true
width: parent.width
height: parent.height
anchors.fill: parent
anchors.topMargin: space.big
itemSize: albumCoverSize
spacing: albumSpacing
......@@ -87,8 +87,8 @@ Maui.Page
target: albumDelegate
onClicked:
{
var album = grid.model.get(index).album
var artist = grid.model.get(index).artist
var album = _albumsList.get(index).album
var artist = _albumsList.get(index).artist
albumCoverClicked(album, artist)
grid.currentIndex = index
}
......
......@@ -24,7 +24,6 @@ Maui.Page
signal pulled()
focus: true
margins: 0
Maui.Holder
{
......@@ -33,8 +32,6 @@ Maui.Page
focus: true
}
Maui.ListBrowser
{
id: babeList
......
......@@ -58,7 +58,6 @@ BabeList
//headBar.middleStrech: false
headBar.leftSretch: false
headBar.rightContent: Kirigami.ActionToolBar
{
position: Controls.ToolBar.Header
......
......@@ -22,7 +22,7 @@ BabeGrid
property var tracks: []
property alias table : albumsViewTable
property alias tagBar : tagBar
// property alias tagBar : tagBar
signal rowClicked(var track)
signal playTrack(var track)
......@@ -37,7 +37,6 @@ BabeGrid
// topPadding: space.large
onAlbumCoverPressed: albumCoverPressedAndHold(album, artist)
headBar.visible: false
headBarExit: false
// headBar.rightContent: Kirigami.ActionToolBar
// {
// Layout.fillWidth: true
......@@ -103,8 +102,6 @@ BabeGrid
maxHeight: maxWidth
maxWidth: unit * 600
defaultButtons: false
page.margins: 0
// verticalAlignment: Qt.AlignBottom
ColumnLayout
......@@ -121,14 +118,12 @@ BabeGrid
trackNumberVisible: true
trackRating: true
headBar.visible: true
headBarExit: false
coverArtVisible: true
quickPlayVisible: true
focus: true
list.sortBy: Tracks.TRACK
headBar.plegable: false
holder.emoji: "qrc:/assets/ElectricPlug.png"
holder.isMask: false
holder.title : "Oops!"
......@@ -161,21 +156,17 @@ BabeGrid
albumDialog.close()
albumsViewGrid.appendAll(currentAlbum, currentArtist)
}
}
Maui.TagsBar
{
id: tagBar
visible:false
Layout.fillWidth: true
allowEditMode: false
onTagClicked: H.searchFor("tag:"+tag)
}
// Maui.TagsBar
// {
// id: tagBar
// visible:false
// Layout.fillWidth: true
// allowEditMode: false
// onTagClicked: H.searchFor("tag:"+tag)
// }
}
}
function populateTable(album, artist)
......@@ -193,13 +184,13 @@ BabeGrid
{
query = Q.GET.albumTracks_.arg(album)
query = query.arg(artist)
albumsView.table.headBarTitle = album
albumsView.table.title = album
tagq = Q.GET.albumTags_.arg(album)
}else if(artist && album === undefined)
{
query = Q.GET.artistTracks_.arg(artist)
artistsView.table.headBarTitle = artist
artistsView.table.title = artist
tagq = Q.GET.artistTags_.arg(artist)
}
......@@ -218,6 +209,7 @@ BabeGrid
function filter(tracks)
{
var matches = []
for(var i = 0; i<tracks.length; i++)
matches.push(find(tracks[i].album))
......
......@@ -46,14 +46,11 @@ Item
maxHeight: maxWidth
maxWidth: unit * 600
defaultButtons: false
page.margins: 0
BabeTable
{
id: _filterList
anchors.fill: parent
coverArtVisible: true
headBarExit: false
holder.emoji: "qrc:/assets/MusicCloud.png"
holder.isMask: false
holder.title : "No Tracks!"
......
......@@ -29,8 +29,6 @@ Maui.Page
signal coverDoubleClicked(var tracks)
signal coverPressed(var tracks)
focus: true
margins: 0
headBar.visible: false
PlaylistMenu
......@@ -45,59 +43,59 @@ Maui.Page
footBar.visible: !mainlistEmpty
footBar.implicitHeight: toolBarHeight * 1.3
footBarItem: AlbumsRoll
footBar.middleContent: AlbumsRoll
{
anchors.fill : parent
anchors.leftMargin: space.small
anchors.rightMargin: space.small
// height: toolBarHeight * 1.3
Layout.fillWidth: true
Layout.fillHeight: true
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: 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
// }
// }
// }
ColumnLayout
......@@ -154,13 +152,7 @@ Maui.Page
// if(autoplay)
// Player.playAt(0)
}
}
Kirigami.Separator
{
Layout.fillWidth: true
color: borderColor
}
}
}
// function goFocusMode()
......
......@@ -4,15 +4,11 @@ import QtQuick.Controls 2.2
import org.kde.kirigami 2.6 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../view_models/BabeTable"
import "../../view_models"
import "../../db/Queries.js" as Q
import "../../utils/Help.js" as H
ColumnLayout
{
id: control
......@@ -36,7 +32,6 @@ ColumnLayout
Layout.fillHeight: true
Layout.fillWidth: true
interactive: false
clip: true
......@@ -49,8 +44,11 @@ ColumnLayout
BabeList
{
id: playlistViewModelFilter
headBarExitIcon: "go-previous"
headBar.leftContent: ToolButton