Only need one copy of each svg - use icon engine to recolour

- Likewise use own class to deal with fontawesome - allows for pixmap cache and consistency of disabled look, etc.
This commit is contained in:
Craig Drummond
2016-01-17 22:50:33 +00:00
committed by Craig Drummond
parent 259b800782
commit 6b0b0fc5ec
50 changed files with 294 additions and 804 deletions

View File

@@ -1,10 +0,0 @@
set(qtawesome_SRCS QtAwesome.cpp)
set(qtawesome_RCS QtAwesome.qrc)
if (ENABLE_QT5)
QT5_ADD_RESOURCES(qtawesome_RC_SRCS ${qtawesome_RCS})
else (ENABLE_QT5)
QT4_ADD_RESOURCES(qtawesome_RC_SRCS ${qtawesome_RCS})
endif (ENABLE_QT5)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QTINCLUDES} )
add_library(qtawesome STATIC ${qtawesome_SRCS} ${qtawesome_RC_SRCS})

View File

@@ -1,29 +0,0 @@
MIT License
===========
Copyright 2013-2015 [Reliable Bits Software by Blommers IT](http://blommersit.nl). All Rights Reserved.
Author [Rick Blommers](mailto:rick@blommersit.nl)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Font Awesome License
====================
[https://github.com/FortAwesome/Font-Awesome](https://github.com/FortAwesome/Font-Awesome)
The Font Awesome font is licensed under the SIL Open Font License - [http://scripts.sil.org/OFL](http://scripts.sil.org/OFL)
The Font Awesome pictograms are licensed under the CC BY 3.0 License - [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)
"Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"

View File

@@ -1,228 +0,0 @@
/**
* QtAwesome - use font-awesome (or other font icons) in your c++ / Qt Application
*
* MIT Licensed
*
* Copyright 2013-2015 - Reliable Bits Software by Blommers IT. All Rights Reserved.
* Author Rick Blommers
*/
#include "QtAwesome.h"
#include <QDebug>
#include <QFile>
#include <QFontDatabase>
/// The font-awesome icon painter
class QtAwesomeIconPainter
{
public:
void paint( QtAwesome* awesome, QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state, const QVariantMap& options )
{
Q_UNUSED(mode);
Q_UNUSED(state);
Q_UNUSED(options);
painter->save();
// set the correct color
QColor color = options.value("color").value<QColor>();
QString text = options.value("text").toString();
if( mode == QIcon::Disabled ) {
color = options.value("color-disabled").value<QColor>();
QVariant alt = options.value("text-disabled");
if( alt.isValid() ) {
text = alt.toString();
}
} else if( mode == QIcon::Active ) {
color = options.value("color-active").value<QColor>();
QVariant alt = options.value("text-active");
if( alt.isValid() ) {
text = alt.toString();
}
} else if( mode == QIcon::Selected ) {
color = options.value("color-selected").value<QColor>();
QVariant alt = options.value("text-selected");
if( alt.isValid() ) {
text = alt.toString();
}
}
painter->setPen(color);
// add some 'padding' around the icon
int drawSize = qRound(rect.height()*options.value("scale-factor").toFloat());
painter->setFont( awesome->font(drawSize) );
painter->drawText( rect, text, QTextOption( Qt::AlignCenter|Qt::AlignVCenter ) );
painter->restore();
}
};
//---------------------------------------------------------------------------------------
/// The painter icon engine.
class QtAwesomeIconPainterIconEngine : public QIconEngine
{
public:
QtAwesomeIconPainterIconEngine( QtAwesome* awesome, QtAwesomeIconPainter* painter, const QVariantMap& options )
: awesomeRef_(awesome)
, iconPainterRef_(painter)
, options_(options)
{
}
virtual ~QtAwesomeIconPainterIconEngine() {}
QtAwesomeIconPainterIconEngine* clone() const
{
return new QtAwesomeIconPainterIconEngine( awesomeRef_, iconPainterRef_, options_ );
}
virtual void paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state)
{
Q_UNUSED( mode );
Q_UNUSED( state );
iconPainterRef_->paint( awesomeRef_, painter, rect, mode, state, options_ );
}
virtual QPixmap pixmap(const QSize& size, QIcon::Mode mode, QIcon::State state)
{
QPixmap pm(size);
pm.fill( Qt::transparent ); // we need transparency
{
QPainter p(&pm);
paint(&p, QRect(QPoint(0,0),size), mode, state);
}
return pm;
}
private:
QtAwesome* awesomeRef_; ///< a reference to the QtAwesome instance
QtAwesomeIconPainter* iconPainterRef_; ///< a reference to the icon painter
QVariantMap options_; ///< the options for this icon painter
};
//---------------------------------------------------------------------------------------
/// The default icon colors
QtAwesome::QtAwesome()
{
// initialize the default options
setDefaultOption( "color", QColor(50,50,50) );
setDefaultOption( "color-disabled", QColor(70,70,70,60));
setDefaultOption( "color-active", QColor(10,10,10));
setDefaultOption( "color-selected", QColor(10,10,10));
setDefaultOption( "scale-factor", 0.9 );
setDefaultOption( "text", QVariant() );
setDefaultOption( "text-disabled", QVariant() );
setDefaultOption( "text-active", QVariant() );
setDefaultOption( "text-selected", QVariant() );
fontIconPainter_ = new QtAwesomeIconPainter();
// The macro below internally calls "qInitResources_QtAwesome()". this initializes
// the resource system. For a .pri project this isn't required, but when building and using a
// static library the resource need to initialized first.
///
// I've checked th qInitResource_* code and calling this method mutliple times shouldn't be any problem
// (More info about this subject: http://qt-project.org/wiki/QtResources)
Q_INIT_RESOURCE(QtAwesome);
// load the font file
QFile res(":/fonts/fontawesome-4.3.0.ttf");
res.open(QIODevice::ReadOnly);
QByteArray fontData( res.readAll() );
res.close();
QStringList loadedFontFamilies = QFontDatabase::applicationFontFamilies(QFontDatabase::addApplicationFontFromData(fontData));
if( !loadedFontFamilies.empty() ) {
fontName_= loadedFontFamilies.at(0);
}
}
QtAwesome::~QtAwesome()
{
delete fontIconPainter_;
}
/// a specialized init function so font-awesome is loaded and initialized
/// this method return true on success, it will return false if the fnot cannot be initialized
/// To initialize QtAwesome with font-awesome you need to call this method
QtAwesome * QtAwesome::self()
{
static QtAwesome * instance = 0;
if (!instance) {
instance = new QtAwesome();
}
return instance;
}
/// Sets a default option. These options are passed on to the icon painters
void QtAwesome::setDefaultOption(const QString& name, const QVariant& value)
{
defaultOptions_.insert( name, value );
}
/// Returns the default option for the given name
QVariant QtAwesome::defaultOption(const QString& name)
{
return defaultOptions_.value( name );
}
// internal helper method to merge to option amps
static QVariantMap mergeOptions( const QVariantMap& defaults, const QVariantMap& override )
{
QVariantMap result= defaults;
if( !override.isEmpty() ) {
QMapIterator<QString,QVariant> itr(override);
while( itr.hasNext() ) {
itr.next();
result.insert( itr.key(), itr.value() );
}
}
return result;
}
/// Creates an icon with the given code-point
/// <code>
/// awesome->icon( icon_group )
/// </code>
QIcon QtAwesome::icon(int character, const QVariantMap &options)
{
// create a merged QVariantMap to have default options and icon-specific options
QVariantMap optionMap = mergeOptions( defaultOptions_, options );
optionMap.insert("text", QString( QChar(static_cast<int>(character)) ) );
// Warning, when you use memoryleak detection. You should turn it of for the next call
// QIcon's placed in gui items are often cached and not deleted when my memory-leak detection checks for leaks.
// I'm not sure if it's a Qt bug or something I do wrong
QtAwesomeIconPainterIconEngine* engine = new QtAwesomeIconPainterIconEngine( this, fontIconPainter_, optionMap );
return QIcon( engine );
}
/// Creates/Gets the icon font with a given size in pixels. This can be usefull to use a label for displaying icons
/// Example:
///
/// QLabel* label = new QLabel( QChar( icon_group ) );
/// label->setFont( awesome->font(16) )
QFont QtAwesome::font( int size )
{
QFont font( fontName_);
font.setPixelSize(size);
return font;
}

View File

@@ -1,28 +0,0 @@
#-------------------------------------------------
#
# Project created by QtCreator 2013-04-18T13:28:42
#
#-------------------------------------------------
TARGET = QtAwesome
TEMPLATE = lib
CONFIG += staticlib c++11
SOURCES += QtAwesome.cpp
HEADERS += QtAwesome.h
isEmpty(PREFIX) {
unix {
PREFIX = /usr
} else {
PREFIX = $$[QT_INSTALL_PREFIX]
}
}
install_headers.files = QtAwesome.h
install_headers.path = $$PREFIX/include
target.path = $$PREFIX/lib
INSTALLS += install_headers target
RESOURCES += \
QtAwesome.qrc

View File

@@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/">
<file>fonts/fontawesome-4.3.0.ttf</file>
</qresource>
</RCC>

View File

@@ -1,190 +0,0 @@
QtAwesome - Font Awesome support for Qt applications
====================================================
Description
-----------
QtAwesome is a simple library that can be used to add [Font Awesome](http://fortawesome.github.io/Font-Awesome/) icons to your [Qt application](http://qt-project.org/).
NOTE: Though the name is QtAwesome and currently it's very Font Awesome based, you can use every other icon/glyph font you want.
The class can also be used to manage your own dynamic code-drawn icons, by adding named icon-painters.
Updated to FontAwesome 4
------------------------
This library has been updated to Font Awesome version 4.
The current Font Awesome version is **4.3.0**.
* You can find the previous FontAwesome 4 c++11 library in the [c++11 branch](https://github.com/gamecreature/QtAwesome/tree/c++11).
* You can find the previous FontAwesome 3 library in the [fontawesome-3 branch](https://github.com/gamecreature/QtAwesome/tree/fontawesome-3).
**Note about previous c++11**
I removed the C++11 requirement. And moved the c++11 code to a c++11 branch.
It's not that I don't like c++11, but the typed enum made the code less flexible then it is now.
Just integers it is. Simpler is better.
Installation
------------
The easiest way to include QtAweome in your project is to copy the QtAwesome directory to your
project tree and add the following `include()` to your Qt project file:
include(QtAwesome/QtAwesome.pri)
Now you are good to go!
Usage
-----
You probably want to create a single QtAwesome object for your whole application:
````
QtAwesome* awesome = new QtAwesome( qApp )
awesome->initFontAwesome(); // This line is important as it loads the font and initializes the named icon map
````
* Add an accessor to this object (i.e. a global function, member of your application object, or whatever you like).
* Use an icon name from the [Font Awesome Cheatsheet](http://fortawesome.github.io/Font-Awesome/cheatsheet/).
Example
--------
```c++
// You should create a single object of QtAwesome.
QtAwesome* awesome = new QtAwesome( qApp );
awesome->initFontAwesome();
// Next create your icon with the help of the icon-enumeration (no dashes):
QPushButton* beerButton new QPushButton( awesome->icon( fa::beer ), "Cheers!" );
// You can also use 'string' names to access the icons. (The string version omits the 'fa-' or 'icon-' prefix and has no dashes )
QPushButton* coffeeButton new QPushButton( awesome->icon( "coffee" ), "Black please!" );
// When you create an icon you can supply some options for your icons:
// The available options can be found at the "Default options"-section
QVariantMap options;
options.insert( "color" , QColor(255,0,0) );
QPushButton* musicButton = new QPushButton( awesome->icon( fa::music, options ), "Music" );
// You can also change the default options.
// for example if you always would like to have green icons you could call)
awesome->setDefaultOption( "color-disabled", QColor(0,255,0) );
// You can also directly render a label with this font
QLabel* label = new QLabel( QChar( fa::group ) );
label->setFont( awesome->font(16) );
```
Example custom painter
----------------------
This example registers a custom painter for supporting a duplicate icon (it draws 2 "plus marks"):
```c++
class DuplicateIconPainter : public QtAwesomeIconPainter
{
public:
virtual void paint( QtAwesome* awesome, QPainter* painter, const QRect& rectIn, QIcon::Mode mode, QIcon::State state, const QVariantMap& options )
{
int drawSize = qRound(rectIn.height()*0.5);
int offset = rectIn.height() / 4;
QChar chr = QChar( static_cast<int>(fa::plus) );
painter->setFont( awesome->font( drawSize ) );
painter->setPen( QColor(100,100,100) );
painter->drawText( QRect( QPoint(offset*2, offset*2), QSize(drawSize, drawSize) ), chr , QTextOption( Qt::AlignCenter|Qt::AlignVCenter ) );
painter->setPen( QColor(50,50,50) );
painter->drawText( QRect( QPoint(rectIn.width()-drawSize-offset, rectIn.height()-drawSize-offset), QSize(drawSize, drawSize) ), chr , QTextOption( Qt::AlignCenter|Qt::AlignVCenter ) );
}
};
awesome->give("duplicate", new DuplicateIconPainter() );
```
Default options:
----------------
The following options are default in the QtAwesome class.
```c++
setDefaultOption( "color", QColor(50,50,50) );
setDefaultOption( "color-disabled", QColor(70,70,70,60));
setDefaultOption( "color-active", QColor(10,10,10));
setDefaultOption( "color-selected", QColor(10,10,10));
setDefaultOption( "text", QString() ); // internal option
setDefaultOption( "text-disabled", QString() );
setDefaultOption( "text-active", QString() );
setDefaultOption( "text-selected", QString() );
setDefaultOption( "scale-factor", 0.9 );
```
When creating an icon, it first populates the options-map with the default options from the QtAwesome object.
After that the options are expanded/overwritten by the options supplied to the icon.
It is possible to use another glyph per icon-state. For example to make an icon-unlock symbol switch to locked when selected,
you could supply the following option:
```c++
options.insert("text-selected", QString( fa::lock ) );
```
License
-------
MIT License. Copyright 2013 - Reliable Bits Software by Blommers IT. [http://blommersit.nl/](http://blommersit.nl)
The Font Awesome font is licensed under the SIL Open Font License - [http://scripts.sil.org/OFL](http://scripts.sil.org/OFL)
The Font Awesome pictograms are licensed under the CC BY 3.0 License - [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)
"Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
Contact
-------
* email: <rick@blommersit.nl>
* twitter: [https://twitter.com/gamecreature](https://twitter.com/gamecreature)
* website: [http://blommersit.nl](http://blommersit.nl) (warning Dutch content ahead)
* github: [https://github.com/gamecreature/QtAwesome](https://github.com/gamecreature/QtAwesome)
Remarks
-------
I've created this project because I needed some nice icons for my own Qt project. After doing a lot of
css/html5 work and being spoiled by the ease of twitter bootstrap with Font Awesome,
I thought it would be nice to be able to use these icons for my Qt project.
I've slightly changed the code from the original, added some more documentation, but it's still
a work in progress. So feel free to drop me an e-mail for your suggestions and improvements!
There are still some things todo, like:
* document the usage of another icon font
* add some tests
* do some code cleanup
Thanks go to the contributors of this project!
And of course last but not least,
Many thanks go to Dave Gandy an the other Font Awesome contributors!! [http://fortawesome.github.com/Font-Awesome](http://fortawesome.github.com/Font-Awesome)
And of course to the Qt team/contributors for supplying this great cross-platform c++ library.
Contributions are welcome! Feel free to fork and send a pull request through Github.

View File

@@ -820,10 +820,9 @@ endif (NOT ENABLE_UBUNTU)
add_subdirectory(support)
add_subdirectory(3rdparty/qtiocompressor)
add_subdirectory(3rdparty/QtAwesome)
add_subdirectory(streams/icons)
add_subdirectory(online/icons)
target_link_libraries(cantata support-core qtiocompressor qtawesome ${CANTATA_LIBS} ${QTLIBS} ${ZLIB_LIBRARIES})
target_link_libraries(cantata support-core qtiocompressor ${CANTATA_LIBS} ${QTLIBS} ${ZLIB_LIBRARIES})
# enable warnings
add_definitions(-DQT_NO_DEBUG_OUTPUT)

View File

@@ -11,22 +11,14 @@
<file alias="shuffle24.png">icons/view-media-shuffle24.png</file>
<file alias="shuffle32.png">icons/view-media-shuffle32.png</file>
<file alias="sidebar-library-dark">icons/sidebar-library-dark.svg</file>
<file alias="sidebar-devices-dark">icons/sidebar-devices-dark.svg</file>
<file alias="sidebar-folders-dark">icons/sidebar-folders-dark.svg</file>
<file alias="sidebar-info-dark">icons/sidebar-info-dark.svg</file>
<file alias="sidebar-online-dark">icons/sidebar-online-dark.svg</file>
<file alias="sidebar-playlists-dark">icons/sidebar-playlists-dark.svg</file>
<file alias="sidebar-playqueue-dark">icons/sidebar-playqueue-dark.svg</file>
<file alias="sidebar-search-dark">icons/sidebar-search-dark.svg</file>
<file alias="sidebar-library-light">icons/sidebar-library-light.svg</file>
<file alias="sidebar-devices-light">icons/sidebar-devices-light.svg</file>
<file alias="sidebar-folders-light">icons/sidebar-folders-light.svg</file>
<file alias="sidebar-info-light">icons/sidebar-info-light.svg</file>
<file alias="sidebar-online-light">icons/sidebar-online-light.svg</file>
<file alias="sidebar-playlists-light">icons/sidebar-playlists-light.svg</file>
<file alias="sidebar-playqueue-light">icons/sidebar-playqueue-light.svg</file>
<file alias="sidebar-search-light">icons/sidebar-search-light.svg</file>
<file alias="sidebar-library">icons/sidebar-library.svg</file>
<file alias="sidebar-devices">icons/sidebar-devices.svg</file>
<file alias="sidebar-folders">icons/sidebar-folders.svg</file>
<file alias="sidebar-info">icons/sidebar-info.svg</file>
<file alias="sidebar-online">icons/sidebar-online.svg</file>
<file alias="sidebar-playlists">icons/sidebar-playlists.svg</file>
<file alias="sidebar-playqueue">icons/sidebar-playqueue.svg</file>
<file alias="sidebar-search">icons/sidebar-search.svg</file>
<file alias="soundcloud">online/icons/soundcloud.svg</file>
<file alias="jamendo">online/icons/jamendo.svg</file>
@@ -43,6 +35,7 @@
<file alias="album.svg">icons/media-optical.svg</file>
<file alias="album32.svg">icons/media-optical32.svg</file>
<file alias="mono-album.svg">icons/view-media-album.svg</file>
<file alias="artist.svg">icons/view-media-artist.svg</file>
<file alias="genre.svg">icons/view-media-genre.svg</file>
<file alias="radio16.png">icons/view-radiostream16.png</file>

View File

@@ -1,16 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="media-next-dark">icons/media-next-dark.svg</file>
<file alias="media-pause-dark">icons/media-pause-dark.svg</file>
<file alias="media-play-dark">icons/media-play-dark.svg</file>
<file alias="media-play-rtl-dark">icons/media-play-rtl-dark.svg</file>
<file alias="media-prev-dark">icons/media-prev-dark.svg</file>
<file alias="media-stop-dark">icons/media-stop-dark.svg</file>
<file alias="media-next-light">icons/media-next-light.svg</file>
<file alias="media-pause-light">icons/media-pause-light.svg</file>
<file alias="media-play-light">icons/media-play-light.svg</file>
<file alias="media-play-rtl-light">icons/media-play-rtl-light.svg</file>
<file alias="media-prev-light">icons/media-prev-light.svg</file>
<file alias="media-stop-light">icons/media-stop-light.svg</file>
<file alias="media-next">icons/media-next.svg</file>
<file alias="media-pause">icons/media-pause.svg</file>
<file alias="media-play">icons/media-play.svg</file>
<file alias="media-play-rtl">icons/media-play-rtl.svg</file>
<file alias="media-prev">icons/media-prev.svg</file>
<file alias="media-stop">icons/media-stop.svg</file>
</qresource>
</RCC>

View File

@@ -1,6 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="menu-icon-dark">icons/menu-icon-dark.svg</file>
<file alias="menu-icon-light">icons/menu-icon-light.svg</file>
<file alias="menu-icon">icons/menu-icon.svg</file>
</qresource>
</RCC>

View File

@@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1" fill="#f0f0f0">
<path d="m8 32c1.418 0.062 2.809 0.473 4 1.25l40 24c2.258 1.438 3.5 4.094 3.5 6.75s-1.242 5.312-3.5 6.75l-40 24c-1.191 0.777-2.582 1.188-4 1.25h-8v-64z"/>
<path d="m112 32v64h16v-64z"/>
<path d="m64 32c1.418 0.062 2.809 0.473 4 1.25l40 24c2.26 1.438 3.5 4.094 3.5 6.75s-1.24 5.312-3.5 6.75l-40 24c-1.191 0.777-2.582 1.188-4 1.25h-8v-64z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 534 B

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1" fill="#404040">
<g id="surface1" fill="#000">
<path d="m8 32c1.418 0.062 2.809 0.473 4 1.25l40 24c2.258 1.438 3.5 4.094 3.5 6.75s-1.242 5.312-3.5 6.75l-40 24c-1.191 0.777-2.582 1.188-4 1.25h-8v-64z"/>
<path d="m112 32v64h16v-64z"/>
<path d="m64 32c1.418 0.062 2.809 0.473 4 1.25l40 24c2.26 1.438 3.5 4.094 3.5 6.75s-1.24 5.312-3.5 6.75l-40 24c-1.191 0.777-2.582 1.188-4 1.25h-8v-64z"/>

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 531 B

View File

@@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1" fill="#f0f0f0">
<path d="m32 32v64h24v-64z"/>
<path d="m72 32v64h24v-64z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 254 B

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1" fill="#404040">
<g id="surface1" fill="#000">
<path d="m32 32v64h24v-64z"/>
<path d="m72 32v64h24v-64z"/>
</g>

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 251 B

View File

@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#f0f0f0" d="m32 24v80h8c1.402 0.01 2.785-0.31 4-1l56-32c2.49-1.375 3.75-4.188 3.75-7s-1.26-5.625-3.75-7l-56-32c-1.215-0.719-2.598-1.039-4-1.039h-0.75z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 345 B

View File

@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#404040" d="m96 24v80h-8c-1.402 0.01-2.785-0.31-4-1l-56-32c-2.488-1.375-3.75-4.188-3.75-7s1.262-5.625 3.75-7l56-32c1.215-0.719 2.598-1.039 4-1.039h0.75z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 347 B

View File

@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#f0f0f0" d="m96 24v80h-8c-1.402 0.01-2.785-0.31-4-1l-56-32c-2.488-1.375-3.75-4.188-3.75-7s1.262-5.625 3.75-7l56-32c1.215-0.719 2.598-1.039 4-1.039h0.75z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 347 B

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#404040" d="m32 24v80h8c1.402 0.01 2.785-0.31 4-1l56-32c2.49-1.375 3.75-4.188 3.75-7s-1.26-5.625-3.75-7l-56-32c-1.215-0.719-2.598-1.039-4-1.039h-0.75z"/>
<path fill="#000" d="m96 24v80h-8c-1.402 0.01-2.785-0.31-4-1l-56-32c-2.488-1.375-3.75-4.188-3.75-7s1.262-5.625 3.75-7l56-32c1.215-0.719 2.598-1.039 4-1.039h0.75z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 344 B

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#f0f0f0" d="m32 32v64h64v-64z"/>
<path fill="#000" d="m32 24v80h8c1.402 0.01 2.785-0.31 4-1l56-32c2.49-1.375 3.75-4.188 3.75-7s-1.26-5.625-3.75-7l-56-32c-1.215-0.719-2.598-1.039-4-1.039h-0.75z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 342 B

View File

@@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1" fill="#f0f0f0">
<path d="m120 32c-1.42 0.062-2.81 0.473-4 1.25l-40 24c-2.258 1.438-3.5 4.094-3.5 6.75s1.242 5.312 3.5 6.75l40 24c1.19 0.777 2.58 1.188 4 1.25h8v-64z"/>
<path d="m16 32v64h-16v-64z"/>
<path d="m64 32c-1.418 0.062-2.809 0.473-4 1.25l-40 24c-2.258 1.438-3.5 4.094-3.5 6.75s1.242 5.312 3.5 6.75l40 24c1.191 0.777 2.582 1.188 4 1.25h8v-64z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 532 B

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1" fill="#404040">
<g id="surface1" fill="#000">
<path d="m120 32c-1.42 0.062-2.81 0.473-4 1.25l-40 24c-2.258 1.438-3.5 4.094-3.5 6.75s1.242 5.312 3.5 6.75l40 24c1.19 0.777 2.58 1.188 4 1.25h8v-64z"/>
<path d="m16 32v64h-16v-64z"/>
<path d="m64 32c-1.418 0.062-2.809 0.473-4 1.25l-40 24c-2.258 1.438-3.5 4.094-3.5 6.75s1.242 5.312 3.5 6.75l40 24c1.191 0.777 2.582 1.188 4 1.25h8v-64z"/>

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 529 B

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#404040" d="m32 32v64h64v-64z"/>
<path fill="#000" d="m32 32v64h64v-64z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 221 B

View File

@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#404040" d="m64 8c-1.766 0-3.527 0.0898-5.25 0.25l-3.25 16.75c-2.676 0.586-5.305 1.406-7.75 2.5l-12.25-11.75c-3.109 1.84-5.816 4.113-8.5 6.5l7.25 15.25c-1.777 1.992-3.395 4.18-4.75 6.5l-16.75-2.25c-1.422 3.27-2.469 6.691-3.25 10.25l14.75 8c-0.137 1.344-0.25 2.617-0.25 4 0 1.379 0.113 2.652 0.25 4l-14.75 8c0.781 3.559 1.828 6.98 3.25 10.25l16.75-2.25c1.355 2.32 2.973 4.508 4.75 6.5l-7.25 15.25c2.684 2.39 5.391 4.66 8.5 6.5l12.25-11.75c2.445 1.09 5.074 1.91 7.75 2.5l3.25 16.75c1.723 0.16 3.484 0.25 5.25 0.25s3.527-0.09 5.25-0.25l3.25-16.75c2.676-0.59 5.305-1.41 7.75-2.5l12.25 11.75c3.109-1.84 5.816-4.11 8.5-6.5l-7.25-15.25c1.777-1.992 3.395-4.18 4.75-6.5l16.75 2.25c1.42-3.273 2.47-6.691 3.25-10.25l-14.75-8c0.14-1.348 0.25-2.621 0.25-4 0-1.383-0.11-2.656-0.25-4l14.75-8c-0.78-3.559-1.83-6.98-3.25-10.25l-16.75 2.25c-1.355-2.32-2.973-4.508-4.75-6.5l7.25-15.25c-2.684-2.387-5.391-4.66-8.5-6.5l-12.25 11.75c-2.445-1.094-5.074-1.914-7.75-2.5l-3.25-16.75c-1.723-0.1602-3.484-0.25-5.25-0.25zm0 32c13.254 0 24 10.746 24 24s-10.746 24-24 24-24-10.746-24-24 10.746-24 24-24z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#f0f0f0" d="m64 8c-1.766 0-3.527 0.0898-5.25 0.25l-3.25 16.75c-2.676 0.586-5.305 1.406-7.75 2.5l-12.25-11.75c-3.109 1.84-5.816 4.113-8.5 6.5l7.25 15.25c-1.777 1.992-3.395 4.18-4.75 6.5l-16.75-2.25c-1.422 3.27-2.469 6.691-3.25 10.25l14.75 8c-0.137 1.344-0.25 2.617-0.25 4 0 1.379 0.113 2.652 0.25 4l-14.75 8c0.781 3.559 1.828 6.98 3.25 10.25l16.75-2.25c1.355 2.32 2.973 4.508 4.75 6.5l-7.25 15.25c2.684 2.39 5.391 4.66 8.5 6.5l12.25-11.75c2.445 1.09 5.074 1.91 7.75 2.5l3.25 16.75c1.723 0.16 3.484 0.25 5.25 0.25s3.527-0.09 5.25-0.25l3.25-16.75c2.676-0.59 5.305-1.41 7.75-2.5l12.25 11.75c3.109-1.84 5.816-4.11 8.5-6.5l-7.25-15.25c1.777-1.992 3.395-4.18 4.75-6.5l16.75 2.25c1.42-3.273 2.47-6.691 3.25-10.25l-14.75-8c0.14-1.348 0.25-2.621 0.25-4 0-1.383-0.11-2.656-0.25-4l14.75-8c-0.78-3.559-1.83-6.98-3.25-10.25l-16.75 2.25c-1.355-2.32-2.973-4.508-4.75-6.5l7.25-15.25c-2.684-2.387-5.391-4.66-8.5-6.5l-12.25 11.75c-2.445-1.094-5.074-1.914-7.75-2.5l-3.25-16.75c-1.723-0.1602-3.484-0.25-5.25-0.25zm0 32c13.254 0 24 10.746 24 24s-10.746 24-24 24-24-10.746-24-24 10.746-24 24-24z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

5
icons/menu-icon.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="128pt" width="128pt" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
<g id="surface1">
<path fill="#000" d="m64 8c-1.766 0-3.527 0.0898-5.25 0.25l-3.25 16.75c-2.676 0.586-5.305 1.406-7.75 2.5l-12.25-11.75c-3.109 1.84-5.816 4.113-8.5 6.5l7.25 15.25c-1.777 1.992-3.395 4.18-4.75 6.5l-16.75-2.25c-1.422 3.27-2.469 6.691-3.25 10.25l14.75 8c-0.137 1.344-0.25 2.617-0.25 4 0 1.379 0.113 2.652 0.25 4l-14.75 8c0.781 3.559 1.828 6.98 3.25 10.25l16.75-2.25c1.355 2.32 2.973 4.508 4.75 6.5l-7.25 15.25c2.684 2.39 5.391 4.66 8.5 6.5l12.25-11.75c2.445 1.09 5.074 1.91 7.75 2.5l3.25 16.75c1.723 0.16 3.484 0.25 5.25 0.25s3.527-0.09 5.25-0.25l3.25-16.75c2.676-0.59 5.305-1.41 7.75-2.5l12.25 11.75c3.109-1.84 5.816-4.11 8.5-6.5l-7.25-15.25c1.777-1.992 3.395-4.18 4.75-6.5l16.75 2.25c1.42-3.273 2.47-6.691 3.25-10.25l-14.75-8c0.14-1.348 0.25-2.621 0.25-4 0-1.383-0.11-2.656-0.25-4l14.75-8c-0.78-3.559-1.83-6.98-3.25-10.25l-16.75 2.25c-1.355-2.32-2.973-4.508-4.75-6.5l7.25-15.25c-2.684-2.387-5.391-4.66-8.5-6.5l-12.25 11.75c-2.445-1.094-5.074-1.914-7.75-2.5l-3.25-16.75c-1.723-0.1602-3.484-0.25-5.25-0.25zm0 32c13.254 0 24 10.746 24 24s-10.746 24-24 24-24-10.746-24-24 10.746-24 24-24z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m368 0h-224c-26.4 0-48 21.6-48 48v416c0 26.4 21.6 48 48 48h224c26.4 0 48-21.6 48-48v-416c0-26.4-21.6-48-48-48zm-176 24h128v16h-128v-16zm64 456c-17.673 0-32-14.327-32-32s14.327-32 32-32 32 14.327 32 32-14.327 32-32 32zm128-96h-256v-320h256v320z"/>
</svg>

Before

Width:  |  Height:  |  Size: 341 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m368 0h-224c-26.4 0-48 21.6-48 48v416c0 26.4 21.6 48 48 48h224c26.4 0 48-21.6 48-48v-416c0-26.4-21.6-48-48-48zm-176 24h128v16h-128v-16zm64 456c-17.673 0-32-14.327-32-32s14.327-32 32-32 32 14.327 32 32-14.327 32-32 32zm128-96h-256v-320h256v320z"/>
</svg>

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 338 B

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m416 480 96-256h-416l-96 256zm-352-288-64 288v-416h144l64 64h208v64z"/>
</svg>

Before

Width:  |  Height:  |  Size: 166 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m416 480 96-256h-416l-96 256zm-352-288-64 288v-416h144l64 64h208v64z"/>
</svg>

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 163 B

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m256 0c-141.38 0-256 114.62-256 256s114.62 256 256 256 256-114.62 256-256-114.62-256-256-256zm-32 96h64v64h-64v-64zm96 320h-128v-32h32v-128h-32v-32h96v160h32v32z"/>
</svg>

Before

Width:  |  Height:  |  Size: 259 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m256 0c-141.38 0-256 114.62-256 256s114.62 256 256 256 256-114.62 256-256-114.62-256-256-256zm-32 96h64v64h-64v-64zm96 320h-128v-32h32v-128h-32v-32h96v160h32v32z"/>
</svg>

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 256 B

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" viewBox="0 0 64 64" fill="#f0f0f0">
<path d="m60 0h4v46c0 5.523-6.268 10-14 10s-14-4.477-14-10c0-5.523 6.268-10 14-10 3.918 0 7.459 1.15 10 3.002v-23.003l-32 7.111v30.889c0 5.523-6.268 10-14 10s-14-4.477-14-10c0-5.523 6.268-10 14-10 3.918 0 7.459 1.15 10 3.002v-39.002l36-8z"/>
</svg>

Before

Width:  |  Height:  |  Size: 362 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" viewBox="0 0 64 64" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" viewBox="0 0 64 64" fill="#000">
<path d="m60 0h4v46c0 5.523-6.268 10-14 10s-14-4.477-14-10c0-5.523 6.268-10 14-10 3.918 0 7.459 1.15 10 3.002v-23.003l-32 7.111v30.889c0 5.523-6.268 10-14 10s-14-4.477-14-10c0-5.523 6.268-10 14-10 3.918 0 7.459 1.15 10 3.002v-39.002l36-8z"/>
</svg>

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 359 B

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m256.27-0.5424c-141.53 0-256.27 114.74-256.27 256.27s114.74 256.27 256.27 256.27 256.27-114.74 256.27-256.27-114.74-256.27-256.27-256.27zm145 341.69c4.5808-21.598 7.4724-44.523 8.4132-68.339h68.043c-1.7811 23.596-7.2738 46.51-16.38 68.339h-60.076zm-290-170.85c-4.5808 21.598-7.4724 44.523-8.4132 68.339h-68.042c1.7811-23.595 7.2728-46.51 16.379-68.339h60.076zm255 0c5.1329 21.87 8.221 44.77 9.2258 68.339h-102.14v-68.339h92.918zm-92.918-34.17v-100.02c7.7896 2.2669 15.507 6.0704 23.079 11.409 14.192 10.005 27.769 25.418 39.263 44.573 7.9455 13.242 14.817 27.985 20.553 44.038h-82.895zm-96.512-44.038c11.494-19.155 25.07-34.569 39.263-44.573 7.5717-5.339 15.29-9.1425 23.079-11.409v100.02h-82.895c5.7373-16.052 12.608-30.795 20.553-44.038zm62.342 78.208v68.339h-102.14c1.0037-23.57 4.0929-46.469 9.2247-68.339h92.918zm-187.99 170.85c-9.1062-21.829-14.598-44.743-16.379-68.339h68.042c0.9407 23.816 3.8323 46.741 8.4132 68.339h-60.076zm85.85-68.339h102.14v68.339h-92.918c-5.1318-21.868-8.221-44.77-9.2247-68.339zm102.14 102.51v100.02c-7.7885-2.2669-15.506-6.0715-23.079-11.409-14.193-10.005-27.77-25.419-39.263-44.573-7.9455-13.243-14.816-27.986-20.554-44.038h82.896zm96.512 44.038c-11.494 19.154-25.071 34.568-39.263 44.573-7.5728 5.3379-15.29 9.1425-23.079 11.409v-100.02h82.896c-5.7373 16.052-12.608 30.795-20.554 44.038zm-62.342-78.208v-68.339h102.14c-1.0037 23.57-4.0929 46.47-9.2258 68.339h-92.916zm136.33-102.51c-0.9407-23.816-3.8323-46.741-8.4132-68.339h60.076c9.1062 21.829 14.599 44.744 16.38 68.339h-68.043zm33.801-102.51h-51.201c-9.9508-31.373-23.692-58.886-40.211-80.847 22.71 10.86 43.277 25.422 61.246 43.391 11.468 11.467 21.549 23.992 30.166 37.456zm-344.27-37.456c17.97-17.97 38.537-32.532 61.246-43.391-16.52 21.961-30.259 49.474-40.211 80.847h-51.2c8.616-13.464 18.698-25.989 30.165-37.456zm-30.165 276.64h51.2c9.9519 31.373 23.692 58.886 40.212 80.848-22.71-10.86-43.277-25.422-61.246-43.392-11.468-11.467-21.55-23.992-30.166-37.456zm344.26 37.456c-17.969 17.97-38.537 32.533-61.246 43.392 16.52-21.961 30.26-49.475 40.211-80.848h51.201c-8.6171 13.464-18.698 25.989-30.166 37.456z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m256.27-0.5424c-141.53 0-256.27 114.74-256.27 256.27s114.74 256.27 256.27 256.27 256.27-114.74 256.27-256.27-114.74-256.27-256.27-256.27zm145 341.69c4.5808-21.598 7.4724-44.523 8.4132-68.339h68.043c-1.7811 23.596-7.2738 46.51-16.38 68.339h-60.076zm-290-170.85c-4.5808 21.598-7.4724 44.523-8.4132 68.339h-68.042c1.7811-23.595 7.2728-46.51 16.379-68.339h60.076zm255 0c5.1329 21.87 8.221 44.77 9.2258 68.339h-102.14v-68.339h92.918zm-92.918-34.17v-100.02c7.7896 2.2669 15.507 6.0704 23.079 11.409 14.192 10.005 27.769 25.418 39.263 44.573 7.9455 13.242 14.817 27.985 20.553 44.038h-82.895zm-96.512-44.038c11.494-19.155 25.07-34.569 39.263-44.573 7.5717-5.339 15.29-9.1425 23.079-11.409v100.02h-82.895c5.7373-16.052 12.608-30.795 20.553-44.038zm62.342 78.208v68.339h-102.14c1.0037-23.57 4.0929-46.469 9.2247-68.339h92.918zm-187.99 170.85c-9.1062-21.829-14.598-44.743-16.379-68.339h68.042c0.9407 23.816 3.8323 46.741 8.4132 68.339h-60.076zm85.85-68.339h102.14v68.339h-92.918c-5.1318-21.868-8.221-44.77-9.2247-68.339zm102.14 102.51v100.02c-7.7885-2.2669-15.506-6.0715-23.079-11.409-14.193-10.005-27.77-25.419-39.263-44.573-7.9455-13.243-14.816-27.986-20.554-44.038h82.896zm96.512 44.038c-11.494 19.154-25.071 34.568-39.263 44.573-7.5728 5.3379-15.29 9.1425-23.079 11.409v-100.02h82.896c-5.7373 16.052-12.608 30.795-20.554 44.038zm-62.342-78.208v-68.339h102.14c-1.0037 23.57-4.0929 46.47-9.2258 68.339h-92.916zm136.33-102.51c-0.9407-23.816-3.8323-46.741-8.4132-68.339h60.076c9.1062 21.829 14.599 44.744 16.38 68.339h-68.043zm33.801-102.51h-51.201c-9.9508-31.373-23.692-58.886-40.211-80.847 22.71 10.86 43.277 25.422 61.246 43.391 11.468 11.467 21.549 23.992 30.166 37.456zm-344.27-37.456c17.97-17.97 38.537-32.532 61.246-43.391-16.52 21.961-30.259 49.474-40.211 80.847h-51.2c8.616-13.464 18.698-25.989 30.165-37.456zm-30.165 276.64h51.2c9.9519 31.373 23.692 58.886 40.212 80.848-22.71-10.86-43.277-25.422-61.246-43.392-11.468-11.467-21.55-23.992-30.166-37.456zm344.26 37.456c-17.969 17.97-38.537 32.533-61.246 43.392 16.52-21.961 30.26-49.475 40.211-80.848h51.201c-8.6171 13.464-18.698 25.989-30.166 37.456z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m192 32h320v64h-320v-64zm0 192h320v64h-320v-64zm0 192h320v64h-320v-64zm-192-352a64 64 0 1 0 128 0 64 64 0 1 0 -128 0zm0 192a64 64 0 1 0 128 0 64 64 0 1 0 -128 0zm0 192a64 64 0 1 0 128 0 64 64 0 1 0 -128 0z"/>
</svg>

Before

Width:  |  Height:  |  Size: 303 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m192 32h320v64h-320v-64zm0 192h320v64h-320v-64zm0 192h320v64h-320v-64zm-192-352a64 64 0 1 0 128 0 64 64 0 1 0 -128 0zm0 192a64 64 0 1 0 128 0 64 64 0 1 0 -128 0zm0 192a64 64 0 1 0 128 0 64 64 0 1 0 -128 0z"/>
</svg>

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 300 B

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m96 64 320 192-320 192z"/>
</svg>

Before

Width:  |  Height:  |  Size: 121 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m96 64 320 192-320 192z"/>
</svg>

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 118 B

View File

@@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#f0f0f0">
<path d="m496.13 435.7l-121.27-103.15c-12.537-11.283-25.945-16.463-36.776-15.963 28.63-33.54 45.92-77.04 45.92-124.59 0-106.04-85.96-192-192-192s-192 85.961-192 192 85.961 192 192 192c47.549 0 91.054-17.293 124.59-45.922-0.5 10.831 4.68 24.239 15.963 36.776l103.15 121.28c17.661 19.623 46.511 21.277 64.11 3.678s15.94-46.46-3.68-64.12zm-304.13-115.7c-70.692 0-128-57.308-128-128s57.31-128 128-128 128 57.308 128 128-57.31 128-128 128z"/>
</svg>

Before

Width:  |  Height:  |  Size: 523 B

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#404040">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m496.13 435.7l-121.27-103.15c-12.537-11.283-25.945-16.463-36.776-15.963 28.63-33.54 45.92-77.04 45.92-124.59 0-106.04-85.96-192-192-192s-192 85.961-192 192 85.961 192 192 192c47.549 0 91.054-17.293 124.59-45.922-0.5 10.831 4.68 24.239 15.963 36.776l103.15 121.28c17.661 19.623 46.511 21.277 64.11 3.678s15.94-46.46-3.68-64.12zm-304.13-115.7c-70.692 0-128-57.308-128-128s57.31-128 128-128 128 57.308 128 128-57.31 128-128 128z"/>
</svg>

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 520 B

4
icons/view-media-album.svg Executable file
View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#000">
<path d="m256 0c-141.38 0-256 114.62-256 256s114.62 256 256 256 256-114.62 256-256-114.62-256-256-256zm0 448c-106.04 0-192-85.961-192-192s85.961-192 192-192 192 85.961 192 192-85.961 192-192 192z"/>
<path d="m256 145.12c-63.368 0-115.22 51.85-115.22 115.22s51.85 115.22 115.22 115.22 115.22-51.85 115.22-115.22-51.85-115.22-115.22-115.22zm0 70.969c24.788 0 44.25 19.462 44.25 44.25s-19.462 44.25-44.25 44.25-44.25-19.462-44.25-44.25 19.462-44.25 44.25-44.25z" transform="matrix(.75867 0 0 .75867 61.541 57.506)"/>
</svg>

After

Width:  |  Height:  |  Size: 596 B

View File

@@ -1,21 +1,15 @@
<svg id="svg1307" xmlns="http://www.w3.org/2000/svg" height="128" width="128" version="1.0" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs1309">
<linearGradient id="linearGradient2905">
<stop id="stop2907" stop-color="#fff" offset="0"/>
<stop id="stop2909" stop-color="#fff" stop-opacity="0" offset="1"/>
</linearGradient>
<linearGradient id="linearGradient3082" y2="169.16" gradientUnits="userSpaceOnUse" x2="75.186" gradientTransform="matrix(.97642 0 0 .97642 1.5136 .0095408)" y1="-217.56" x1="91.829">
<stop id="stop2930" stop-color="#f6f6f6" offset="0"/>
<stop id="stop2932" stop-color="#f6f6f6" stop-opacity="0" offset="1"/>
</linearGradient>
<linearGradient id="linearGradient3085" y2="150.66" xlink:href="#linearGradient2905" gradientUnits="userSpaceOnUse" x2="-68.625" gradientTransform="matrix(-.97642 0 0 .97642 -58.973 -53.552)" y1="159.35" x1="-185.31"/>
<linearGradient id="linearGradient3088" y2="150.66" xlink:href="#linearGradient2905" gradientUnits="userSpaceOnUse" x2="-68.625" gradientTransform="matrix(.97642 0 0 .97642 188.53 -53.552)" y1="162.55" x1="-140.06"/>
<linearGradient id="linearGradient3085" y2="150.66" gradientUnits="userSpaceOnUse" x2="-68.625" gradientTransform="matrix(-.97642 0 0 .97642 -58.973 -53.552)" y1="159.35" x1="-185.31"/>
<linearGradient id="linearGradient3088" y2="150.66" gradientUnits="userSpaceOnUse" x2="-68.625" gradientTransform="matrix(.97642 0 0 .97642 188.53 -53.552)" y1="162.55" x1="-140.06"/>
<linearGradient id="linearGradient3091" y2="68.546" gradientUnits="userSpaceOnUse" x2="8.878" gradientTransform="matrix(.97642 0 0 .97642 89.254 -30.605)" y1="68.546" x1="-36.688">
<stop id="stop2894" stop-color="#fff" offset="0"/>
<stop id="stop2896" stop-color="#fff" stop-opacity="0" offset="1"/>
</linearGradient>
</defs>
<path id="path2876" d="m64.127 1.3826c-5.701 0.0729-11.221 2.7578-15.745 9.0324-12.471 3.341-15.686 21.062-16.782 33.381-1.393 15.652 6.616 25.489 17.514 29.72-0.158 1.776-0.554 3.289-1.098 4.211-2.048 3.467-6.698 6.474-14.738 8.757-8.97 2.547-16.086 5.022-21.237 9.551-4.5612 4.005-7.5066 8.645-7.5066 14.585 0 15.42 119.34 16.23 119.34 0 0-5.94-2.94-10.58-7.5-14.585-5.1-4.479-12.21-7.11-21.242-9.673-8.1-2.3-12.746-5.212-14.768-8.635-0.675-1.143-1.095-3.167-1.16-5.523 9.917-4.632 17.762-13.575 18.919-26.76 1.836-20.931-16.891-44.28-33.992-44.061z" stroke-opacity=".20732" stroke="#000" stroke-width="1.9528"/>
<path id="path2876" d="m64.127 1.3826c-5.701 0.0729-11.221 2.7578-15.745 9.0324-12.471 3.341-15.686 21.062-16.782 33.381-1.393 15.652 6.616 25.489 17.514 29.72-0.158 1.776-0.554 3.289-1.098 4.211-2.048 3.467-6.698 6.474-14.738 8.757-8.97 2.547-16.086 5.022-21.237 9.551-4.5612 4.005-7.5066 8.645-7.5066 14.585 0 15.42 119.34 16.23 119.34 0 0-5.94-2.94-10.58-7.5-14.585-5.1-4.479-12.21-7.11-21.242-9.673-8.1-2.3-12.746-5.212-14.768-8.635-0.675-1.143-1.095-3.167-1.16-5.523 9.917-4.632 17.762-13.575 18.919-26.76 1.836-20.931-16.891-44.28-33.992-44.061z" stroke-opacity=".20732" stroke="#000" stroke-width="1.9528" fill="#000"/>
<path id="path2276" d="m50.893 3.2813v-2.7947 2.7947z" fill-opacity=".75688" fill="#fff"/>
<path id="path2882" fill="url(#linearGradient3091)" d="m63.806 2.319c-3.601 0.046-7.123 1.1624-10.375 3.5395 2.947-1.8678 7.703-2.1105 10.896-1.8186 15.05 1.3757 34.238 22.173 32.403 43.103-0.909 10.362-5.947 18.101-12.877 23.19 7.479-5.064 12.989-13.063 13.944-23.953 1.836-20.93-16.89-44.28-33.991-44.061z"/>
<path id="path2900" fill="url(#linearGradient3088)" d="m79.147 75.901c-0.047 0.023-0.098 0.036-0.145 0.058 0.061 2.244 0.461 4.169 1.104 5.258 1.924 3.258 6.347 6.03 14.058 8.219 8.596 2.44 15.366 4.944 20.216 9.208 4 3.516 6.69 7.546 7.09 12.576 0.02-0.16 0.05-0.33 0.05-0.49 0-5.66-2.8-10.07-7.14-13.887-4.85-4.264-11.62-6.768-20.216-9.208-7.711-2.188-12.134-4.961-14.058-8.219-0.469-0.794-0.786-2.031-0.959-3.515z"/>

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -2,5 +2,5 @@
.str0 {stroke:#131516;stroke-width:3}
.str1 {stroke:#131516;stroke-width:42}
.fil1 {fill:none}
.fil0 {fill:#131516}
.fil0 {fill:#000}
</style></defs><g id="Layer 1" transform="matrix(0.41530553,0,0,0.2154621,-354.21993,-1195.3238)"><path class="fil0 str0" d="m 2002,7851 c -61,17 -116,55 -167,113 -51,59 -76,124 -76,194 0,44 15,94 44,147 29,54 73,93 130,118 19,4 28,14 28,28 0,5 -7,10 -24,14 -91,-23 -166,-72 -224,-145 -58,-74 -88,-158 -90,-254 3,-103 34,-199 93,-287 60,-89 137,-152 231,-189 l -69,-355 c -154,128 -279,261 -376,401 -97,139 -147,290 -151,453 2,73 17,144 45,212 28,69 70,131 126,188 113,113 260,172 439,178 61,-4 126,-15 196,-33 l -155,-783 z m 72,-10 156,769 c 154,-62 231,-197 231,-403 -9,-69 -29,-131 -63,-186 -33,-56 -77,-100 -133,-132 -56,-32 -119,-48 -191,-48 z M 1869,6801 c 33,-20 71,-55 112,-104 41,-48 81,-105 119,-169 39,-65 70,-131 93,-198 23,-66 34,-129 34,-187 0,-25 -2,-50 -7,-72 -4,-36 -15,-64 -34,-83 -19,-18 -43,-28 -73,-28 -60,0 -114,37 -162,111 -37,64 -68,140 -90,226 -23,87 -36,173 -38,260 5,99 21,180 46,244 z m -63,58 c -45,-162 -70,-327 -75,-495 1,-108 12,-209 33,-303 20,-94 49,-175 87,-245 37,-70 80,-123 128,-159 43,-32 74,-49 91,-49 13,0 24,5 34,14 10,9 23,24 39,44 119,169 179,373 179,611 0,113 -15,223 -45,333 -29,109 -72,213 -129,310 -58,98 -126,183 -205,256 l 81,394 c 44,-5 74,-9 91,-9 76,0 144,16 207,48 63,32 117,75 161,130 44,54 78,116 102,186 23,70 36,143 36,219 0,118 -31,226 -93,323 -62,97 -155,168 -280,214 8,49 22,120 43,211 20,92 35,165 45,219 10,54 14,106 14,157 0,79 -19,149 -57,211 -39,62 -91,110 -157,144 -65,34 -137,51 -215,51 -110,0 -206,-31 -288,-92 -82,-62 -126,-145 -130,-251 3,-47 14,-91 34,-133 20,-42 47,-76 82,-102 34,-27 75,-41 122,-44 39,0 76,11 111,32 34,22 62,51 83,88 20,37 31,78 31,122 0,59 -20,109 -60,150 -40,41 -91,62 -152,62 l -23,0 c 39,60 103,91 192,91 45,0 91,-10 137,-28 47,-19 86,-44 119,-76 33,-32 55,-66 64,-102 17,-41 25,-98 25,-169 0,-48 -5,-96 -14,-144 -9,-47 -23,-110 -42,-188 -19,-77 -33,-137 -41,-178 -60,15 -122,23 -187,23 -109,0 -212,-22 -309,-67 -97,-45 -182,-107 -256,-187 -73,-80 -130,-170 -171,-272 -40,-101 -61,-207 -62,-317 4,-102 23,-200 59,-292 36,-93 82,-181 139,-263 57,-82 116,-157 177,-224 62,-66 143,-151 245,-254 z" id="path9" style="fill:#131516;stroke:#131516;stroke-width:53.02221298"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -14,9 +14,10 @@ add_library(support-core STATIC ${SUPPORT_CORE_MOC_SRCS} ${SUPPORT_CORE_SRCS})
if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB)
set (SUPPORT_SRCS icon.cpp fancytabwidget.cpp messagewidget.cpp buddylabel.cpp action.cpp actioncollection.cpp lineedit.cpp
configuration.cpp gtkstyle.cpp spinner.cpp messagebox.cpp inputdialog.cpp thread.cpp squeezedtextlabel.cpp proxystyle.cpp
touchproxystyle.cpp pagewidget.cpp combobox.cpp configdialog.cpp)
touchproxystyle.cpp pagewidget.cpp combobox.cpp configdialog.cpp monoicon.cpp)
set(SUPPORT_MOC_HDRS fancytabwidget.h messagewidget.h inputdialog.h pagewidget.h action.h actioncollection.h configdialog.h)
set(SUPPORT_RCS fontawesome.qrc)
if (ENABLE_TOUCH_SUPPORT)
set(SUPPORT_SRCS ${SUPPORT_SRCS} flickcharm.cpp)
@@ -74,8 +75,10 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB)
if (ENABLE_QT5)
qt5_wrap_cpp(SUPPORT_MOC_SRCS ${SUPPORT_MOC_HDRS})
qt5_add_resources(SUPPORT_RC_SRCS ${SUPPORT_RCS})
else (ENABLE_QT5)
qt4_wrap_cpp(SUPPORT_MOC_SRCS ${SUPPORT_MOC_HDRS})
qt4_add_resources(SUPPORT_RC_SRCS ${SUPPORT_RCS})
endif (ENABLE_QT5)
add_library(support STATIC ${SUPPORT_MOC_SRCS} ${SUPPORT_SRCS} ${SUPPORT_UI_HDRS} ${SUPPORT_RC_SRCS})

5
support/fontawesome.qrc Normal file
View File

@@ -0,0 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>fontawesome-4.3.0.ttf</file>
</qresource>
</RCC>

152
support/monoicon.cpp Normal file
View File

@@ -0,0 +1,152 @@
/*
* Cantata
*
* Copyright (c) 2011-2016 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "monoicon.h"
#include "utils.h"
#include <QFile>
#include <QIconEngine>
#include <QSvgRenderer>
#include <QPainter>
#include <QPixmapCache>
#include <QRect>
#include <QFontDatabase>
class MonoIconEngine : public QIconEngine
{
public:
MonoIconEngine(const QString &file, FontAwesome::icon fa, const QColor &col, const QColor &sel)
: fileName(file)
, fontAwesomeIcon(fa)
, color(col)
, selectedColor(sel)
{
}
virtual ~MonoIconEngine() {}
MonoIconEngine * clone() const
{
return new MonoIconEngine(fileName, fontAwesomeIcon, color, selectedColor);
}
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)
{
Q_UNUSED(state)
QColor col=QIcon::Selected==mode ? selectedColor : color;
QString key=(fileName.isEmpty() ? QString::number(fontAwesomeIcon) : fileName)+
QLatin1Char('-')+QString::number(rect.width())+QLatin1Char('-')+QString::number(rect.height())+QLatin1Char('-')+col.name();
QPixmap pix;
if (!QPixmapCache::find(key, &pix)) {
pix=QPixmap(rect.width(), rect.height());
pix.fill(Qt::transparent);
QPainter p(&pix);
if (fileName.isEmpty()) {
// Load fontawesome, if it is not already loaded
if (fontAwesomeFontName.isEmpty()) {
Q_INIT_RESOURCE(fontawesome);
QFile res(":fontawesome-4.3.0.ttf");
res.open(QIODevice::ReadOnly);
QByteArray fontData( res.readAll() );
res.close();
QStringList loadedFontFamilies = QFontDatabase::applicationFontFamilies(QFontDatabase::addApplicationFontFromData(fontData));
if (!loadedFontFamilies.empty()) {
fontAwesomeFontName= loadedFontFamilies.at(0);
}
}
double scale=1.0;
switch (fontAwesomeIcon) {
case FontAwesome::lastfmsquare:
case FontAwesome::lastfm:
scale=1.1;
break;
case FontAwesome::list:
if (!Utils::isHighDpi()) {
scale=1.05;
}
default:
break;
}
QFont font(fontAwesomeFontName);
font.setPixelSize(qRound(rect.height()*scale));
p.setFont(font);
p.setPen(col);
p.drawText(QRect(0, 0, rect.width(), rect.height()), QString(QChar(static_cast<int>(fontAwesomeIcon))), QTextOption(Qt::AlignCenter|Qt::AlignVCenter));
} else {
QSvgRenderer renderer;
QFile f(fileName);
QByteArray bytes;
if (f.open(QIODevice::ReadOnly)) {
bytes=f.readAll();
}
if (!bytes.isEmpty()) {
bytes.replace("#000", col.name().toLatin1());
}
renderer.load(bytes);
renderer.render(&p, QRect(0, 0, rect.width(), rect.height()));
}
QPixmapCache::insert(key, pix);
}
if (QIcon::Disabled==mode) {
painter->save();
painter->setOpacity(painter->opacity()*0.4);
}
painter->drawPixmap(rect.topLeft(), pix);
if (QIcon::Disabled==mode) {
painter->restore();
}
}
virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state)
{
QPixmap pix(size);
pix.fill(Qt::transparent);
QPainter painter(&pix);
paint(&painter, QRect(QPoint(0, 0), size), mode, state);
return pix;
}
private:
QString fileName;
FontAwesome::icon fontAwesomeIcon;
QColor color;
QColor selectedColor;
static QString fontAwesomeFontName;
};
QString MonoIconEngine::fontAwesomeFontName;
QIcon MonoIcon::icon(const QString &fileName, const QColor &col, const QColor &sel)
{
return QIcon(new MonoIconEngine(fileName, (FontAwesome::icon)0, col, sel));
}
QIcon MonoIcon::icon(const FontAwesome::icon icon, const QColor &col, const QColor &sel)
{
return QIcon(new MonoIconEngine(QString(), icon, col, sel));
}

View File

@@ -1,25 +1,40 @@
/*
* Cantata
*
* Copyright (c) 2011-2016 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef MONO_ICON_H
#define MONO_ICON_H
#include <QIcon>
/**
* QtAwesome - use font-awesome (or other font icons) in your c++ / Qt Application
* This enum is taken from QtAwesome:
*
* MIT Licensed
*
* Copyright 2013-2015 - Reliable Bits Software by Blommers IT. All Rights Reserved.
* Author Rick Blommers
*/
#ifndef QTAWESOME_H
#define QTAWESOME_H
#include <QIcon>
#include <QIconEngine>
#include <QPainter>
#include <QRect>
#include <QVariantMap>
/// A list of all icon-names with the codepoint (unicode-value) on the right
/// You can use the names on the page http://fortawesome.github.io/Font-Awesome/design.html
namespace fa {
namespace FontAwesome {
enum icon {
adjust = 0xf042,
adn = 0xf170,
@@ -617,30 +632,10 @@ namespace fa {
};
}
//---------------------------------------------------------------------------------------
class QtAwesomeIconPainter;
class QtAwesome
namespace MonoIcon
{
QtAwesome();
virtual ~QtAwesome();
public:
static QtAwesome * self();
void setDefaultOption( const QString& name, const QVariant& value );
QVariant defaultOption( const QString& name );
QIcon icon( int character, const QVariantMap& options = QVariantMap() );
QFont font( int size );
private:
QString fontName_; ///< The font name used for this map
QVariantMap defaultOptions_; ///< The default icon options
QtAwesomeIconPainter* fontIconPainter_; ///< A special painter fo painting codepoints
QIcon icon(const QString &fileName, const QColor &col, const QColor &sel);
QIcon icon(const FontAwesome::icon icon, const QColor &col, const QColor &sel);
};
#endif // QTAWESOME_H
#endif // MonoIcon_H

View File

@@ -28,7 +28,7 @@
#include "support/globalstatic.h"
#include "support/utils.cpp"
#include "support/pathrequester.h"
#include "QtAwesome/QtAwesome.h"
#include "support/monoicon.h"
#include <QApplication>
#include <QPixmap>
#include <QFont>
@@ -286,99 +286,6 @@ static Icon createRecolourableIcon(const QString &name, const QColor &stdColor,
return icon;
}
static void updateMonoSvgIcon(Icon &i, const QString &type, const QString &name, const QColor &color, QIcon::Mode mode)
{
int darkValue=constDarkValue;
int lightValue=constLightValue;
if (isVeryDark(color)) {
QColor bgnd=QApplication::palette().color(QPalette::Active, QPalette::Background);
if (bgnd.value()<224) {
darkValue=48;
}
} else if (isVeryLight(color)) {
QColor bgnd=QApplication::palette().color(QPalette::Active, QPalette::Background);
if (bgnd.value()<224) {
lightValue=232;
}
}
if (darkValue==constDarkValue && isVeryDark(color)) {
i.addFile(":"+type+"-"+name+"-dark", QSize(), mode);
} else if (lightValue==constLightValue && isVeryLight(color)) {
i.addFile(":"+type+"-"+name+"-light", QSize(), mode);
} else { // Neither black nor white, so we need to recolour...
Icon std;
std.addFile(":"+type+"-"+name+"-dark", QSize(), mode);
// Now recolour the icon!
QColor col=clampColor(color, constDarkLimit, darkValue, constLightLimit, lightValue);
foreach (int s, constMonoSvgSizes) {
QImage img=std.pixmap(s, s, mode).toImage().convertToFormat(QImage::Format_ARGB32);
recolourPix(img, col);
i.addPixmap(QPixmap::fromImage(img), mode);
}
}
}
static Icon loadMonoSvgIcon(const QString &type, const QString &name, const QColor &normal, const QColor &selected)
{
Icon i;
updateMonoSvgIcon(i, type, name, normal, QIcon::Normal);
if (normal!=selected) {
updateMonoSvgIcon(i, type, name, selected, QIcon::Selected);
}
return i;
}
static Icon loadSidebarIcon(const QString &name, const QColor &normal, const QColor &selected)
{
return loadMonoSvgIcon(QLatin1String("sidebar"), name, normal, selected);
}
#ifndef ENABLE_UBUNTU
static void setDisabledOpacity(Icon &icon)
{
static const double constDisabledOpacity=0.5;
Icon copy;
for (int i=0; i<2; ++i) {
QIcon::State state=(QIcon::State)i;
for (int j=0; j<4; ++j) {
QIcon::Mode mode=(QIcon::Mode)j;
foreach (const int sz, constMonoSvgSizes) {
if (QIcon::Disabled==mode) {
QPixmap pix=icon.pixmap(QSize(sz, sz), QIcon::Normal, state);
if (!pix.isNull()) {
copy.addPixmap(QPixmap::fromImage(TreeView::setOpacity(pix.toImage(), constDisabledOpacity)), mode, state);
}
} else {
copy.addPixmap(icon.pixmap(QSize(sz, sz), mode, state), mode, state);
}
}
}
}
icon=copy;
}
static Icon loadMediaIcon(const QString &name, const QColor &normal, const QColor &selected)
{
Icon icon=loadMonoSvgIcon(QLatin1String("media"), name, normal, selected);
setDisabledOpacity(icon);
return icon;
}
#endif
static QIcon loadAwesomeIcon(int ch, const QColor &std, const QColor &highlight, double scale=1.0)
{
QVariantMap options;
options.insert("color", std);
options.insert("color-active", std);
options.insert("color-selected", highlight);
if (!Utils::equal(scale, 1.0)) {
options.insert("scale-factor", scale);
}
return QtAwesome::self()->icon(ch, options);
}
#if !defined ENABLE_KDE_SUPPORT || defined Q_OS_MAC || defined Q_OS_WIN
#define ALWAYS_USE_MONO_ICONS
#endif
@@ -416,62 +323,61 @@ Icons::Icons()
addRadioStreamIcon=Icon::create("addradio", constStdSizes);
albumIconSmall.addFile(":album32.svg");
albumIconLarge.addFile(":album.svg");
artistIcon.addFile(":artist.svg");
genreIcon.addFile(":genre.svg");
albumMonoIcon=MonoIcon::icon(":mono-album.svg", stdColor, stdColor);
artistIcon=MonoIcon::icon(":artist.svg", stdColor, stdColor);
genreIcon=MonoIcon::icon(":genre.svg", stdColor, stdColor);
#if !defined ENABLE_KDE_SUPPORT && !defined ENABLE_UBUNTU
appIcon=Icon("cantata");
#endif
lastFmIcon=loadAwesomeIcon(fa::lastfmsquare, red, red, 1.1);
albumMonoIcon=loadAwesomeIcon(fa::dotcircleo, stdColor, stdColor);
replacePlayQueueIcon=loadAwesomeIcon(fa::play, stdColor, stdColor);
appendToPlayQueueIcon=loadAwesomeIcon(fa::plus, stdColor, stdColor);
centrePlayQueueOnTrackIcon=loadAwesomeIcon(Qt::RightToLeft==QApplication::layoutDirection() ? fa::chevronleft : fa::chevronright, stdColor, stdColor);
savePlayQueueIcon=loadAwesomeIcon(fa::save, stdColor, stdColor);
clearListIcon=loadAwesomeIcon(fa::remove, red, red);
addNewItemIcon=loadAwesomeIcon(fa::plussquare, stdColor, stdColor);
editIcon=loadAwesomeIcon(fa::edit, stdColor, stdColor);
removeDynamicIcon=loadAwesomeIcon(fa::minussquare, stdColor, stdColor);
stopDynamicIcon=loadAwesomeIcon(fa::stop, red, red);
searchIcon=loadAwesomeIcon(fa::search, stdColor, stdColor);
addToFavouritesIcon=loadAwesomeIcon(fa::heart, red, red);
reloadIcon=loadAwesomeIcon(fa::repeat, stdColor, stdColor);
configureIcon=loadAwesomeIcon(fa::cogs, stdColor, stdColor);
connectIcon=loadAwesomeIcon(fa::chevrondown, stdColor, stdColor);
disconnectIcon=loadAwesomeIcon(fa::eject, stdColor, stdColor);
downloadIcon=loadAwesomeIcon(fa::download, stdColor, stdColor);
removeIcon=loadAwesomeIcon(fa::minus, red, red);
addIcon=loadAwesomeIcon(fa::plus, stdColor, stdColor);
addBookmarkIcon=loadAwesomeIcon(fa::bookmark, stdColor, stdColor);
audioListIcon=loadAwesomeIcon(fa::music, stdColor, stdColor);
playlistListIcon=loadAwesomeIcon(fa::list, stdColor, stdColor, 1.05);
dynamicListIcon=loadAwesomeIcon(fa::cube, stdColor, stdColor);
rssListIcon=loadAwesomeIcon(fa::rss, stdColor, stdColor);
savedRssListIcon=loadAwesomeIcon(fa::rsssquare, stdColor, stdColor);
clockIcon=loadAwesomeIcon(fa::clocko, stdColor, stdColor);
folderListIcon=loadAwesomeIcon(fa::foldero, stdColor, stdColor);
lastFmIcon=MonoIcon::icon(FontAwesome::lastfmsquare, red, red);
replacePlayQueueIcon=MonoIcon::icon(FontAwesome::play, stdColor, stdColor);
appendToPlayQueueIcon=MonoIcon::icon(FontAwesome::plus, stdColor, stdColor);
centrePlayQueueOnTrackIcon=MonoIcon::icon(Qt::RightToLeft==QApplication::layoutDirection() ? FontAwesome::chevronleft : FontAwesome::chevronright, stdColor, stdColor);
savePlayQueueIcon=MonoIcon::icon(FontAwesome::save, stdColor, stdColor);
clearListIcon=MonoIcon::icon(FontAwesome::remove, red, red);
addNewItemIcon=MonoIcon::icon(FontAwesome::plussquare, stdColor, stdColor);
editIcon=MonoIcon::icon(FontAwesome::edit, stdColor, stdColor);
removeDynamicIcon=MonoIcon::icon(FontAwesome::minussquare, stdColor, stdColor);
stopDynamicIcon=MonoIcon::icon(FontAwesome::stop, red, red);
searchIcon=MonoIcon::icon(FontAwesome::search, stdColor, stdColor);
addToFavouritesIcon=MonoIcon::icon(FontAwesome::heart, red, red);
reloadIcon=MonoIcon::icon(FontAwesome::repeat, stdColor, stdColor);
configureIcon=MonoIcon::icon(FontAwesome::cogs, stdColor, stdColor);
connectIcon=MonoIcon::icon(FontAwesome::chevrondown, stdColor, stdColor);
disconnectIcon=MonoIcon::icon(FontAwesome::eject, stdColor, stdColor);
downloadIcon=MonoIcon::icon(FontAwesome::download, stdColor, stdColor);
removeIcon=MonoIcon::icon(FontAwesome::minus, red, red);
addIcon=MonoIcon::icon(FontAwesome::plus, stdColor, stdColor);
addBookmarkIcon=MonoIcon::icon(FontAwesome::bookmark, stdColor, stdColor);
audioListIcon=MonoIcon::icon(FontAwesome::music, stdColor, stdColor);
playlistListIcon=MonoIcon::icon(FontAwesome::list, stdColor, stdColor);
dynamicListIcon=MonoIcon::icon(FontAwesome::cube, stdColor, stdColor);
rssListIcon=MonoIcon::icon(FontAwesome::rss, stdColor, stdColor);
savedRssListIcon=MonoIcon::icon(FontAwesome::rsssquare, stdColor, stdColor);
clockIcon=MonoIcon::icon(FontAwesome::clocko, stdColor, stdColor);
folderListIcon=MonoIcon::icon(FontAwesome::foldero, stdColor, stdColor);
streamListIcon=audioListIcon;
streamCategoryIcon=folderListIcon;
#ifdef ENABLE_HTTP_STREAM_PLAYBACK
httpStreamIcon=loadAwesomeIcon(fa::headphones, stdColor, stdColor);
httpStreamIcon=MonoIcon::icon(FontAwesome::headphones, stdColor, stdColor);
#endif
#ifndef Q_OS_MAC
Icon::setStd(Icon::Close, loadAwesomeIcon(fa::close, red, red));
Icon::setStd(Icon::Close, MonoIcon::icon(FontAwesome::close, red, red));
#endif
leftIcon=loadAwesomeIcon(fa::chevronleft, stdColor, stdColor);
rightIcon=loadAwesomeIcon(fa::chevronright, stdColor, stdColor);
upIcon=loadAwesomeIcon(fa::chevronup, stdColor, stdColor);
downIcon=loadAwesomeIcon(fa::chevrondown, stdColor, stdColor);
leftIcon=MonoIcon::icon(FontAwesome::chevronleft, stdColor, stdColor);
rightIcon=MonoIcon::icon(FontAwesome::chevronright, stdColor, stdColor);
upIcon=MonoIcon::icon(FontAwesome::chevronup, stdColor, stdColor);
downIcon=MonoIcon::icon(FontAwesome::chevrondown, stdColor, stdColor);
#ifndef ENABLE_KDE_SUPPORT
PathRequester::setIcon(folderListIcon);
#endif
cancelIcon=loadAwesomeIcon(fa::close, red, red);
cancelIcon=MonoIcon::icon(FontAwesome::close, red, red);
#if !defined ENABLE_KDE_SUPPORT && !defined Q_OS_WIN
if (QLatin1String("gnome")==QIcon::themeName()) {
QColor col=QApplication::palette().color(QPalette::Active, QPalette::WindowText);
contextIcon=loadSidebarIcon("info", col, col);
contextIcon=MonoIcon::icon(QLatin1String(":sidebar-info"), col, col);
} else
#endif
contextIcon=Icon(QStringList() << "dialog-information" << "information");
@@ -486,16 +392,16 @@ void Icons::initSidebarIcons()
QColor textCol=QApplication::palette().color(QPalette::Active, QPalette::WindowText);
QColor highlightedTexCol=QApplication::palette().color(QPalette::Active, QPalette::HighlightedText);
#endif
playqueueIcon=loadSidebarIcon(QLatin1String("playqueue"), textCol, highlightedTexCol);
libraryIcon=loadSidebarIcon(QLatin1String("library"), textCol, highlightedTexCol);
foldersIcon=loadSidebarIcon(QLatin1String("folders"), textCol, highlightedTexCol);
playlistsIcon=loadSidebarIcon(QLatin1String("playlists"), textCol, highlightedTexCol);
onlineIcon=loadSidebarIcon(QLatin1String("online"), textCol, highlightedTexCol);
infoSidebarIcon=loadSidebarIcon(QLatin1String("info"), textCol, highlightedTexCol);
playqueueIcon=MonoIcon::icon(QLatin1String(":sidebar-playqueue"), textCol, highlightedTexCol);
libraryIcon=MonoIcon::icon(QLatin1String(":sidebar-library"), textCol, highlightedTexCol);
foldersIcon=MonoIcon::icon(QLatin1String(":sidebar-folders"), textCol, highlightedTexCol);
playlistsIcon=MonoIcon::icon(QLatin1String(":sidebar-playlists"), textCol, highlightedTexCol);
onlineIcon=MonoIcon::icon(QLatin1String(":sidebar-online"), textCol, highlightedTexCol);
infoSidebarIcon=MonoIcon::icon(QLatin1String(":sidebar-info"), textCol, highlightedTexCol);
#ifdef ENABLE_DEVICES_SUPPORT
devicesIcon=loadSidebarIcon(QLatin1String("devices"), textCol, highlightedTexCol);
devicesIcon=MonoIcon::icon(QLatin1String(":sidebar-devices"), textCol, highlightedTexCol);
#endif
searchTabIcon=loadSidebarIcon(QLatin1String("search"), textCol, highlightedTexCol);
searchTabIcon=MonoIcon::icon(QLatin1String(":sidebar-search"), textCol, highlightedTexCol);
}
void Icons::initToolbarIcons(const QColor &toolbarText)
@@ -509,15 +415,15 @@ void Icons::initToolbarIcons(const QColor &toolbarText)
#else
QColor col=GtkStyle::isActive() ? GtkStyle::symbolicColor() : toolbarText;
#endif
toolbarPrevIcon=loadMediaIcon(QLatin1String(rtl ? "next" : "prev"), col, col);
toolbarPlayIcon=loadMediaIcon(QLatin1String(rtl ? "play-rtl" : "play"), col, col);
toolbarPauseIcon=loadMediaIcon(QLatin1String("pause"), col, col);
toolbarStopIcon=loadMediaIcon(QLatin1String("stop"), col, col);
toolbarNextIcon=loadMediaIcon(QLatin1String(rtl ? "prev" : "next"), col, col);
infoIcon=loadSidebarIcon("info", col, col);
toolbarPrevIcon=MonoIcon::icon(QLatin1String(rtl ? ":media-next" : ":media-prev"), col, col);
toolbarPlayIcon=MonoIcon::icon(QLatin1String(rtl ? ":media-play-rtl" : ":media-play"), col, col);
toolbarPauseIcon=MonoIcon::icon(QLatin1String(":media-pause"), col, col);
toolbarStopIcon=MonoIcon::icon(QLatin1String(":media-stop"), col, col);
toolbarNextIcon=MonoIcon::icon(QLatin1String(rtl ? ":media-prev" : ":media-next"), col, col);
infoIcon=MonoIcon::icon(QLatin1String(":sidebar-info"), col, col);
#ifdef USE_SYSTEM_MENU_ICON
toolbarMenuIcon=loadMonoSvgIcon(QLatin1String("menu"), QLatin1String("icon"), col, col);
menuIcon=loadMonoSvgIcon(QLatin1String("menu"), QLatin1String("icon"), stdColor, stdColor);
toolbarMenuIcon=MonoIcon::icon(QLatin1String(":menu-icon"), col, col);
menuIcon=MonoIcon::icon(QLatin1String(":menu-icon"), stdColor, stdColor);
#else
if (col==stdColor) {
toolbarMenuIcon=menuIcon;