Commit 762f6025 authored by Camilo Higuita's avatar Camilo Higuita

clean up pro file, add luv icon theme for non-linux platforms, and improvements overall

parent 62623c00
......@@ -19,4 +19,7 @@ ANDROID_PACKAGE_SOURCE_DIR = $$PWD/
RESOURCES += \
$$PWD/android.qrc
$$PWD/android.qrc \
$$PWD/../kirigami-icons.qrc \
$$PWD/../icons.qrc
......@@ -509,157 +509,13 @@ void Babe::showFolder(const QString &url)
}
QString Babe::baseColor()
{
#if defined(Q_OS_ANDROID)
return "#24282c";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Base).name();
#elif defined(Q_OS_WIN32)
return "#24282c";
#endif
}
QString Babe::darkColor()
{
#if defined(Q_OS_ANDROID)
return "#111";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Dark).name();
#elif defined(Q_OS_WIN32)
return "#24282c";
#endif
}
QString Babe::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 Babe::foregroundColor()
{
#if defined(Q_OS_ANDROID)
return "#FFF";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Foreground).name();
#elif defined(Q_OS_WIN32)
return "#FFF";
#endif
}
QString Babe::textColor()
{
#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 Babe::highlightColor()
{
#if defined(Q_OS_ANDROID)
return "#58bcff";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Highlight).name();
#elif defined(Q_OS_WIN32)
return "#58bcff";
#endif
}
QString Babe::highlightTextColor()
{
#if defined(Q_OS_ANDROID)
return "#FFF";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::HighlightedText).name();
#elif defined(Q_OS_WIN32)
return "#FFF";
#endif
}
QString Babe::midColor()
{
#if defined(Q_OS_ANDROID)
return "#1f2226";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Mid).name();
#elif defined(Q_OS_WIN32)
return "#1f2226";
#endif
}
QString Babe::midLightColor()
{
#if defined(Q_OS_ANDROID)
return "#434951";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Midlight).name();
#elif defined(Q_OS_WIN32)
return "#434951";
#endif
}
QString Babe::shadowColor()
{
#if defined(Q_OS_ANDROID)
return "#3e444b";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Shadow).name();
#elif defined(Q_OS_WIN32)
return "#3e444b";
#endif
}
QString Babe::altColor()
{
#if defined(Q_OS_ANDROID)
return "#232629";
#elif defined(Q_OS_LINUX)
QWidget widget;
return widget.palette().color(QPalette::Base).name();
#elif defined(Q_OS_WIN32)
return "#232629";
#endif
}
QString Babe::babeColor()
{
return "#f84172";
// return "#E91E63";
}
QString Babe::babeAltColor()
{
#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
}
void Babe::androidStatusBarColor(const QString &color)
void Babe::androidStatusBarColor(const QString &color, const bool &contrast)
{
#if defined(Q_OS_ANDROID)
......@@ -668,6 +524,13 @@ void Babe::androidStatusBarColor(const QString &color)
window.callMethod<void>("addFlags", "(I)V", 0x80000000);
window.callMethod<void>("clearFlags", "(I)V", 0x04000000);
window.callMethod<void>("setStatusBarColor", "(I)V", QColor(color).rgba());
if(contrast)
{
QAndroidJniObject decorView = window.callObjectMethod("getDecorView", "()Landroid/view/View;");
decorView.callMethod<void>("setSystemUiVisibility", "(I)V", 0x00002000);
}
});
#endif
}
......@@ -682,29 +545,6 @@ bool Babe::isAndroid()
return BAE::isAndroid();
}
int Babe::screenGeometry(QString side)
{
side = side.toLower();
auto geo = QGuiApplication::primaryScreen()->geometry();
if(side == "width")
return geo.width();
else if(side == "height")
return geo.height();
else return 0;
}
int Babe::cursorPos(QString axis)
{
axis = axis.toLower();
auto pos = QCursor::pos();
if(axis == "x")
return pos.x();
else if(axis == "y")
return pos.y();
else return 0;
}
QString Babe::moodColor(const int &pos)
{
if(pos < BAE::MoodColors.size())
......
......@@ -77,26 +77,12 @@ class Babe : public CollectionDB
Q_INVOKABLE static void showFolder(const QString &url);
/*COLORS*/
Q_INVOKABLE static QString baseColor();
Q_INVOKABLE static QString darkColor();
Q_INVOKABLE static QString backgroundColor();
Q_INVOKABLE static QString foregroundColor();
Q_INVOKABLE static QString textColor();
Q_INVOKABLE static QString highlightColor();
Q_INVOKABLE static QString highlightTextColor();
Q_INVOKABLE static QString midColor();
Q_INVOKABLE static QString midLightColor();
Q_INVOKABLE static QString shadowColor();
Q_INVOKABLE static QString altColor();
Q_INVOKABLE static QString babeColor();
Q_INVOKABLE static QString babeAltColor();
/*UTILS*/
Q_INVOKABLE static bool isMobile();
Q_INVOKABLE static bool isAndroid();
Q_INVOKABLE static int screenGeometry(QString side);
Q_INVOKABLE static int cursorPos(QString axis);
Q_INVOKABLE static QString moodColor(const int &pos);
......@@ -127,7 +113,7 @@ class Babe : public CollectionDB
Q_INVOKABLE static void sendTrack(const QString &url);
Q_INVOKABLE static void openFile(const QString &url);
Q_INVOKABLE void fileChooser();
Q_INVOKABLE static void androidStatusBarColor(const QString &color);
Q_INVOKABLE static void androidStatusBarColor(const QString &color, const bool &contrast);
public slots:
......
<RCC>
<qresource prefix="/">
<file>icons/Luv/index.theme</file>
<file>icons/Luv/actions/22/album.svg</file>
<file>icons/Luv/actions/22/amarok_artist.svg</file>
<file>icons/Luv/actions/22/amarok_clock.svg</file>
<file>icons/Luv/actions/22/amarok_lyrics.svg</file>
<file>icons/Luv/actions/22/amarok_playlist_refresh.svg</file>
<file>icons/Luv/actions/22/application-menu.svg</file>
<file>icons/Luv/actions/22/archive-extract.svg</file>
<file>icons/Luv/actions/22/archive-insert.svg</file>
<file>icons/Luv/actions/22/archive-remove.svg</file>
<file>icons/Luv/actions/22/artist.svg</file>
<file>icons/Luv/actions/22/checkbox.svg</file>
<file>icons/Luv/actions/22/configure.svg</file>
<file>icons/Luv/actions/22/dialog-close.svg</file>
<file>icons/Luv/actions/22/document-close.svg</file>
<file>icons/Luv/actions/22/document-download.svg</file>
<file>icons/Luv/actions/22/document-new.svg</file>
<file>icons/Luv/actions/22/document-open.svg</file>
<file>icons/Luv/actions/22/document-preview-archive.svg</file>
<file>icons/Luv/actions/22/document-save-as.svg</file>
<file>icons/Luv/actions/22/document-save.svg</file>
<file>icons/Luv/actions/22/document-share.svg</file>
<file>icons/Luv/actions/22/documentinfo.svg</file>
<file>icons/Luv/actions/22/draw-star.svg</file>
<file>icons/Luv/actions/22/draw-text.svg</file>
<file>icons/Luv/actions/22/edit-clear.svg</file>
<file>icons/Luv/actions/22/edit-find.svg</file>
<file>icons/Luv/actions/22/edit-redo.svg</file>
<file>icons/Luv/actions/22/edit-undo.svg</file>
<file>icons/Luv/actions/22/filename-filetype-amarok.svg</file>
<file>icons/Luv/actions/22/filename-space-amarok.svg</file>
<file>icons/Luv/actions/22/games-config-options.svg</file>
<file>icons/Luv/actions/22/go-down.svg</file>
<file>icons/Luv/actions/22/go-first.svg</file>
<file>icons/Luv/actions/22/go-home.svg</file>
<file>icons/Luv/actions/22/go-last.svg</file>
<file>icons/Luv/actions/22/go-next.svg</file>
<file>icons/Luv/actions/22/go-previous.svg</file>
<file>icons/Luv/actions/22/go-up.svg</file>
<file>icons/Luv/actions/22/headphones.svg</file>
<file>icons/Luv/actions/22/help-contents.svg</file>
<file>icons/Luv/actions/22/help-contextual.svg</file>
<file>icons/Luv/actions/22/hint.svg</file>
<file>icons/Luv/actions/22/image-folder-view.svg</file>
<file>icons/Luv/actions/22/image-frames.svg</file>
<file>icons/Luv/actions/22/image-multiple.svg</file>
<file>icons/Luv/actions/22/image.svg</file>
<file>icons/Luv/actions/22/internet-amarok.svg</file>
<file>icons/Luv/actions/22/internet-services.svg</file>
<file>icons/Luv/actions/22/list-add.svg</file>
<file>icons/Luv/actions/22/list-remove.svg</file>
<file>icons/Luv/actions/22/love.svg</file>
<file>icons/Luv/actions/22/media-album-track.svg</file>
<file>icons/Luv/actions/22/media-eject.svg</file>
<file>icons/Luv/actions/22/media-playback-pause.svg</file>
<file>icons/Luv/actions/22/media-playback-start.svg</file>
<file>icons/Luv/actions/22/media-playlist-append.svg</file>
<file>icons/Luv/actions/22/media-playlist-normal.svg</file>
<file>icons/Luv/actions/22/media-playlist-play.svg</file>
<file>icons/Luv/actions/22/media-playlist-repeat.svg</file>
<file>icons/Luv/actions/22/media-playlist-shuffle.svg</file>
<file>icons/Luv/actions/22/media-skip-backward.svg</file>
<file>icons/Luv/actions/22/media-skip-forward.svg</file>
<file>icons/Luv/actions/22/musicnote.svg</file>
<file>icons/Luv/actions/22/nx-configure.svg</file>
<file>icons/Luv/actions/22/nx-home.svg</file>
<file>icons/Luv/actions/22/object-rotate-left.svg</file>
<file>icons/Luv/actions/22/object-rotate-right.svg</file>
<file>icons/Luv/actions/22/overflow-menu.svg</file>
<file>icons/Luv/actions/22/process-stop.svg</file>
<file>icons/Luv/actions/22/tag.svg</file>
<file>icons/Luv/actions/22/view-fullscreen.svg</file>
<file>icons/Luv/actions/22/view-left-close.svg</file>
<file>icons/Luv/actions/22/view-list-details.svg</file>
<file>icons/Luv/actions/22/view-list-icons.svg</file>
<file>icons/Luv/actions/22/view-list-tree.svg</file>
<file>icons/Luv/actions/22/view-media-album.svg</file>
<file>icons/Luv/actions/22/view-media-artist.svg</file>
<file>icons/Luv/actions/22/view-media-chart.svg</file>
<file>icons/Luv/actions/22/view-media-config.svg</file>
<file>icons/Luv/actions/22/view-media-favorite.svg</file>
<file>icons/Luv/actions/22/view-media-genre.svg</file>
<file>icons/Luv/actions/22/view-media-playcount.svg</file>
<file>icons/Luv/actions/22/view-media-playlist.svg</file>
<file>icons/Luv/actions/22/view-media-recent.svg</file>
<file>icons/Luv/actions/22/view-media-similarartists.svg</file>
<file>icons/Luv/actions/22/view-media-track.svg</file>
<file>icons/Luv/actions/22/view-preview.svg</file>
<file>icons/Luv/actions/22/view-refresh.svg</file>
<file>icons/Luv/actions/22/view-right-close.svg</file>
<file>icons/Luv/actions/22/view-right-new.svg</file>
<file>icons/Luv/actions/22/visibility.svg</file>
<file>icons/Luv/actions/22/window-close.svg</file>
</qresource>
</RCC>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
viewBox="0 0 16 16"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="view-refresh.svg">
<defs
id="defs3051">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
<style
id="current-color-scheme-7"
type="text/css">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
<style
id="current-color-scheme-9"
type="text/css">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
<style
id="current-color-scheme-75"
type="text/css">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="64"
inkscape:cx="6.4989867"
inkscape:cy="10.154087"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
units="px"
inkscape:showpageshadow="false"
borderlayer="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="2560"
inkscape:window-height="1050"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid