Commit d65da932 authored by Camilo Higuita's avatar Camilo Higuita

fix shuffle playback and introduce plasma color shcemes integration

parent a8bb68e1
......@@ -9,8 +9,6 @@ QT += xml
CONFIG += c++11
include(android-openssl.pri)
#android: {
# include(3rdparty/kirigami/kirigami.pri)
#}
......@@ -68,10 +66,6 @@ INCLUDEPATH += taglib/trueaudio
INCLUDEPATH += taglib/wavpack
INCLUDEPATH += taglib/xm
#unix:!macx: LIBS += -L$$PWD/3rdparty/taglib-1.11.1/taglib/ -ltag
#INCLUDEPATH += $$PWD/3rdparty/taglib-1.11.1/taglib/Headers
#DEPENDPATH += $$PWD/3rdparty/taglib-1.11.1/taglib/Headers
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
......@@ -210,9 +204,11 @@ qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
n
DISTFILES += \
db/script.sql \
android-openssl.pri
android-openssl.pri \
# 3rdparty/kirigami/kirigami.pri
HEADERS += \
......
......@@ -55,7 +55,7 @@ ApplicationWindow
}else
{
babeBtnIcon.text = MdiFont.Icon.heartOutline
babeBtnIcon.color = myPalette.dark
babeBtnIcon.color = babeBtnIcon.defaultColor
}
}
......@@ -234,7 +234,7 @@ ApplicationWindow
{
id: babeBtnIcon
text: MdiFont.Icon.heartOutline
color: myPalette.dark
color: defaultColor
}
onClicked:
......@@ -243,7 +243,7 @@ ApplicationWindow
{
con.babeTrack(currentTrack.url, false)
babeBtnIcon.text = MdiFont.Icon.heartOutline
babeBtnIcon.color = myPalette.dark
babeBtnIcon.color = babeBtnIcon.defaultColor
}else
{
......@@ -285,7 +285,7 @@ ApplicationWindow
id: shuffleBtn
Icon{text: shuffle ? MdiFont.Icon.shuffle : MdiFont.Icon.shuffleDisabled}
onClicked: shuffle = shuffle ? false : true
onClicked: shuffle = !shuffle
}
}
}
......
......@@ -5,10 +5,12 @@ Text
id: text
property string iconColor
property int iconSize
readonly property string defaultColor : "#333"
font.family: "Material Design Icons"
font.pixelSize: iconSize || 24
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: iconColor || defaultColor
}
......@@ -21,8 +21,8 @@ function resumeTrack()
function nextTrack()
{
var next
if(shuffle)
console.log("shuffle<<", root.shuffle)
if(root.shuffle)
next = shuffle()
else
next = mainPlaylistTable.currentIndex+1 >= mainPlaylistTable.count? 0 : mainPlaylistTable.currentIndex+1
......
#include "utils.h"
#include "bae.h"
#include <QPalette>
#include <QWidget>
#include <QColor>
using namespace BAE;
Utils::Utils(QObject *parent) : QObject(parent)
......@@ -7,7 +10,6 @@ Utils::Utils(QObject *parent) : QObject(parent)
void Utils::savePlaylist(const QStringList &list)
{
qDebug()<<"SAVED PLAYLIST:::"<<list;
BAE::saveSettings("PLAYLIST", list, "MAINWINDOW");
}
......@@ -26,4 +28,45 @@ int Utils::lastPlaylistPos()
return BAE::loadSettings("PLAYLIST_POS","MAINWINDOW",QVariant(0)).toInt();
}
QString Utils::backgroundColor()
{
#if defined(Q_OS_ANDROID)
return "#31363b";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Background).name();
#elif defined(Q_OS_WIN32)
return "#31363b";
#endif
}
QString Utils::foregroundColor()
{
#if defined(Q_OS_ANDROID)
return "#FFF";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Text).name();
#elif defined(Q_OS_WIN32)
return "#FFF";
#endif
}
QString Utils::hightlightColor()
{
#if defined(Q_OS_ANDROID)
return "#FFF";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Highlight).name();
#elif defined(Q_OS_WIN32)
return "#FFF";
#endif
}
......@@ -14,6 +14,11 @@ public:
Q_INVOKABLE static void savePlaylistPos(const int &pos);
Q_INVOKABLE static int lastPlaylistPos();
Q_INVOKABLE static QString backgroundColor();
Q_INVOKABLE static QString foregroundColor();
Q_INVOKABLE static QString hightlightColor();
};
......
......@@ -47,7 +47,7 @@ ListView
width: list.width
height: list.currentItem.height
color: myPalette.highlight
color: util.hightlightColor() || myPalette.highlight
opacity: 0.2
y: list.currentItem.y
// Behavior on y
......
......@@ -9,10 +9,9 @@ ToolBar
{
property alias babeBar : babeBar
property string accentColor : "#E91E63"
property string textColor : "#ffffff"
property string backgroundColor : "#31363b"
property string textColor : util.foregroundColor()
property string backgroundColor : util.backgroundColor()
property int size //icon size
property int currentIndex : 0
signal tracksViewClicked()
......
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