From 24b096ed7b5f820a368a527d1af12260c4d8eb17 Mon Sep 17 00:00:00 2001 From: andreidanila1 Date: Fri, 13 Dec 2024 15:16:03 +0200 Subject: [PATCH] core/deviceimpl: Create NO_PLUGIN icon using DeviceIconBuilder. Signed-off-by: andreidanila1 --- core/src/deviceimpl.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/src/deviceimpl.cpp b/core/src/deviceimpl.cpp index 356e098934..91ae688654 100644 --- a/core/src/deviceimpl.cpp +++ b/core/src/deviceimpl.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ Q_LOGGING_CATEGORY(CAT_DEVICEIMPL, "Device") namespace scopy { + DeviceImpl::DeviceImpl(QString param, PluginManager *p, QString category, QObject *parent) : QObject{parent} , m_param(param) @@ -157,17 +159,22 @@ void DeviceImpl::loadName() void DeviceImpl::loadIcons() { m_icon = new QWidget(); + QHBoxLayout *lay = new QHBoxLayout(m_icon); m_icon->setFixedHeight(100); m_icon->setFixedWidth(100); - new QHBoxLayout(m_icon); for(auto &p : m_plugins) { if(p->loadIcon()) { - m_icon->layout()->addWidget(p->icon()); + lay->addWidget(p->icon()); return; } } - new QLabel("No PLUGIN", m_icon); + QLabel *header = new QLabel("No Plugin"); + Style::setStyle(header, style::properties::label::deviceIcon, true); + + QWidget *noPluginIcon = + DeviceIconBuilder().shape(DeviceIconBuilder::SQUARE).color("gray").headerWidget(header).build(); + lay->addWidget(noPluginIcon); } void DeviceImpl::loadPages()