SILICON
Toggle main menu visibility
Loading...
Searching...
No Matches
icons.hpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2025. Giulio Cocconi
3
4
This program is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include <memory>
21
22
#include <QByteArray>
23
#include <QColor>
24
#include <QIcon>
25
26
class
QSvgRenderer;
27
28
namespace
SILICON::ui
{
29
30
namespace
svg
{
31
// GUI thread only. Shared ownership keeps renderers alive across cache eviction.
32
// Resolve data-silicon-fill/stroke annotations; invalid XML/tokens return empty.
33
QByteArray
preprocess
(
const
QByteArray& source);
34
std::shared_ptr<QSvgRenderer>
renderer
(
const
QString& path);
35
}
// namespace svg
36
37
// Rasterize lazily for the current theme and device scale. The application logo
38
// retains its source colors; other icons default to Ink unless explicitly colored.
39
class
Icon
:
public
QIcon {
40
public
:
41
explicit
Icon
(
const
QString& commonName);
42
explicit
Icon
(
const
QString& commonName,
const
QColor& color);
43
};
44
45
}
// namespace SILICON::ui
SILICON::ui::Icon::Icon
Icon(const QString &commonName)
Definition
icons.cpp:289
SILICON::ui::svg
Definition
icons.hpp:30
SILICON::ui::svg::renderer
std::shared_ptr< QSvgRenderer > renderer(const QString &path)
Definition
icons.cpp:261
SILICON::ui::svg::preprocess
QByteArray preprocess(const QByteArray &source)
Definition
icons.cpp:230
SILICON::ui
Definition
actionGroups.hpp:14
src
ui
shell
icons.hpp
Generated by
1.17.0