Adwaita-derived (GNOME Project, LGPL-3-or-CC-BY-SA), recoloured per light/dark skin and laid out in IDM's toolbar positions per docs/03-gui-spec.md §1. Licence and per-file provenance recorded in gui/resources/icons/LICENSE. New IconTheme mirrors ThemeManager's colorSchemeChanged hook so a live light/dark switch swaps every action's glyph, not just the QSS. Toolbar/menu actions, the tray icon and the window icon all now use it instead of the SP_ArrowDown placeholder. Install-path notes for PKG filed as R5 in gui/docs/pkg-qa-requests-m1.md. Also rebases lane/gui onto main (13 commits, no gui/ conflicts). Verified: full build clean, all 13 gui ctest targets pass (including gui_no_download_logic), unhappy-path DoD gate PASS against mockd (--drop-connection). Co-Authored-By: Claude Sonnet 5 <[email protected]>
28 lines
769 B
C++
28 lines
769 B
C++
#include "util/IconTheme.hpp"
|
|
|
|
#include <QGuiApplication>
|
|
#include <QStyleHints>
|
|
|
|
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
|