Commit 4ea2b48f authored by Camilo Higuita's avatar Camilo Higuita

more work on color cheme integration

parent d65da932
......@@ -144,13 +144,25 @@ ApplicationWindow
id: swipeView
width: parent.width
height: parent.height - searchBox.height
Component.onCompleted:
{
if(Qt.platform.os === "linux")
contentItem.interactive = false
else if(Qt.platform.os === "android")
contentItem.interactive = true
}
currentIndex: currentView
Item
{
id: playlistPage
Rectangle
{
anchors.fill: parent
color: util.altColor()
z: -999
}
// Component.onCompleted:
// {
// if(mainPlaylistTable.count>0)
......@@ -200,6 +212,8 @@ ApplicationWindow
{
id: progressBar
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 3
height: 16
from: 0
......@@ -209,6 +223,13 @@ ApplicationWindow
spacing: 0
onMoved: player.seek(player.duration() / 1000 * value);
Rectangle
{
anchors.fill: parent
color: util.midColor()
z: -999
}
}
Rectangle
......@@ -218,6 +239,30 @@ ApplicationWindow
Layout.row: 2
height: 48
visible: mainPlaylistTable.count>0
color: util.midColor()
onYChanged:
{
if(playbackControls.y<columnWidth/4)
{
coverPlay.visible= false
playbackControls.y = 0
}else
{
coverPlay.visible= true
playbackControls.y = columnWidth
}
}
MouseArea
{
anchors.fill: parent
drag.target: playbackControls
drag.axis: Drag.YAxis
drag.minimumY: 0
drag.maximumY: columnWidth
}
RowLayout
{
......@@ -296,9 +341,8 @@ ApplicationWindow
id: mainPlaylist
Layout.fillWidth: true
Layout.fillHeight: true
Layout.row: 4
color: "transparent"
BabeTable
{
id: mainPlaylistTable
......@@ -316,10 +360,10 @@ ApplicationWindow
appendTrack(track[0])
}
// var pos = util.lastPlaylistPos()
// console.log("POSSS:", pos)
// mainPlaylistTable.currentIndex = pos
// play(mainPlaylistTable.model.get(pos))
// var pos = util.lastPlaylistPos()
// console.log("POSSS:", pos)
// mainPlaylistTable.currentIndex = pos
// play(mainPlaylistTable.model.get(pos))
}
}
}
......@@ -397,7 +441,8 @@ ApplicationWindow
id: searchBox
width: parent.width
height: 32
color: "white"
color: util.midColor()
TextInput
{
id: searchInput
......@@ -417,6 +462,7 @@ ApplicationWindow
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
color: util.foregroundColor()
}
}
......
......@@ -3,9 +3,9 @@ import QtQuick 2.3
Text
{
id: text
property string iconColor
property string iconColor: util.foregroundColor()
property int iconSize
readonly property string defaultColor : "#333"
readonly property string defaultColor : iconColor
font.family: "Material Design Icons"
font.pixelSize: iconSize || 24
......
......@@ -60,12 +60,36 @@ QString Utils::hightlightColor()
{
#if defined(Q_OS_ANDROID)
return "#FFF";
return "";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Highlight).name();
#elif defined(Q_OS_WIN32)
return "#FFF";
return "";
#endif
}
QString Utils::midColor()
{
#if defined(Q_OS_ANDROID)
return "#31363b";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Midlight).name();
#elif defined(Q_OS_WIN32)
return "#31363b";
#endif
}
QString Utils::altColor()
{
#if defined(Q_OS_ANDROID)
return "#31363b";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Base).name();
#elif defined(Q_OS_WIN32)
return "#31363b";
#endif
}
......
......@@ -17,6 +17,8 @@ public:
Q_INVOKABLE static QString backgroundColor();
Q_INVOKABLE static QString foregroundColor();
Q_INVOKABLE static QString hightlightColor();
Q_INVOKABLE static QString midColor();
Q_INVOKABLE static QString altColor();
......
......@@ -7,9 +7,10 @@ Item
{
signal albumClicked(int index)
property int albumSize : 150
property int borderRadius : 4
property string fillColor: "#31363b"
property int borderRadius : 2
property string fillColor: util.midColor()
property string textColor: util.foregroundColor()
property int fontSize :Qt.platform.os === "android"? 12 : 10
id: root
width: albumSize
......@@ -17,14 +18,14 @@ Item
DropShadow
{
anchors.fill: card
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 17
color: "#80000000"
source: card
}
anchors.fill: card
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 17
color: "#80000000"
source: card
}
Rectangle
......@@ -33,7 +34,6 @@ Item
anchors.fill: parent
color: fillColor
radius: borderRadius
border.color: "#222"
}
ColumnLayout
......@@ -51,23 +51,23 @@ Item
fillMode: Image.PreserveAspectFit
source: (artwork.length>0 && artwork !== "none")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
// layer.enabled: true
// layer.effect: OpacityMask
// {
// maskSource: Item
// {
// width: img.width
// height: img.height
// Rectangle
// {
// anchors.centerIn: parent
// width: img.adapt ? img.width : Math.min(img.width, img.height)
// height: img.adapt ? img.height : width
// radius: borderRadius
// // radius: Math.min(width, height)
// }
// }
// }
// layer.enabled: true
// layer.effect: OpacityMask
// {
// maskSource: Item
// {
// width: img.width
// height: img.height
// Rectangle
// {
// anchors.centerIn: parent
// width: img.adapt ? img.width : Math.min(img.width, img.height)
// height: img.adapt ? img.height : width
// radius: borderRadius
// // radius: Math.min(width, height)
// }
// }
// }
}
}
......@@ -85,9 +85,9 @@ Item
text: typeof album === 'undefined' ? artist : album
visible: true
elide: Text.ElideRight
font.pointSize: 10
font.pointSize: fontSize
font.bold: true
color: "white"
color: textColor
lineHeight: 0.7
}
......@@ -106,9 +106,10 @@ Item
width: parent.width
text: typeof album === 'undefined' ? "" : artist
visible: typeof album === 'undefined'? false : true
horizontalAlignment : typeof album === 'undefined'? Qt.AlignHCenter : Qt.AlignLeft
elide: Text.ElideRight
font.pointSize: 9
color: "white"
font.pointSize: fontSize-1
color: textColor
}
}
......@@ -120,7 +121,6 @@ Item
onClicked:
{
parent.GridView.view.currentIndex = index
console.log(index)
albumClicked(index)
}
......
......@@ -15,6 +15,13 @@ Pane
id: gridPage
background: Rectangle
{
anchors.fill: parent
color: util.altColor()
z: -999
}
function clearGrid()
{
gridModel.clear()
......
......@@ -22,7 +22,7 @@ GridLayout
width:parent.width
height: parent.height
Layout.row: 1
color: util.altColor()
Image
{
id: imageHolder
......@@ -54,6 +54,7 @@ GridLayout
font.bold: true
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
color: util.foregroundColor()
}
}
......
......@@ -39,6 +39,13 @@ ListView
visible: list.count === 0
}
Rectangle
{
anchors.fill: parent
color: util.altColor()
z: -999
}
Component
{
id: highlight
......
......@@ -6,7 +6,7 @@ ItemDelegate
{
id: delegate
signal rowSelected(int index)
property string textColor: util.foregroundColor()
property bool numberVisible : false
checkable: true
......@@ -32,6 +32,7 @@ ItemDelegate
elide: Text.ElideRight
font.pointSize: 10
color: textColor
}
......@@ -50,6 +51,7 @@ ItemDelegate
elide: Text.ElideRight
font.pointSize: 10
color: textColor
}
......@@ -66,6 +68,7 @@ ItemDelegate
font.bold: false
elide: Text.ElideRight
font.pointSize: 9
color: textColor
}
}
......
......@@ -35,7 +35,7 @@ BabeGrid
width: parent.width
height: 48
z: 1
color: util.midColor()
Row
{
anchors.fill: parent
......@@ -90,6 +90,7 @@ BabeGrid
font.pointSize: 12
font.bold: true
lineHeight: 0.7
color: util.foregroundColor()
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
......
......@@ -35,6 +35,7 @@ BabeGrid
width: parent.width
height: 48
z: 1
color: util.midColor()
Row
{
......@@ -86,7 +87,7 @@ BabeGrid
font.pointSize: 12
font.bold: true
lineHeight: 0.7
color: util.foregroundColor()
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
......
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