Make monochrome icons configurable. On by default for Linux, off by default for windows

This commit is contained in:
craig.p.drummond
2013-04-26 18:43:16 +00:00
parent 8dfc0b4f24
commit 7b1bdd47e9
6 changed files with 54 additions and 32 deletions

View File

@@ -167,7 +167,10 @@
98. List untagged files in main 'artists'/'albums' views. Attempt to guess the
tags based upon the filename/folder. e.g.
$artist/$album/$trackNo - $trackTitle
99. Monochrome sidebar icons.
99. Monochrome sidebar icons. Enabled by default for Linux builds, disabled by
default for Windows builds. To alter setting edit Cantata's config file and
set the following in the "[General]" section to either true or false:
monoSidebarIcons=false
0.9.2
-----

View File

@@ -235,6 +235,7 @@ MainWindow::MainWindow(QWidget *parent)
GtkStyle::applyTheme(toolbar);
Icons::initToolbarIcons(artistLabel->palette().color(QPalette::Foreground), GtkStyle::useLightIcons());
Icons::initSidebarIcons();
menuButton->setIcon(Icons::toolbarMenuIcon);
#ifdef ENABLE_KDE_SUPPORT

View File

@@ -257,6 +257,15 @@ QString Settings::iconTheme()
}
#endif
bool Settings::monoSidebarIcons()
{
#ifdef Q_OS_WIN
return GET_BOOL("monoSidebarIcons", false);
#else
return GET_BOOL("monoSidebarIcons", true);
#endif
}
bool Settings::showPlaylist()
{
return GET_BOOL("showPlaylist", true);

View File

@@ -257,6 +257,7 @@ public:
#else
QString iconTheme();
#endif
bool monoSidebarIcons();
int id3v2Version();
bool firstRun() const { return isFirstRun; }

View File

@@ -23,6 +23,7 @@
#include "icons.h"
#include "config.h"
#include "settings.h"
#include <QApplication>
#include <QPixmap>
#include <QFont>
@@ -480,38 +481,44 @@ void Icons::init()
streamCategoryIcon=libraryIcon;
}
}
// Load sidebar icons...
QColor textCol=QApplication::palette().color(QPalette::Active, QPalette::ButtonText);
QColor highlightedTexCol=QApplication::palette().color(QPalette::Active, QPalette::HighlightedText);
playqueueIcon=loadSidebarIcon("playqueue", textCol, highlightedTexCol);
artistsIcon=loadSidebarIcon("artists", textCol, highlightedTexCol);
albumsIcon=loadSidebarIcon("albums", textCol, highlightedTexCol);
foldersIcon=loadSidebarIcon("folders", textCol, highlightedTexCol);
playlistsIcon=loadSidebarIcon("playlists", textCol, highlightedTexCol);
dynamicIcon=loadSidebarIcon("dynamic", textCol, highlightedTexCol);
streamsIcon=loadSidebarIcon("streams", textCol, highlightedTexCol);
onlineIcon=loadSidebarIcon("online", textCol, highlightedTexCol);
lyricsIcon=loadSidebarIcon("lyrics", textCol, highlightedTexCol);
infoIcon=loadSidebarIcon("info", textCol, highlightedTexCol);
#ifdef ENABLE_DEVICES_SUPPORT
devicesIcon=loadSidebarIcon("devices", textCol, highlightedTexCol);
#endif
/*
playqueueIcon=Icon("media-playback-start");
artistsIcon=artistIcon;
albumsIcon=albumIcon;
foldersIcon=Icon("inode-directory");
playlistsIcon=Icon("view-media-playlist");
dynamicIcon=dynamicRuleIcon;
streamsIcon=radioStreamIcon;
onlineIcon=Icon("applications-internet");
lyricsIcon=Icon("view-media-lyrics");
infoIcon=Icon("dialog-information");
#ifdef ENABLE_DEVICES_SUPPORT
devicesIcon=Icon("multimedia-player");
#endif
*/
void Icons::initSidebarIcons()
{
if (Settings::self()->monoSidebarIcons()) {
QColor textCol=QApplication::palette().color(QPalette::Active, QPalette::ButtonText);
QColor highlightedTexCol=QApplication::palette().color(QPalette::Active, QPalette::HighlightedText);
playqueueIcon=loadSidebarIcon("playqueue", textCol, highlightedTexCol);
artistsIcon=loadSidebarIcon("artists", textCol, highlightedTexCol);
albumsIcon=loadSidebarIcon("albums", textCol, highlightedTexCol);
foldersIcon=loadSidebarIcon("folders", textCol, highlightedTexCol);
playlistsIcon=loadSidebarIcon("playlists", textCol, highlightedTexCol);
dynamicIcon=loadSidebarIcon("dynamic", textCol, highlightedTexCol);
streamsIcon=loadSidebarIcon("streams", textCol, highlightedTexCol);
onlineIcon=loadSidebarIcon("online", textCol, highlightedTexCol);
lyricsIcon=loadSidebarIcon("lyrics", textCol, highlightedTexCol);
infoIcon=loadSidebarIcon("info", textCol, highlightedTexCol);
#ifdef ENABLE_DEVICES_SUPPORT
devicesIcon=loadSidebarIcon("devices", textCol, highlightedTexCol);
#endif
} else {
playqueueIcon=Icon("media-playback-start");
artistsIcon=artistIcon;
albumsIcon=albumIcon;
foldersIcon=Icon("inode-directory");
playlistsIcon=playlistIcon;
dynamicIcon=dynamicRuleIcon;
streamsIcon=radioStreamIcon;
onlineIcon=Icon("applications-internet");
lyricsIcon=Icon("view-media-lyrics");
infoIcon=Icon("dialog-information");
#ifdef ENABLE_DEVICES_SUPPORT
devicesIcon=Icon("multimedia-player");
#endif
if (lyricsIcon.isNull()) {
lyricsIcon=Icon("text-x-generic");
}
}
}
#if !defined ENABLE_KDE_SUPPORT && !defined Q_OS_WIN

View File

@@ -32,6 +32,7 @@ class QColor;
namespace Icons
{
extern void init();
extern void initSidebarIcons();
extern void initToolbarIcons(const QColor &color, bool forceLight=false);
#ifndef ENABLE_KDE_SUPPORT
extern Icon appIcon;