refactor(qml): extract header, search, and theme from Main.qml

Split the duplicated desktop/compact header UI into reusable QML
components (HeaderNavigation, SearchToolbar, QuickFilters), centralize
colors and world tags in BearTheme singleton, and move flag emoji logic
to FlagUtils.js. Register modules via qrc import path qrc:/qml.

Main.qml shrinks from ~1816 to ~1240 lines; behavior unchanged.
This commit is contained in:
Sebastian Palencsar
2026-06-20 14:10:51 +02:00
parent 1c736b97a6
commit 480bd483e8
10 changed files with 703 additions and 656 deletions

View File

@@ -49,6 +49,7 @@ int main(int argc, char *argv[])
}
QQmlApplicationEngine engine;
engine.addImportPath(QStringLiteral("qrc:/qml"));
RadioBackend backend;
engine.rootContext()->setContextProperty("radioBackend", &backend);
@@ -70,7 +71,7 @@ int main(int argc, char *argv[])
mprisPlayer->publishState();
}
const QUrl url(QStringLiteral("qrc:/Main.qml"));
const QUrl url(QStringLiteral("qrc:/qml/Main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [&app, url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl) {