Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
IconThemeResolver.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <PhosphorServices/phosphorservices_export.h>
7
8#include <QHash>
9#include <QImage>
10#include <QObject>
11#include <QString>
12#include <QStringList>
13
14#include <memory>
15
16namespace PhosphorServices {
17
28class PHOSPHORSERVICES_EXPORT IconThemeResolver : public QObject
29{
30 Q_OBJECT
31 Q_DISABLE_COPY_MOVE(IconThemeResolver)
32public:
35
38 void setThemeName(const QString& themeName);
39 [[nodiscard]] QString themeName() const;
40
47 [[nodiscard]] QImage iconForName(const QString& name, int size, int scale = 1,
48 const QString& extraThemeDir = {}) const;
49
53 [[nodiscard]] static QImage decodePixmaps(const QList<QPair<QSize, QByteArray>>& pixmaps, int size);
54
55Q_SIGNALS:
57
58private:
59 explicit IconThemeResolver(QObject* parent = nullptr);
60 ~IconThemeResolver() override;
61
62 class Private;
63 std::unique_ptr<Private> d;
64};
65
66} // namespace PhosphorServices
XDG Icon Theme Specification 0.13 resolver.
Definition IconThemeResolver.h:29
QImage iconForName(const QString &name, int size, int scale=1, const QString &extraThemeDir={}) const
Look up an icon by name.
void setThemeName(const QString &themeName)
Force a theme override.
static IconThemeResolver * instance()
Process-wide singleton. Created lazily on first call.
static QImage decodePixmaps(const QList< QPair< QSize, QByteArray > > &pixmaps, int size)
Bypass theme lookup and decode a raw IconPixmap byte stream straight off the wire (ARGB32 in network ...
Definition DBusMenuModel.h:15