mirror of
https://github.com/spalencsar/bearwave.git
synced 2026-07-06 22:24:17 +02:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user