Remoto - VFS
|
Icons for general use. More...
#include <VFS_icons.h>
Static Public Member Functions | |
static char * | get (QString which="") |
Fetch an icon from the library. More... | |
Static Private Member Functions | |
static void | initialize () |
Initialize the icon library. More... | |
Static Private Attributes | |
static QMap< QString, char * > | _icons |
The icon library map. More... | |
static bool | _initialized = false |
The initialization state of the icon library. More... | |
static QMutex | _initializeMutex |
An initialize locker... needed because icons may be requested by multiple threads before initialization has completed. More... | |
Icons for general use.
Icons are returned as either inline SVG or base64-encoded strings with a mime prefix suitable for use in a web browser. This string can be directly placed in the 'src' field of an image tag or css field.
There are many websites that offer pre-built svg icons, for instance: https://www.flaticon.com
When icons are downloaded, it's best to optimize and minimize the icon using a tool like svgo, which can be found here: https://github.com/svg/svgo .
All of the icons in the standard VFS_icons library are raw inline SVG, not base64-encoded.
Definition at line 7 of file VFS_icons.h.
|
static |
Fetch an icon from the library.
which | An icon's name, as a string. Defaults to an empty string, which will return a default document icon. |
If a name is unknown, a default icon will be returned.
Definition at line 34 of file VFS_icons.cpp.
|
staticprivate |
Initialize the icon library.
This method uses a blocking mutex to ensure thread safety.
To view the default list, please browse the source code.
white
or the longer syntax rgb(1.0,1.0,1.0)
. Definition at line 60 of file VFS_icons.cpp.
|
staticprivate |
The icon library map.
Definition at line 15 of file VFS_icons.h.
|
staticprivate |
The initialization state of the icon library.
Definition at line 13 of file VFS_icons.h.
|
staticprivate |
An initialize locker... needed because icons may be requested by multiple threads before initialization has completed.
Definition at line 14 of file VFS_icons.h.