Commit caadd30f authored by Camilo Higuita's avatar Camilo Higuita

polishing stuff

parent a5e8ba0c
......@@ -200,7 +200,8 @@ SOURCES += main.cpp \
RESOURCES += qml.qrc
RESOURCES += qml.qrc \
# kirigami-icons.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="22" version="1.1" xmlns="http://www.w3.org/2000/svg" height="22" viewBox="0 0 5.8208332 5.8208335" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
<defs id="defs4"/>
<metadata id="metadata7"/>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1" transform="matrix(1 0 0 1 0 -291.17916)">
<rect width="5.291667" x="0.264583" y="291.70834" rx="2.116651" height="4.762512" style="fill:#fdd583" id="rect4152"/>
<path inkscape:connector-curvature="0" style="fill:#87b6f1" id="path4167" d="m 4.4979163,295.5448 c -2.8e-6,0.21919 -0.1776889,0.39687 -0.396875,0.39687 -0.2191861,0 -0.3968722,-0.17768 -0.396875,-0.39687 -2.8e-6,-0.21919 0.396875,-0.92606 0.396875,-0.92606 0,0 0.3968778,0.70687 0.396875,0.92606 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="rect4160" d="m 3.8271565,293.7573 c -0.06822,0 -0.095332,0.0687 -0.1100791,0.1018 -0.00838,0.0321 -0.012721,0.065 -0.012911,0.0982 0,0.21918 0.1776871,0.39687 0.396875,0.39687 0.1706962,-1.2e-4 0.3221951,-0.10937 0.3762045,-0.2713 l 0.00723,-0.0233 c 0.018968,-0.0708 -0.022741,-0.14277 -0.093534,-0.16174 l -0.5110789,-0.13695 c -0.017698,-0.005 -0.035684,-0.006 -0.05271,-0.004 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4174" d="m 1.9459467,293.7573 c 0.06822,0 0.095332,0.0687 0.1100791,0.1018 0.00838,0.0321 0.012721,0.065 0.012911,0.0982 0,0.21918 -0.1776871,0.39687 -0.3968751,0.39687 -0.1706962,-1.2e-4 -0.322195,-0.10937 -0.3762044,-0.2713 l -0.00723,-0.0233 c -0.018968,-0.0708 0.022741,-0.14277 0.093534,-0.16174 l 0.511079,-0.13695 c 0.017698,-0.005 0.035684,-0.006 0.05271,-0.004 z"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="22" version="1.1" xmlns="http://www.w3.org/2000/svg" height="22" viewBox="0 0 5.8208332 5.8208335" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
<defs id="defs4"/>
<metadata id="metadata7"/>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1" transform="matrix(1 0 0 1 0 -291.17916)">
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4280" d="m 4.7552653,294.51437 c 0.9768806,0.8218 -0.7066855,0.98312 -0.125057,1.16272 0.6614584,0 0.9260444,-0.30999 0.9260417,-0.52918 -1.1e-6,-0.0891 -0.5291667,-0.79373 -0.8009847,-0.63354 z"/>
<rect width="5.02708" x="0.264583" y="291.70834" rx="2.116651" height="4.762512" style="fill:#fdd583" id="rect4152"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4233" d="m 2.4962816,294.08959 a 0.8383182,1.1465173 0 0 0 0.705284,0.52915 0.8383182,1.1465173 0 0 0 0.7061034,-0.52915 l -0.082281,0 a 0.83831804,1.058328 0 0 1 -0.6238266,0.35277 0.83831804,1.058328 0 0 1 -0.6234173,-0.35277 l -0.081864,0 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4184" d="m 1.9843746,293.03124 a 0.39687501,0.39687501 0 0 0 -0.396875,0.39688 0.39687501,0.39687501 0 0 0 0.023254,0.13229 0.39687501,0.39687501 0 0 1 0.3736206,-0.26459 0.39687501,0.39687501 0 0 1 0.3736206,0.26459 0.39687501,0.39687501 0 0 0 0.023254,-0.13229 0.39687501,0.39687501 0 0 0 -0.396875,-0.39688 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4231" d="m 4.3656252,293.03125 a 0.39687501,0.39687501 0 0 0 -0.3968753,0.39687 0.39687501,0.39687501 0 0 0 0.023254,0.13229 0.39687501,0.39687501 0 0 1 0.3736206,-0.26458 0.39687501,0.39687501 0 0 1 0.3736206,0.26458 0.39687501,0.39687501 0 0 0 0.023254,-0.13229 0.39687501,0.39687501 0 0 0 -0.3968747,-0.39687 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4249" d="m 1.5802651,294.51437 c 0.9768806,0.8218 -0.70668549,0.98312 -0.125057,1.16272 0.6614584,0 0.9260444,-0.30999 0.9260417,-0.52918 -1.1e-6,-0.0891 -0.5291666,-0.79373 -0.8009847,-0.63354 z"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="22" version="1.1" xmlns="http://www.w3.org/2000/svg" height="22" viewBox="0 0 5.8208332 5.8208335" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
<defs id="defs4"/>
<metadata id="metadata7"/>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1" transform="matrix(1 0 0 1 0 -291.17916)">
<rect width="5.291667" x="0.264583" y="291.70834" rx="2.116651" height="4.762512" style="fill:#fdd583" id="rect4152"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4184" d="m 1.7197914,293.03124 a 0.39687501,0.39687501 0 0 0 -0.396875,0.39688 0.39687501,0.39687501 0 0 0 0.023254,0.13229 0.39687501,0.39687501 0 0 1 0.3736206,-0.26459 0.39687501,0.39687501 0 0 1 0.3736207,0.26459 0.39687501,0.39687501 0 0 0 0.023254,-0.13229 0.39687501,0.39687501 0 0 0 -0.396875,-0.39688 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4231" d="m 4.1010421,293.03125 a 0.39687501,0.39687501 0 0 0 -0.3968753,0.39687 0.39687501,0.39687501 0 0 0 0.023254,0.13229 0.39687501,0.39687501 0 0 1 0.3736206,-0.26458 0.39687501,0.39687501 0 0 1 0.3736206,0.26458 0.39687501,0.39687501 0 0 0 0.023254,-0.13229 0.39687501,0.39687501 0 0 0 -0.3968747,-0.39687 z"/>
<path style="fill:#ea5756;stroke-width:3.779527" id="rect4167" d="M 6 13 C 6 15.216003 7.7839967 17 10 17 L 12 17 C 14.216003 17 16 15.216003 16 13 L 6 13 z " transform="matrix(0.26458334 0 0 0.26458334 0 291.17916)"/>
<path style="fill:#f37b7a;stroke-width:3.779527" id="path4172" d="M 11 15 A 2 1.5 0 0 0 9 16.5 A 2 1.5 0 0 0 9.0664062 16.880859 C 9.3669408 16.952515 9.6769085 17 10 17 L 12 17 C 12.322232 17 12.631835 16.954099 12.931641 16.882812 A 2 1.5 0 0 0 13 16.5 A 2 1.5 0 0 0 11 15 z " transform="matrix(0.26458334 0 0 0.26458334 0 291.17916)"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="22" version="1.1" xmlns="http://www.w3.org/2000/svg" height="22" viewBox="0 0 5.8208332 5.8208335" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
<defs id="defs4"/>
<metadata id="metadata7"/>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1" transform="matrix(1 0 0 1 0 -291.17916)">
<rect width="5.291667" x="0.264583" y="291.70834" rx="2.116651" height="4.762512" style="fill:#fdd583" id="rect4152"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4184" d="m 4.1010419,294.88332 a 0.39687501,0.39687501 0 0 0 0.396875,-0.39688 0.39687501,0.39687501 0 0 0 -0.023254,-0.13229 0.39687501,0.39687501 0 0 1 -0.3736205,0.26459 0.39687501,0.39687501 0 0 1 -0.3736206,-0.26459 0.39687501,0.39687501 0 0 0 -0.023254,0.13229 0.39687501,0.39687501 0 0 0 0.3968751,0.39688 z"/>
<path inkscape:connector-curvature="0" style="fill:#8f5315" id="path4231" d="m 1.7197912,294.88331 a 0.39687501,0.39687501 0 0 0 0.3968753,-0.39687 0.39687501,0.39687501 0 0 0 -0.023254,-0.13229 0.39687501,0.39687501 0 0 1 -0.3736206,0.26458 0.39687501,0.39687501 0 0 1 -0.3736205,-0.26458 0.39687501,0.39687501 0 0 0 -0.023254,0.13229 0.39687501,0.39687501 0 0 0 0.3968747,0.39687 z"/>
<path inkscape:connector-curvature="0" style="fill:#1aa3de;stroke-width:3.779527" id="path3362" d="m 2.9104165,295.8407 c -1.7e-6,0.1323 -1.3228734,0.21009 -1.3228795,-0.26457 -3.72e-5,-0.16388 0.1765522,-0.32853 0.387937,-0.16364 0.018266,0.0184 0.036608,0.036 0.055017,0.0528 0.022598,0.0206 0.045296,0.0399 0.068078,0.0582 0.037242,0.0298 0.074707,0.0566 0.1123192,0.0808 0.2335156,0.14998 0.4727189,0.1984 0.6995284,0.2365 z"/>
<path style="fill:#8f5315;stroke-width:3.779527" id="rect4190" d="M 17 2 L 17 3 L 20.478516 3 L 17 5.9921875 L 17 6 L 17 7 L 17.359375 7 L 22 7 L 22 6 L 18.521484 6 L 22 3.0097656 L 22 2 L 17 2 z M 12 4 L 12 5 L 14.421875 5 L 12 6.9824219 L 12 7 L 12 8 L 12.337891 8 L 16 8 L 16 7 L 13.558594 7 L 16 5.0019531 L 16 5 L 16 4 L 12 4 z " transform="matrix(0.26458334 0 0 0.26458334 0 291.17916)"/>
</g>
</svg>
var Query = {
var GET = {
allTracks : "select t.*, al.artwork from tracks t inner join albums al on al.album = t.album and al.artist = t.artist",
allTracksSimple : "select * from tracks",
......@@ -16,5 +16,12 @@ var Query = {
mostPlayedTracks : "select t.*, al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist WHERE al.played > 0 ORDER BY played desc LIMIT 100",
favoriteTracks : "select t.*, al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist where stars > 0 order by stars desc limit 100",
recentTracks: "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist order by strftime(\"%s\", addDate) desc LIMIT 100",
babedTracks: "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist where t.babe = 1"
babedTracks: "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist where t.babe = 1",
colorTracks_: "select t.*, al.artwork from tracks t inner join albums al on al.album = t.album and al.artist = t.artist where t.art = \"%1\""
}
var POST = {}
var UPDATE = {}
......@@ -2,7 +2,7 @@
#include <QFontDatabase>
#include <QQmlContext>
#include <QApplication>
#include <QIcon>
#include "babe.h"
#include "services/local/player.h"
#include <QLibrary>
......@@ -16,7 +16,9 @@ int main(int argc, char *argv[])
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
app.setApplicationName(BAE::App);
app.setApplicationVersion(BAE::Version);
app.setWindowIcon(QIcon("qrc:/assets/babe.png"));
QFontDatabase::addApplicationFont(":/utils/materialdesignicons-webfont.ttf");
QQmlApplicationEngine engine;
......
......@@ -127,7 +127,10 @@ Kirigami.ApplicationWindow
onPlaylistViewClicked:
{
pageStack.currentIndex = 0
if(pageStack.wideMode)
root.width = columnWidth
else
pageStack.currentIndex = 0
}
onTracksViewClicked:
......@@ -188,15 +191,7 @@ Kirigami.ApplicationWindow
selectedTextColor: bae.foregroundColor()
property string placeholderText: "Search..."
// Label
// {
// text: searchInput.placeholderText
// visible: !(searchInput.focus || searchInput.text)
// horizontalAlignment: Text.AlignHCenter
// verticalAlignment: Text.AlignVCenter
// font.bold: true
// color: bae.foregroundColor()
// }
onAccepted: runSearch()
BabeButton
{
......@@ -216,24 +211,12 @@ Kirigami.ApplicationWindow
BabeButton
{
anchors.right: parent.right
visible: searchInput.text
visible: searchInput.activeFocus
iconName: "edit-clear"
onClicked: clearSearch()
}
// onTextChanged:
// {
// if(searchInput.text.length===0)
// albumsView.populate()
// }
onAccepted: runSearch()
}
......@@ -246,7 +229,7 @@ Kirigami.ApplicationWindow
z: -999
}
SettingsView
SettingsView
{
id: settingsDrawer
onIconSizeChanged: toolBarIconSize = (size === 24 && isMobile) ? 24 : 22
......@@ -266,10 +249,10 @@ Kirigami.ApplicationWindow
}
Page
Page
{
id: views
anchors.fill: parent
anchors.fill: parent
clip: true
// transform: Translate {
......@@ -312,8 +295,8 @@ Kirigami.ApplicationWindow
target: tracksView
onRowClicked: Player.addTrack(tracksView.model.get(index))
onQuickPlayTrack: Player.quickPlay(tracksView.model.get(index))
onPlayAll: Player.playAll(bae.get(Q.Query.allTracks))
onAppendAll: Player.appendAll(bae.get(Q.Query.allTracks))
onPlayAll: Player.playAll(bae.get(Q.GET.allTracks))
onAppendAll: Player.appendAll(bae.get(Q.GET.allTracks))
}
......@@ -354,8 +337,8 @@ Kirigami.ApplicationWindow
target: playlistsView
onRowClicked: Player.addTrack(track)
onQuickPlayTrack: Player.quickPlay(track)
// onPlayAll: Player.playAll(bae.get(Q.Query.allTracks))
// onAppendAll: Player.appendAll(bae.get(Q.Query.allTracks))
onPlayAll: Player.playAll(tracks)
onAppendAll: Player.appendAll(tracks)
}
}
......@@ -373,7 +356,7 @@ Kirigami.ApplicationWindow
onHeaderClosed: clearSearch()
onArtworkDoubleClicked:
{
var query = Q.Query.albumTracks_.arg(searchView.model.get(index).album)
var query = Q.GET.albumTracks_.arg(searchView.model.get(index).album)
query = query.arg(searchView.model.get(index).artist)
Player.playAll(bae.get(query))
......@@ -385,7 +368,7 @@ Kirigami.ApplicationWindow
}
}
}
/*animations*/
/*animations*/
pageStack.layers.popEnter: Transition {
PauseAnimation {
......
......@@ -10,7 +10,6 @@
<file>widgets/AlbumsView.qml</file>
<file>assets/cover.png</file>
<file>data_models/db_model.qml</file>
<file>assets/test.jpg</file>
<file>db/script.sql</file>
<file>widgets/SettingsView.qml</file>
<file>utils/Player.js</file>
......@@ -44,5 +43,12 @@
<file>widgets/PlaylistsView/AddPlaylistDialog.qml</file>
<file>view_models/BabeButton.qml</file>
<file>utils/Props.js</file>
<file>assets/babe.png</file>
<file>assets/face-sleeping.svg</file>
<file>assets/face-laughing.svg</file>
<file>assets/face-hug-left.svg</file>
<file>assets/face-crying.svg</file>
<file>assets/face-sleeping.png</file>
<file>assets/face-hug.png</file>
</qresource>
</RCC>
......@@ -8,7 +8,6 @@ Text
property int iconSize
property string icon
readonly property string defaultColor : iconColor
text: MdiFont.Babe[babeIcon.icon] || MdiFont.Icon[babeIcon.icon]
font.family: "Material Design Icons"
font.pixelSize: babeIcon.iconSize
......
......@@ -1675,7 +1675,7 @@ var Babe = {
"view-media-playlist" : Icon.libraryMusic,
"application-menu": Icon.dotsVertical,
"games-config-options" : Icon.dotsVertical,
"games-config-options" : Icon.settings,
/*playback bar*/
......
......@@ -248,7 +248,7 @@ namespace BAE
const QString NotifyDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
const QString BabePort = "8483";
const QString App = "Babe";
const QString version = "1.0";
const QString Version = "1.0";
const QString DBName = "collection.db";
......
......@@ -48,6 +48,7 @@ Item
saturation: -1
lightness: 0.3
}
Label
{
id: textHolder
......
......@@ -15,6 +15,7 @@ ListView
property bool trackNumberVisible
property bool quickPlayVisible : true
property bool coverArtVisible : false
property bool menuItemVisible : isMobile
property bool trackDuration
property bool trackRating
......@@ -91,7 +92,7 @@ ListView
{
id: tableHeader
width: parent.width
height: headerBar ? 48 : 0
height: headerBar ? 48 : 0
color: bae.midLightColor()
visible: headerBar && count > 0
z: 999
......@@ -99,14 +100,13 @@ ListView
RowLayout
{
anchors.fill: parent
anchors.centerIn: parent
BabeButton
{
id: closeBtn
visible: headerClose
width: parent.height
height: parent.height
iconName: "window-close" //"dialog-close"
onClicked: headerClosed()
}
......@@ -115,10 +115,8 @@ ListView
{
id: playAllBtn
Layout.fillHeight: true
width: parent.height
height: parent.height
iconName: /*"amarok_clock"*/ "player-time"
iconName: /*"amarok_clock"*/ "media-playback-start"
onClicked: playAll()
}
......@@ -128,10 +126,10 @@ ListView
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
elide: Text.ElideRight
font.pointSize: 12
font.bold: true
lineHeight: 0.7
font.bold: isMobile
color: bae.foregroundColor()
horizontalAlignment: Text.AlignHCenter
......@@ -142,11 +140,8 @@ ListView
{
id: appendBtn
Layout.fillHeight: true
width: parent.height
height: parent.height
iconName : "archive-insert"//"media-repeat-track-amarok"
onClicked: appendAll()
}
......@@ -154,9 +149,6 @@ ListView
{
id: menuBtn
Layout.fillHeight: true
width: parent.height
height: parent.height
iconName: /*"application-menu"*/ "overflow-menu"
onClicked: {}
}
......@@ -183,12 +175,13 @@ ListView
coverArt : coverArtVisible
trackDurationVisible : list.trackDuration
trackRatingVisible : list.trackRating
menuItem: menuItemVisible
Connections
{
target: delegate
onPressAndHold: if(root.isMobile) openItemMenu(index)
// onPressAndHold: if(root.isMobile) openItemMenu(index)
onRightClicked: openItemMenu(index)
onClicked:
......
......@@ -36,7 +36,7 @@ ItemDelegate
property bool number : false
property bool quickPlay : true
property bool coverArt : false
property bool menuItem : false
property bool trackDurationVisible : false
property bool trackRatingVisible: false
// property bool playingIndicator: false
......@@ -54,8 +54,8 @@ ItemDelegate
anchors.fill: parent
color:
{
if(trackMood.length>0)
Qt.lighter(trackMood)
if(trackMood.length > 0)
trackMood
else
index % 2 === 0 ? bae.midColor() : "transparent"
}
......@@ -128,7 +128,6 @@ ItemDelegate
iconName: "media-playback-start"
iconColor: textColor
onClicked: play()
iconSize: isMobile ? 24 : 22
}
}
......@@ -177,12 +176,13 @@ ItemDelegate
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 1
// Layout.rowSpan: sameAlbum ? 2 : 1
Layout.column: 2
verticalAlignment: Qt.AlignVCenter
text: title
font.bold: !sameAlbum
elide: Text.ElideRight
visible: true
font.pointSize: 10
color: textColor
......@@ -196,7 +196,6 @@ ItemDelegate
Layout.fillHeight: true
Layout.row: 2
Layout.column: 2
Layout.rowSpan: sameAlbum && coverArt ? 2 : 1
verticalAlignment: Qt.AlignVCenter
text: artist + " | " + album
font.bold: false
......@@ -266,6 +265,22 @@ ItemDelegate
}
}
}
Item
{
visible: menuItem
Layout.fillHeight: true
width: sameAlbum ? rowHeight : parent.height
BabeButton
{
id: menuBtn
anchors.centerIn: parent
iconName: "overflow-menu"
iconColor: textColor
onClicked: rightClicked()
}
}
}
function setStars(stars)
......
......@@ -7,7 +7,6 @@ Item
property int recSize : 16
signal colorClicked(string color)
RowLayout
{
anchors.fill: parent
......
......@@ -87,6 +87,7 @@ BabeGrid
headerBar: true
headerClose: true
coverArtVisible: true
quickPlayVisible: true
onRowClicked:
{
......@@ -111,7 +112,7 @@ BabeGrid
drawer.close()
var data = albumsViewGrid.gridModel.get(albumsViewGrid.grid.currentIndex)
var query = Q.Query.albumTracks_.arg(data.album)
var query = Q.GET.albumTracks_.arg(data.album)
query = query.arg(data.artist)
var tracks = bae.get(query)
......@@ -121,7 +122,7 @@ BabeGrid
onAppendAll:
{
var data = albumsView.gridModel.get(albumsViewGrid.grid.currentIndex)
var query = Q.Query.albumTracks_.arg(data.album)
var query = Q.GET.albumTracks_.arg(data.album)
query = query.arg(data.artist)
var tracks = bae.get(query)
albumsViewGrid.appendAlbum(tracks)
......@@ -140,7 +141,7 @@ BabeGrid
drawer.open()
drawerList.clearTable()
var query = Q.Query.albumTracks_.arg(album)
var query = Q.GET.albumTracks_.arg(album)
query = query.arg(artist)
var map = bae.get(query)
......@@ -153,7 +154,7 @@ BabeGrid
function populate()
{
var map = bae.get(Q.Query.allAlbumsAsc)
var map = bae.get(Q.GET.allAlbumsAsc)
if(map.length > 0)
for(var i in map)
......
......@@ -98,7 +98,7 @@ BabeGrid
drawer.close()
var data = artistsViewGrid.gridModel.get(artistsViewGrid.grid.currentIndex)
var query = Q.Query.artistTracks_.arg(data.artist)
var query = Q.GET.artistTracks_.arg(data.artist)
var tracks = bae.get(query)
artistsViewGrid.playAlbum(tracks)
}
......@@ -106,7 +106,7 @@ BabeGrid
onAppendAll:
{
var data = artistsViewGrid.gridModel.get(artistsViewGrid.grid.currentIndex)
var query = Q.Query.artistTracks_.arg(data.artist)
var query = Q.GET.artistTracks_.arg(data.artist)
var tracks = bae.get(query)
artistsViewGrid.appendAlbum(tracks)
drawer.close()
......@@ -122,7 +122,7 @@ BabeGrid
drawerList.headerTitle = artist
drawer.open()
drawerList.clearTable()
var query = Q.Query.artistTracks_.arg(artist)
var query = Q.GET.artistTracks_.arg(artist)
var map = bae.get(query)
if(map.length > 0)
......@@ -133,7 +133,7 @@ BabeGrid
function populate()
{
var map = bae.get(Q.Query.allArtistsAsc)
var map = bae.get(Q.GET.allArtistsAsc)
if(map.length > 0)
for(var i in map)
......
......@@ -14,6 +14,7 @@ ToolBar
property string backgroundColor : bae.backgroundColor()
property int size : 24
property int currentIndex : 0
property bool accent : pageStack.wideMode || (!pageStack.wideMode && pageStack.currentIndex === 1)
signal tracksViewClicked()
signal albumsViewClicked()
......@@ -60,7 +61,7 @@ ToolBar
{
id: playlistView
iconName: /*"headphones"*/ "media-optical-audio"
iconColor: pageStack.currentIndex === 0 ? accentColor : textColor
iconColor: pageStack.wideMode || pageStack.currentIndex === 0 ? accentColor : textColor
iconSize: size
onClicked: playlistViewClicked()
......@@ -81,7 +82,7 @@ ToolBar
{
id: tracksView
iconName: /*"musicnote"*/ "filename-filetype-amarok"
iconColor: currentIndex === 0? accentColor : textColor
iconColor: accent && currentIndex === 0? accentColor : textColor
iconSize: size
onClicked: tracksViewClicked()
......@@ -96,7 +97,7 @@ ToolBar
{
id: albumsView
iconName: /*"album" */ "media-album-cover"
iconColor: currentIndex === 1? accentColor : textColor
iconColor: accent && currentIndex === 1 ? accentColor : textColor
iconSize: size
onClicked: albumsViewClicked()
......@@ -112,7 +113,7 @@ ToolBar
id: artistsView
iconName: /*"artist" */ "view-media-artist"
iconColor: currentIndex === 2? accentColor : textColor
iconColor: accent && currentIndex === 2? accentColor : textColor
iconSize: size
onClicked: artistsViewClicked()
......@@ -128,7 +129,7 @@ ToolBar
id: playlistsView
iconName: /*"library-music"*/ "view-media-playlist"
iconColor: currentIndex === 3? accentColor : textColor
iconColor: accent && currentIndex === 3? accentColor : textColor
iconSize: size
onClicked: playlistsViewClicked()
......
......@@ -97,7 +97,7 @@ Item
anchors.fill: parent
onDoubleClicked:
{
var query = Q.Query.albumTracks_.arg(currentTrack.album)
var query = Q.GET.albumTracks_.arg(currentTrack.album)
query = query.arg(currentTrack.artist)
var tracks = bae.get(query)
......@@ -106,7 +106,7 @@ Item
onPressAndHold:
{
var query = Q.Query.albumTracks_.arg(currentTrack.album)
var query = Q.GET.albumTracks_.arg(currentTrack.album)
query = query.arg(currentTrack.artist)
var tracks = bae.get(query)
coverPressed(tracks)
......@@ -507,7 +507,7 @@ Item
onRowClicked: Player.playTrack(model.get(index))
onArtworkDoubleClicked:
{
var query = Q.Query.albumTracks_.arg(model.get(index).album)
var query = Q.GET.albumTracks_.arg(model.get(index).album)
query = query.arg(model.get(index).artist)
Player.playAll(bae.get(query))
......@@ -515,6 +515,8 @@ Item
}
holder.message: "Empty playlist..."
holder.emoji: "qrc:/assets/face-sleeping.png"
Component.onCompleted:
{
var list = bae.lastPlaylist()
......@@ -525,14 +527,14 @@ Item
for(var i = 0; i < n; i++)
{
var where = "url = \""+list[i]+"\""
var query = Q.Query.tracksWhere_.arg(where)
var query = Q.GET.tracksWhere_.arg(where)
var track = bae.get(query)
Player.appendTrack(track[0])
}
}else
{
var where = "babe = 1"
var query = Q.Query.tracksWhere_.arg(where)
var query = Q.GET.tracksWhere_.arg(where)
var tracks = bae.get(query)
for(var pos=0; pos< tracks.length; pos++)
......
......@@ -69,7 +69,7 @@ ItemDelegate
width: parent.width
verticalAlignment: Qt.AlignVCenter
text: playlist
font.bold: playlistIcon ? true : false
font.bold: false
elide: Text.ElideRight
font.pointSize: 10
......
......@@ -5,7 +5,7 @@ import org.kde.kirigami 2.2 as Kirigami
import "../../view_models/BabeTable"
import "../../view_models"
import "../../db/Queries.js" as Q
// transform: Translate
......@@ -16,15 +16,19 @@ import "../../view_models"
Kirigami.PageRow
{
id: playlistViewRoot
property string playlistQuery
signal rowClicked(var track)
signal quickPlayTrack(var track)
signal playAll(var tracks)
signal appendAll(var tracks)
clip: true
separatorVisible: wideMode
initialPage:[playlistList, playlistViewDrawer]
defaultColumnWidth: Kirigami.Units.gridUnit * 15
Page
interactive: false
Page
{
id: playlistList
ColumnLayout
......@@ -53,7 +57,12 @@ Kirigami.PageRow
z: -999
color:bae.midColor()
}
// onColorClicked: moodIt(color)
onColorClicked:
{
populate(Q.GET.colorTracks_.arg(color))
if(!playlistViewRoot.wideMode)
playlistViewRoot.currentIndex = 1
}
}
......@@ -88,15 +97,16 @@ Kirigami.PageRow
height: parent.height
quickPlayVisible: true
coverArtVisible: true
trackRating: true
trackDuration: true
// trackRating: true
// trackDuration: true
headerBar: true
headerClose: !playlistViewRoot.wideMode
headerTitle: playlistViewModel.model.get(playlistViewModel.currentIndex).playlist
headerTitle: playlistViewRoot.wideMode ? "" : playlistViewModel.model.get(playlistViewModel.currentIndex).playlist
onHeaderClosed: if(!playlistViewRoot.wideMode)
playlistViewRoot.currentIndex = 0
holder.message: "Select a playlist or create a new one"
holder.emoji: "qrc:/assets/face-hug.png"
Connections
{
......@@ -104,11 +114,10 @@ Kirigami.PageRow
onRowClicked: playlistViewRoot.rowClicked(filterList.model.get(index))
onQuickPlayTrack:
{
// playlistViewDrawer.close()
playlistViewRoot.quickPlayTrack(filterList.model.get(index))
}
// onPlayAll: Player.playAll(bae.get(Q.Query.allTracks))
// onAppendAll: Player.appendAll(bae.get(Q.Query.allTracks))
onPlayAll: playAll(bae.get(playlistQuery))
onAppendAll: appendAll(bae.get(playlistQuery))
}
}