Commit 99d5fe15 authored by Camilo Higuita's avatar Camilo Higuita

fixes on sizes and work starts for the babeit platform integration

parent deed22cd
......@@ -47,6 +47,7 @@ Kirigami.ApplicationWindow
property bool currentBabe : currentTrack.babe == "0" ? false : true
property string durationTimeLabel : "00:00"
property string progressTimeLabel : "00:00"
property bool isPlaying : false
/*THEMING*/
property string babeColor : bae.babeColor()
......@@ -95,14 +96,14 @@ Kirigami.ApplicationWindow
/*READONLY PROPS*/
readonly property var iconSizes : ({ "small" : 16, "medium" : isMobile ? 24 : 22, "big" : 32, "large" : 48 })
readonly property var fontSizes : ({"tiny": isMobile ? 6.5 : 7, "small" : isMobile ? 8.5 : 8, "medium" : isMobile ? 9 : 9.5, "big" : isMobile ? 10 : 10.5, "large" : isMobile ? 11 : 11.5})
readonly property var fontSizes : ({"tiny": isMobile ? 7.5 : 7, "small" : isMobile ? 9.5 : 8.5, "medium" : isMobile ? 11 : 10, "big" : isMobile ? 11.5 : 10.5, "large" : isMobile ? 12 : 11.5})
readonly property real opacityLevel : 0.8
readonly property bool isMobile: bae.isMobile()
readonly property int wideSize : bae.screenGeometry("width")*0.5
readonly property int rowHeight: isMobile ? 64 : 52
readonly property int rowHeight: isMobile ? 60 : 52
readonly property int rowHeightAlt: isMobile ? 48 : 32
readonly property int headerHeight: rowHeight
readonly property int contentMargins : 12
readonly property int contentMargins : isMobile ? 8 : 10
readonly property var viewsIndex : ({
"babeit": 0,
"tracks" : 1,
......@@ -111,7 +112,7 @@ Kirigami.ApplicationWindow
"playlists" : 4,
"search" : 5
})
readonly property bool mainlistEmpty : mainPlaylist.table.count > 0
property bool mainlistEmpty : mainPlaylist.table.count > 0 ? true : false
/*PROPS*/
property int toolBarIconSize: bae.loadSetting("ICON_SIZE", "BABE", iconSizes.medium)
......@@ -179,6 +180,7 @@ Kirigami.ApplicationWindow
Component.onCompleted:
{
if(isMobile) settingsDrawer.switchColorScheme(bae.loadSetting("THEME", "BABE", "Dark"))
settingsDrawer.visible = false
}
......@@ -206,6 +208,7 @@ Kirigami.ApplicationWindow
onTiming: progressTimeLabel = time
onDurationChanged: durationTimeLabel = time
onFinished: Player.nextTrack()
onIsPlaying: isPlaying = playing
}
Connections
......@@ -460,7 +463,7 @@ Kirigami.ApplicationWindow
verticalAlignment: Qt.AlignVCenter
text: progressTimeLabel + " / " + (currentTrack ? (currentTrack.title ? currentTrack.title + " - " + currentTrack.artist : "--- - "+currentTrack.artist) : "") + " / " + durationTimeLabel
color: foregroundColor
font.pointSize: fontSizes.small
font.pointSize: fontSizes.tiny
elide: Text.ElideRight
}
......@@ -511,7 +514,7 @@ Kirigami.ApplicationWindow
Layout.row: 1
Layout.column: 4
iconName: "media-playback-start"
iconName: isPlaying ? "media-playback-pause" : "media-playback-start"
onClicked:
{
if(player.isPaused()) Player.resumeTrack()
......
......@@ -27,7 +27,7 @@ void Player::play()
if(sourceurl.isEmpty()) return;
if(!updater->isActive())
this->updater->start(1000);
this->updater->start(250);
this->player->play();
}
......@@ -72,6 +72,7 @@ void Player::update()
{
emit this->pos(static_cast<int>(static_cast<double>(this->player->position())/this->player->duration()*1000));
emit this->timing(BAE::transformTime(player->position()/1000));
emit this->isPlaying(this->player->state() == QMediaPlayer::PlayingState ? true : false);
if(this->player->state() == QMediaPlayer::StoppedState)
emit this->finished();
}
......@@ -32,6 +32,7 @@ signals:
void finished();
void timing(QString time);
void durationChanged(QString time);
void isPlaying(bool playing);
public slots:
};
......
......@@ -1657,7 +1657,6 @@ var Icon = {
var Babe = {
/*toolbar*/
"media-optical-audio": Icon.headphones,
"audio-headphones": Icon.headphones,
"headphones": Icon.headphones,
......@@ -1677,6 +1676,9 @@ var Babe = {
"application-menu": Icon.menu,
"games-config-options" : Icon.settings,
"edit-comment" : Icon.comment,
"view-filter" : Icon.filter,
/*playback bar*/
"documentinfo" :Icon.informationOutline,
......
......@@ -11,7 +11,7 @@ function playTrack(track)
{
player.source(root.currentTrack.url);
player.play()
root.playIcon.iconName = "media-playback-pause"
// root.playIcon.iconName = "media-playback-pause"
var artwork = root.currentTrack.artwork
// root.mainPlaylist.list.currentItem.playingIndicator = true
......@@ -45,22 +45,23 @@ function playTrack(track)
function stop()
{
player.stop()
root.mainPlaylist.progressBar.value = 0
root.mainPlaylist.cover.visible = false
root.progressBar.value = 0
root.mainlistEmpty = false
root.title = "Babe..."
root.playIcon.iconName = "media-playback-start"
// root.playIcon.iconName = "media-playback-start"
}
function pauseTrack()
{
player.pause()
root.playIcon.iconName = "media-playback-start"
// root.playIcon.iconName = "media-playback-start"
}
function resumeTrack()
{
player.play()
root.playIcon.iconName = "media-playback-pause"
// root.playIcon.iconName = "media-playback-pause"
}
function nextTrack()
......
......@@ -16,7 +16,6 @@ ColumnLayout
property bool albumCard : true
property string fillColor: midLightColor
property string textColor: foregroundColor
property int fontSize : fontSizes.big
property bool hide : false
// height: typeof album === 'undefined' ? parseInt(albumSize+(albumSize*0.3)) : parseInt(albumSize+(albumSize*0.4))
......@@ -92,6 +91,7 @@ ColumnLayout
Column
{
id: albumInfoRow
Layout.maximumHeight: rowHeight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: contentMargins
......@@ -120,7 +120,6 @@ ColumnLayout
font.pointSize: fontSizes.small
color: textColor
}
}
MouseArea
......
......@@ -25,6 +25,7 @@ Pane
// }
// }
readonly property int albumSpacing: contentMargins*2
property int albumCoverRadius : 0
property bool albumCardVisible : true
property alias gridModel: gridModel
......@@ -78,8 +79,8 @@ Pane
anchors.horizontalCenter: parent.horizontalCenter
cellWidth: albumCoverSize +(albumCoverSize*0.2)
cellHeight: albumCoverSize+(albumCoverSize*0.8)
cellWidth: albumCoverSize + albumSpacing
cellHeight: albumCoverSize+rowHeight+albumSpacing
highlightFollowsCurrentItem: false
......
......@@ -96,7 +96,7 @@ Item
elide : Text.ElideRight
font.bold : false
color : foregroundColor
font.pointSize: fontSizes.big
horizontalAlignment : Text.AlignHCenter
verticalAlignment : Text.AlignVCenter
}
......
......@@ -11,7 +11,6 @@ BabeList
holder.message: "<h2>This list is empty</h2><p>You can sdd new music sources from the settings</p>"
// cacheBuffer : 300
headerBarColor: midLightColor
property bool trackNumberVisible
property bool quickPlayVisible : true
property bool coverArtVisible : false
......
......@@ -45,6 +45,11 @@ BabeMenu
Kirigami.Separator{ width: parent.width; height: 1}
BabeMenuItem
{
text: "Sort..."
onTriggered: {}
}
}
}
......@@ -45,10 +45,11 @@ BabeGrid
else
customHeight
}
}
x: pageStack.wideMode ? columnWidth+1 : 0
width: pageStack.wideMode ? albumsViewGrid.width-1 : albumsViewGrid.width
edge: Qt.BottomEdge
interactive: false
focus: true
......@@ -78,7 +79,6 @@ BabeGrid
}
}
BabeTable
{
id: drawerList
......
......@@ -55,6 +55,9 @@ ToolBar
BabeButton
{
id: settingsView
Layout.leftMargin: isMobile ? 0 : contentMargins
Layout.alignment: Qt.AlignLeft
iconName: "application-menu"
iconColor: settingsDrawer.visible ? babeColor : textColor/*(pageStack.wideMode || pageStack.currentIndex === 0 ) && !isMobile ? accentColor : textColor*/
onClicked: settingsViewClicked()
......@@ -153,6 +156,8 @@ ToolBar
BabeButton
{
id: searchView
Layout.rightMargin: isMobile ? 0 : contentMargins
Layout.alignment: Qt.AlignRight
// visible: !(searchInput.focus || searchInput.text)
iconColor: accent && currentIndex === viewsIndex.search ? accentColor : textColor
iconName: "edit-find" //"search"
......
......@@ -24,6 +24,7 @@ Item
property alias table: table
property alias infoView : infoView
property alias contextMenu : table.contextMenu
property alias mainlistContext : mainlistContext
property alias headerMenu : table.headerMenu
property alias stack : stackView
......@@ -63,8 +64,7 @@ Item
Layout.fillWidth: true
Layout.preferredHeight: visible ? coverSize : 0
Layout.maximumHeight: 300
visible: mainlistEmpty
visible: root.mainlistEmpty
Rectangle
{
visible: cover.visible
......@@ -114,13 +114,13 @@ Item
{
id: mainlistContext
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
Layout.row: 2
Layout.column: 1
Layout.fillWidth: true
Layout.preferredHeight: visible ? toolBarHeight : 0
// anchors.top: cover.bottom
visible: mainlistEmpty
Rectangle
{
......@@ -196,6 +196,18 @@ Item
}
}
Item
{
Layout.fillWidth: true
BabeButton
{
id: commentBtn
anchors.centerIn: parent
Layout.fillWidth: true
iconName: "edit-comment"
}
}
Item
{
Layout.fillWidth: true
......
......@@ -83,7 +83,6 @@ Kirigami.PageRow
playlistViewRoot.currentIndex = 1
}
}
}
}
......
......@@ -58,8 +58,7 @@ Item
Layout.fillWidth: true
trackNumberVisible: false
headerBarVisible: true
headerBarExit: true
headerBarExitIcon: "arrow-left"
headerBarExit: false
holder.message: "No search results!"
coverArtVisible: true
trackDuration: true
......@@ -74,7 +73,6 @@ Item
width: parent.width
height: toolBarHeight
color: searchInput.activeFocus ? midColor : midLightColor
Kirigami.Separator
{
Rectangle
......@@ -94,10 +92,12 @@ Item
RowLayout
{
anchors.fill: parent
BabeButton
{
Layout.leftMargin: contentMargins
visible: true
iconName: "edit-find"
iconName: "view-filter"
onClicked: {}
}
......@@ -118,6 +118,7 @@ Item
BabeButton
{
Layout.rightMargin: contentMargins
visible: searchInput.text.length > 0
iconName: "edit-clear"
onClicked: clearSearch()
......
......@@ -10,6 +10,7 @@ Kirigami.GlobalDrawer
signal iconSizeChanged(int size)
readonly property bool activeBrainz : bae.brainzState()
visible: false
y: header.height
height: parent.height - header.height - footer.height
// // width: root.pageStack.wideMode ? views.width -1: root.width
......@@ -141,7 +142,7 @@ Kirigami.GlobalDrawer
Kirigami.Action
{
text: checked ? "ON" : "OFF"
checked: timeLabels
checked: infoLabels
checkable: true
onToggled:
{
......
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