Commit 86ee28f0 authored by Camilo Higuita's avatar Camilo Higuita

late fixes

parent d691cd64
......@@ -59,7 +59,7 @@ Kirigami.ApplicationWindow
property string babeColor : bae.babeColor()
property string babeAltColor : bae.babeAltColor()
property string backgroundColor : isMobile ? bae.backgroundColor() : Kirigami.Theme.backgroundColor
property string viewBackgroundColor : isMobile ? bae.backgroundColor() : Kirigami.Theme.viewBackgroundColor
property string viewBackgroundColor : isMobile ? bae.altColor() : Kirigami.Theme.viewBackgroundColor
property string foregroundColor : isMobile ? bae.foregroundColor() : Kirigami.Theme.textColor
property string textColor : isMobile ? bae.textColor() : Kirigami.Theme.textColor
property string babeHighlightColor : isMobile ? bae.highlightColor() : Kirigami.Theme.highlightColor
......@@ -68,8 +68,8 @@ Kirigami.ApplicationWindow
property string midLightColor : isMobile? bae.midLightColor() : Kirigami.Theme.buttonBackgroundColor
property string darkColor : bae.darkColor()
property string baseColor : bae.baseColor()
property string altColor : bae.altColor()
property string shadowColor : bae.shadowColor()
property string altColor : isMobile ? bae.altColor() : Kirigami.Theme.viewBackgroundColor
property string shadowColor : bae.shadowColor()
readonly property string darkBackgroundColor : "#303030"
readonly property string darkForegroundColor : "#FAFAFA"
......@@ -157,18 +157,18 @@ Kirigami.ApplicationWindow
onClosing: Player.savePlaylist()
// pageStack.onCurrentIndexChanged:
// {
// if(pageStack.currentIndex === 0 && isMobile && !pageStack.wideMode)
// {
// bae.androidStatusBarColor(babeColor)
// Material.background = babeColor
// }else
// {
// bae.androidStatusBarColor(babeAltColor)
// Material.background = babeAltColor
// }
// }
// pageStack.onCurrentIndexChanged:
// {
// if(pageStack.currentIndex === 0 && isMobile && !pageStack.wideMode)
// {
// bae.androidStatusBarColor(babeColor)
// Material.background = babeColor
// }else
// {
// bae.androidStatusBarColor(babeAltColor)
// Material.background = babeAltColor
// }
// }
onMissingAlert:
{
......@@ -191,13 +191,13 @@ Kirigami.ApplicationWindow
mainPlaylist.table.model.remove(mainPlaylist.table.currentIndex)
}
}
}
/* UI */
header: BabeBar
{
id: toolbar
// height: toolBarHeight
// height: toolBarHeight
visible: true
currentIndex: currentView
onSettingsViewClicked: settingsDrawer.visible ? settingsDrawer.close() : settingsDrawer.open()
......@@ -308,7 +308,7 @@ Kirigami.ApplicationWindow
implicitHeight: 10
width: progressBar.availableWidth
height: implicitHeight
color: "transparent"
color: "transparent"
Rectangle
{
......@@ -466,11 +466,12 @@ Kirigami.ApplicationWindow
id: babeBtnIcon
iconName: "love"
iconColor: currentBabe ? babeColor : darkForegroundColor
onClicked:
{
var value = mainPlaylist.contextMenu.babeIt(currentTrackIndex)
currentBabe = value
}
onClicked: if(!mainlistEmpty)
{
var value = mainPlaylist.contextMenu.babeIt(currentTrackIndex)
currentBabe = value
}
}
BabeButton
......@@ -812,8 +813,8 @@ Kirigami.ApplicationWindow
Component.onCompleted:
{
// if(isMobile) settingsDrawer.switchColorScheme(bae.loadSetting("THEME", "BABE", "Dark"))
// console.log(Imagine.url, Imagine.path)
// if(isMobile) settingsDrawer.switchColorScheme(bae.loadSetting("THEME", "BABE", "Dark"))
// console.log(Imagine.url, Imagine.path)
bae.androidStatusBarColor(backgroundColor)
}
......@@ -824,11 +825,13 @@ Kirigami.ApplicationWindow
onPos: progressBar.value = pos
onTiming: progressTimeLabel = time
onDurationChanged: durationTimeLabel = time
onFinished:
{
bae.playedTrack(currentTrack.url)
Player.nextTrack()
}
onFinished: if(!mainlistEmpty)
{
bae.playedTrack(currentTrack.url)
Player.nextTrack()
}
onIsPlaying: isPlaying = playing
}
......
......@@ -34,7 +34,7 @@ function playTrack(track)
// root.mainPlaylist.infoView.wikiAlbum = bae.albumWiki(root.mainPlaylist.currentTrack.album,root.mainPlaylist.currentTrack.artist)
// root.mainPlaylist.infoView.wikiArtist = bae.artistWiki(root.mainPlaylist.currentTrack.artist)
// // root.mainPlaylist.infoView.artistHead = bae.artistArt(root.mainPlaylist.currentTrack.artist)
}else root.missingAlert(currentTrack)
}else missingAlert(currentTrack)
}
}
......@@ -55,14 +55,14 @@ function queueTracks(tracks)
function setLyrics(lyrics)
{
currentTrack.lyrics = lyrics
root.mainPlaylist.infoView.lyricsText.text = lyrics
mainPlaylist.infoView.lyricsText.text = lyrics
}
function stop()
{
player.stop()
root.progressBar.value = 0
root.progressBar.enabled = false
progressBar.value = 0
progressBar.enabled = false
root.title = "Babe..."
}
......@@ -82,7 +82,7 @@ function nextTrack()
if(!mainlistEmpty)
{
var next = 0
if(root.shuffle && onQueue === 0)
if(shuffle && onQueue === 0)
next = shuffle()
else
next = currentTrackIndex+1 >= mainPlaylist.list.count? 0 : currentTrackIndex+1
......@@ -100,7 +100,7 @@ function nextTrack()
function previousTrack()
{
if(root.mainPlaylist.list.count>0)
if(!mainlistEmpty>0)
{
var previous = previous = currentTrackIndex-1 >= 0 ? mainPlaylist.list.currentIndex-1 : currentTrackIndex-1
prevTrackIndex = mainPlaylist.list.currentIndex
......@@ -110,13 +110,13 @@ function previousTrack()
function shuffle()
{
var pos = Math.floor(Math.random() * root.mainPlaylist.list.count)
var pos = Math.floor(Math.random() * mainPlaylist.list.count)
return pos
}
function playAt(index)
{
if(index < root.mainPlaylist.list.count)
if(index < mainPlaylist.list.count)
{
currentTrackIndex = index
mainPlaylist.list.currentIndex = index
......@@ -129,7 +129,7 @@ function quickPlay(track)
// root.pageStack.currentIndex = 0
appendTrack(track)
playAt(root.mainPlaylist.list.count-1)
root.mainPlaylist.list.positionViewAtEnd()
mainPlaylist.list.positionViewAtEnd()
}
......@@ -146,7 +146,7 @@ function appendTrack(track)
{
mainPlaylist.list.model.append(track)
animFooter.running = true
if(root.sync === true)
if(sync === true)
{
infoMsgAnim()
addToPlaylist([track.url], syncPlaylist)
......@@ -189,15 +189,15 @@ function appendAll(tracks)
function savePlaylist()
{
var list = []
var n = root.mainPlaylist.list.count
var n = mainPlaylist.list.count
n = n > 15 ? 15 : n
for(var i=0 ; i < n; i++)
{
var url = root.mainPlaylist.list.model.get(i).url
var url = mainPlaylist.list.model.get(i).url
list.push(url)
}
bae.savePlaylist(list)
bae.savePlaylistPos(root.mainPlaylist.list.currentIndex)
bae.savePlaylistPos(mainPlaylist.list.currentIndex)
}
function clearOutPlaylist()
......
......@@ -39,24 +39,48 @@ Page
list.model.clear()
}
BabeHolder
{
id: holder
visible: babeList.count === 0
color : textColor
focus: true
}
ColumnLayout
{
anchors.fill: parent
spacing: 0
ToolBar
Rectangle
{
id: headerRoot
width: parent.width
height: visible ? toolBarHeight : 0
Layout.fillWidth: true
visible: headerBarVisible
focus: true
focus: true
color: backgroundColor
Kirigami.Separator
{
visible: !isMobile
width: parent.width
height: 1
anchors
{
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
RowLayout
{
id: headerBar
anchors.fill: parent
BabeButton
{
Layout.alignment : Qt.AlignLeft
......@@ -136,23 +160,14 @@ Page
NumberAnimation { properties: "x,y"; duration: 100 }
}
BabeHolder
{
id: holder
visible: babeList.count === 0
color : textColor
focus: true
}
ScrollBar.vertical:BabeScrollBar { }
onContentYChanged:
{
if(contentY < -120)
wasPulled = true
if(contentY == toolBarHeight*-1 && wasPulled)
if(contentY == 0 && wasPulled)
{ pulled(); wasPulled = false}
}
}
......
......@@ -12,6 +12,9 @@ Menu
focus: true
parent: ApplicationWindow.overlay
margins: 1
padding: 2
// enter: Transition
// {
// NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
......
......@@ -203,7 +203,7 @@ ItemDelegate
visible: coverArt ? !sameAlbum : true
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: gridLayout.width*0.5
Layout.maximumWidth: gridLayout.width*0.4
Layout.row: 2
Layout.column: 2
verticalAlignment: Qt.AlignVCenter
......
......@@ -49,14 +49,17 @@ BabeMenu
function babeIt(index)
{
console.log(index);
var url = listModel.get(index).url
var value = listModel.get(index).babe == "1" ? false : true
if(list.count>0)
{
console.log(index);
var url = listModel.get(index).url
var value = listModel.get(index).babe == "1" ? false : true
if(bae.babeTrack(url, value))
list.model.get(index).babe = value ? "1" : "0"
if(bae.babeTrack(url, value))
list.model.get(index).babe = value ? "1" : "0"
return value
return value
}
}
BabePopup
......
......@@ -36,7 +36,7 @@ BabeGrid
y: parent.height-height-root.footer.height
width: pageStack.wideMode ? albumsViewGrid.width-1 : albumsViewGrid.width
width: albumsViewGrid.width
height:
{
......@@ -86,6 +86,20 @@ BabeGrid
quickPlayVisible: true
focus: true
Kirigami.Separator
{
visible: !isMobile
width: parent.width
height: 1
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
onRowClicked:
{
drawer.close()
......
......@@ -38,7 +38,7 @@ BabeGrid
y: parent.height-height-root.footer.height
width: pageStack.wideMode ? artistsViewGrid.width-1 : artistsViewGrid.width
width: artistsViewGrid.width
height:
{
......@@ -81,6 +81,21 @@ BabeGrid
headerBarVisible: true
headerBarExit: true
coverArtVisible: true
Kirigami.Separator
{
visible: !isMobile
width: parent.width
height: 1
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
onRowClicked:
{
drawer.close()
......
......@@ -10,11 +10,6 @@ import "../../db/Queries.js" as Q
import "../../utils/Help.js" as H
// transform: Translate
// {
// x: (playlistViewDrawer.position * playlistViewRoot.width * 0.33)*-1
// }
Kirigami.PageRow
{
id: playlistViewRoot
......
......@@ -102,6 +102,14 @@ Page
onExit: clearSearch()
}
Kirigami.Separator
{
visible: !isMobile
Layout.fillWidth: true
width: parent.width
height: 1
}
ToolBar
{
id: searchBox
......
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