Allow the toolbar color to be the same as the theme background and small fixes

This commit is contained in:
Stefano Moretti
2023-05-27 11:07:43 +02:00
parent 051e97c636
commit 287d439eec
8 changed files with 64 additions and 17 deletions

View File

@ -11,7 +11,7 @@ namespace BaseUI
void init(QQmlEngine *engine)
{
QQuickStyle::setStyle("Material");
Icons::instance = std::make_unique<Icons>();
Icons::instance = new Icons(static_cast<QObject *>(engine));
#ifdef BASEUI_INCLUDE_ICONS
QString path = ":/baseui/imports/BaseUI/icons/";
BaseUI::Icons::registerIcons(engine, path + "MaterialIcons-Regular.ttf",

View File

@ -4,8 +4,6 @@
#include <QQmlEngine>
#include <QQmlPropertyMap>
#include <memory>
namespace BaseUI
{
@ -16,7 +14,7 @@ class Icons : public QQmlPropertyMap
public:
Icons(QObject *parent = nullptr);
inline static std::unique_ptr<Icons> instance;
inline static Icons *instance;
static void registerIcons(QQmlEngine *engine, const QString &fontPath,
const QString &fontName, const QVariantMap &codes);
@ -52,7 +50,7 @@ public:
else
s_engine = engine;
return Icons::instance.get();
return Icons::instance;
}
private: