Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9b25e58b authored by Camilo Higuita's avatar Camilo Higuita

continue cleanup and add mauikit tagbar for albums view

parent 3a6d706c
......@@ -40,7 +40,9 @@ Maui.ApplicationWindow
// flags: Qt.FramelessWindowHint
title: qsTr("vvave")
/*ALIASES*/
/***************************************************/
/******************** ALIASES ********************/
/*************************************************/
property alias playIcon: playIcon
property alias babeBtnIcon: babeBtnIcon
property alias progressBar: progressBar
......@@ -51,7 +53,7 @@ Maui.ApplicationWindow
/******************** PLAYBACK ********************/
/*************************************************/
property bool isShuffle: false
property bool isShuffle: bae.loadSetting("SHUFFLE","PLAYBACK", false) == "true" ? true : false
property var currentTrack: ({
babe: "0",
stars: "0"
......@@ -105,7 +107,7 @@ Maui.ApplicationWindow
property string syncPlaylist: ""
property bool sync: false
property string infoMsg: ""
property bool infoLabels: bae.loadSetting("PLAYBACKINFO", "BABE", false) == "true" ? true : false
property bool infoLabels: bae.loadSetting("LABELS", "PLAYBACK", false) == "true" ? true : false
property bool isLinked: false
property bool isServing: false
......@@ -219,9 +221,7 @@ Maui.ApplicationWindow
/* UI */
property bool accent : pageStack.wideMode || (!pageStack.wideMode && pageStack.currentIndex === 1)
headBar.middleContent : Row
{
spacing: space.medium
headBar.middleContent : [
Maui.ToolButton
{
......@@ -236,7 +236,7 @@ Maui.ApplicationWindow
}
text: qsTr("Tracks")
}
},
Maui.ToolButton
{
......@@ -251,7 +251,7 @@ Maui.ApplicationWindow
albumsView.currentIndex = 0
currentView = viewsIndex.albums
}
}
},
Maui.ToolButton
{
......@@ -266,7 +266,7 @@ Maui.ApplicationWindow
artistsView.currentIndex = 0
currentView = viewsIndex.artists
}
}
},
Maui.ToolButton
{
......@@ -281,7 +281,7 @@ Maui.ApplicationWindow
currentView = viewsIndex.playlists
}
}
}
]
onSearchButtonClicked:
......@@ -294,9 +294,21 @@ Maui.ApplicationWindow
footBar.z : 0
pageStack.z: 0
footBar.middleContent: Row
footBar.leftContent: Label
{
spacing: space.medium
visible: !mainlistEmpty && infoLabels
text: progressTimeLabel
color: darkTextColor
}
footBar.rightContent: Label
{
visible: !mainlistEmpty && infoLabels
text: durationTimeLabel
color: darkTextColor
}
footBar.middleContent: [
Maui.ToolButton
{
......@@ -305,12 +317,12 @@ Maui.ApplicationWindow
iconColor: currentBabe ? babeColor : darkTextColor
onClicked: if (!mainlistEmpty)
{
var value = mainPlaylist.contextMenu.babeIt(
currentTrackIndex)
currentBabe = value
}
}
{
var value = mainPlaylist.contextMenu.babeIt(
currentTrackIndex)
currentBabe = value
}
},
Maui.ToolButton
{
......@@ -318,7 +330,7 @@ Maui.ApplicationWindow
iconColor: darkTextColor
onClicked: Player.previousTrack()
onPressAndHold: Player.playAt(prevTrackIndex)
}
},
Maui.ToolButton
{
......@@ -328,11 +340,11 @@ Maui.ApplicationWindow
onClicked:
{
if (isPlaying)
Player.pauseTrack()
Player.pauseTrack()
else
Player.resumeTrack()
Player.resumeTrack()
}
}
},
Maui.ToolButton
{
......@@ -341,38 +353,20 @@ Maui.ApplicationWindow
iconName: "media-skip-forward"
onClicked: Player.nextTrack()
onPressAndHold: Player.playAt(Player.shuffle())
}
},
Maui.PieButton
Maui.ToolButton
{
id: shuffleBtn
iconColor: darkTextColor
iconName: isShuffle ? "media-playlist-shuffle" : "media-playlist-repeat"
delegateSize: iconSizes.large + space.big
// onClicked: isShuffle = !isShuffle
model: mainPlaylist.list.model
delegate: BabeAlbum
onClicked:
{
id: delegate
itemWidth: iconSizes.large + space.big
itemHeight: itemWidth
albumSize: iconSizes.large
showIndicator: false
showLabels: false
albumRadius: itemWidth
Connections
{
target: delegate
onClicked:
{
shuffleBtn.close()
Player.playAt(index)
}
}
isShuffle = !isShuffle
bae.saveSetting("SHUFFLE",isShuffle, "PLAYBACK")
}
}
}
]
......@@ -513,42 +507,6 @@ Maui.ApplicationWindow
id: fmDialog
}
// Item
// {
// Layout.alignment: Qt.AlignCenter
// Layout.fillWidth: true
// Layout.fillHeight: true
// Layout.row: 2
// Layout.column: 2
// Layout.maximumHeight: playbackInfo.visible ? playbackInfo.font.pointSize * 2 : 0
// Label
// {
// id: playbackInfo
// visible: !mainlistEmpty && infoLabels
// // anchors.top: playIcon.bottom
// // anchors.horizontalCenter: playIcon.horizontalCenter
// width: parent.width
// height: parent.height
// horizontalAlignment: Qt.AlignHCenter
// verticalAlignment: Qt.AlignVCenter
// text: progressTimeLabel + " / " + (currentTrack ? (currentTrack.title ? currentTrack.title + " - " + currentTrack.artist : "--- - " + currentTrack.artist) : "") + " / " + durationTimeLabel
// color: darkTextColor
// font.pointSize: fontSizes.small
// elide: Text.ElideRight
// }
// }
// background: Rectangle
// {
// anchors.fill: parent
// color: altColor
// z: -999
// }
SourcesDialog
{
id: sourcesDialog
......@@ -740,7 +698,7 @@ Maui.ApplicationWindow
onToggled:
{
infoLabels = checked
bae.saveSetting("PLAYBACKINFO", infoLabels ? true : false, "BABE")
bae.saveSetting("LABELS", infoLabels ? true : false, "PLAYBACK")
}
}
......
......@@ -44,7 +44,6 @@
<file>assets/beat-banner.png</file>
<file>assets/beat2.png</file>
<file>assets/beat.svg</file>
<file>view_models/BabeMenu/BabeMenuItem.qml</file>
<file>view_models/BabeMenu/BabeMenu.qml</file>
<file>view_models/BabeDialog/BabeMessage.qml</file>
<file>view_models/BabeDialog/BabeDialog.qml</file>
......@@ -80,5 +79,6 @@
<file>widgets/FloatingDisk.qml</file>
<file>services/web/WebView.qml</file>
<file>services/web/WebView_A.qml</file>
<file>view_models/BabeTable/GroupDialog.qml</file>
</qresource>
</RCC>
import QtQuick 2.0
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
MenuItem
{
// hoverEnabled: true
}
......@@ -25,6 +25,8 @@ BabeList
property bool isArtworkRemote : false
property bool showIndicator : false
property string sortBy: "undefined"
property alias headerMenu: headerMenu
property alias contextMenu : contextMenu
......@@ -80,6 +82,14 @@ BabeList
id: headerMenu
onSaveListClicked: saveList()
onQueueListClicked: queueList()
onSortClicked: groupDialog.popup()
}
GroupDialog
{
id: groupDialog
onSortBy: sortBy = babeTableRoot.sortBy = text
}
TableMenu
......@@ -89,15 +99,20 @@ BabeList
list.highlightFollowsCurrentItem: false
list.highlightMoveDuration: 0
list.highlight: Rectangle
{
}
list.highlight: Rectangle { }
ListModel { id: listModel }
model: listModel
section.property : sortBy
section.criteria: ViewSection.FullString
section.delegate: Maui.LabelDelegate
{
label: section
isSection: true
boldLabel: true
}
// property alias animBabe: delegate.animBabe
delegate: TableDelegate
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
import QtQuick.Layouts 1.3
import "../../view_models/BabeMenu"
import "../../view_models"
import "../../utils/Player.js" as Player
import "../../db/Queries.js" as Q
BabeMenu
{
signal sortBy(string text)
MenuItem
{
text: "Artist"
onTriggered: sortBy("artist")
}
MenuItem
{
text: "Album"
onTriggered: sortBy("album")
}
MenuItem
{
text: "Genre"
onTriggered: sortBy("genre")
}
MenuItem
{
text: "Stars"
onTriggered: sortBy("stars")
}
}
......@@ -12,14 +12,14 @@ BabeMenu
{
signal saveListClicked()
signal queueListClicked()
signal sortClicked()
property alias menuItem: babeMenu.children
Column
{
id: babeMenu
BabeMenuItem
MenuItem
{
text: "Queue list"
onTriggered:
......@@ -29,7 +29,7 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: "Save list to..."
onTriggered:
......@@ -39,14 +39,14 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: "Send list to..."
}
Kirigami.Separator{ width: parent.width; height: 1}
BabeMenuItem
MenuItem
{
text: "Visible info..."
onTriggered: {close()}
......@@ -54,10 +54,14 @@ BabeMenu
Kirigami.Separator{ width: parent.width; height: 1}
BabeMenuItem
MenuItem
{
text: "Sort..."
onTriggered: {close()}
onTriggered:
{
sortClicked()
close()
}
}
}
......
......@@ -80,7 +80,7 @@ BabeMenu
color: textColor
}
BabeMenuItem
MenuItem
{
text: babe == false ? "Babe it" : "UnBabe it"
onTriggered:
......@@ -90,7 +90,7 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: "Queue"
onTriggered:
......@@ -100,7 +100,7 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: "Save to..."
onTriggered:
......@@ -111,7 +111,7 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: isAndroid ? qsTr("Open with...") : qsTr("Show in folder...")
......@@ -124,13 +124,13 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: "Edit..."
onTriggered: {close()}
}
BabeMenuItem
MenuItem
{
text: "Share..."
onTriggered:
......@@ -141,7 +141,7 @@ BabeMenu
}
}
BabeMenuItem
MenuItem
{
text: "Remove"
onTriggered:
......@@ -157,7 +157,7 @@ BabeMenu
id: customItems
}
BabeMenuItem
MenuItem
{
id: starsRow
width: parent.width
......@@ -223,7 +223,7 @@ BabeMenu
}
BabeMenuItem
MenuItem
{
id: colorsRow
width: parent.width
......
......@@ -7,6 +7,7 @@ import "../view_models/BabeTable"
import "../db/Queries.js" as Q
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
Kirigami.PageRow
......@@ -14,7 +15,7 @@ Kirigami.PageRow
id: albumsPageRoot
clip: true
separatorVisible: wideMode
initialPage: [albumsViewGrid, albumsViewTable]
initialPage: [albumsViewGrid, albumFilter]
defaultColumnWidth: albumsViewGrid.albumCoverSize * 4
interactive: currentIndex === 1
......@@ -39,48 +40,62 @@ Kirigami.PageRow
}
BabeTable
ColumnLayout
{
id: albumsViewTable
id: albumFilter
anchors.fill: parent
trackNumberVisible: true
headBarVisible: true
headBarExit: !albumsPageRoot.wideMode
headBarExitIcon: "go-previous"
coverArtVisible: true
quickPlayVisible: true
focus: true
onRowClicked:
{
albumsPageRoot.rowClicked(model.get(index))
}
spacing: 0
onQuickPlayTrack:
BabeTable
{
albumsPageRoot.playTrack(model.get(index))
}
id: albumsViewTable
Layout.fillHeight: true
Layout.fillWidth: true
trackNumberVisible: true
headBarVisible: true
headBarExit: !albumsPageRoot.wideMode
headBarExitIcon: "go-previous"
coverArtVisible: true
quickPlayVisible: true
focus: true
onRowClicked:
{
albumsPageRoot.rowClicked(model.get(index))
}
onQuickPlayTrack:
{
albumsPageRoot.playTrack(model.get(index))
}
onQueueTrack:
{
albumsPageRoot.queueTrack(model.get(index))
}
onPlayAll:
{
albumsPageRoot.currentIndex = 0
var data = albumsViewGrid.gridModel.get(albumsViewGrid.grid.currentIndex)
albumsPageRoot.playAll(data.album, data.artist)
}
onAppendAll:
{
albumsPageRoot.currentIndex = 0
var data = albumsViewGrid.gridModel.get(albumsViewGrid.grid.currentIndex)
albumsPageRoot.appendAll(data.album, data.artist)
}
onExit: albumsPageRoot.currentIndex = 0
onQueueTrack:
{
albumsPageRoot.queueTrack(model.get(index))
}
onPlayAll:
Maui.TagsBar
{
albumsPageRoot.currentIndex = 0
var data = albumsViewGrid.gridModel.get(albumsViewGrid.grid.currentIndex)
albumsPageRoot.playAll(data.album, data.artist)
Layout.fillWidth: true
allowEditMode: true
}
onAppendAll:
{
albumsPageRoot.currentIndex = 0
var data = albumsViewGrid.gridModel.get(albumsViewGrid.grid.currentIndex)
albumsPageRoot.appendAll(data.album, data.artist)
}
onExit: albumsPageRoot.currentIndex = 0
}
function populate(query)
......
......@@ -10,37 +10,37 @@ BabeMenu
signal callibrate()
signal hideCover()
signal saveToClicked()
BabeMenuItem
MenuItem
{
text: qsTr("Clear out...")
onTriggered: clearOut()
}
BabeMenuItem
MenuItem
{
text: qsTr("Clean...")
onTriggered: clean()
}
BabeMenuItem
MenuItem
{
text: cover.visible ? qsTr("Hide cover...") : qsTr("Show cover...")
onTriggered: hideCover()
}
BabeMenuItem
MenuItem
{
text: qsTr("Callibrate")
onTriggered: callibrate()
}
BabeMenuItem
MenuItem
{
text: qsTr("Save list to...")
onTriggered: saveToClicked()
}
BabeMenuItem
MenuItem
{
enabled: syncPlaylist.length > 0
text: syncPlaylist.length > 0 && sync ? qsTr("Pause syncing") : qsTr("Continue syncing")
......
......@@ -125,13 +125,13 @@ Kirigami.PageRow
holder.emoji: "qrc:/assets/face-hug.png"
headerMenu.menuItem: [
BabeMenuItem
MenuItem
{
enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon
text: "Sync tags"
onTriggered: {}
},
BabeMenuItem
MenuItem
{
enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon
text: "Play-n-Sync"
......@@ -141,7 +141,7 @@ Kirigami.PageRow
syncAndPlay(playlistViewModel.currentIndex)
}
},
BabeMenuItem
MenuItem
{
enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon
text: "Remove playlist"
......@@ -152,7 +152,7 @@ Kirigami.PageRow
// contextMenu.menuItem: [
// BabeMenuItem
// MenuItem
// {
// text: qsTr("Remove from playlist")
// onTriggered:
......
......@@ -29,7 +29,6 @@ BabePopup
}
}
BabeList
{
id: sources
......
......@@ -14,16 +14,7 @@ BabeTable
headBarTitle: count + " tracks"
headBarExit: false
coverArtVisible: false
section.property : "album"
section.criteria: ViewSection.FullString
section.delegate: Maui.LabelDelegate
{
id: delegate
label: section
isSection: true
boldLabel: true
}
sortBy: "album"
function populate()
{
......
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