#include "util/IconTheme.hpp" #include #include namespace velox::gui { IconTheme::IconTheme(QObject *parent) : QObject(parent) { connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, &IconTheme::onColorSchemeChanged); } QIcon IconTheme::icon(const QString &name) { const bool dark = QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark; return QIcon(QStringLiteral(":/icons/%1/%2.svg") .arg(dark ? QStringLiteral("dark") : QStringLiteral("light"), name)); } QIcon IconTheme::appIcon() { return QIcon(QStringLiteral(":/icons/app/velox.svg")); } void IconTheme::onColorSchemeChanged() { emit iconsChanged(); } } // namespace velox::gui