diff --git a/libnymea-app/types/serialports.cpp b/libnymea-app/types/serialports.cpp index 2015a916..7696865f 100644 --- a/libnymea-app/types/serialports.cpp +++ b/libnymea-app/types/serialports.cpp @@ -99,6 +99,16 @@ void SerialPorts::clear() emit countChanged(); } +SerialPort *SerialPorts::find(const QString &systemLocation) const +{ + for (int i = 0; i < m_serialPorts.count(); i++) { + if (m_serialPorts.at(i)->systemLocation() == systemLocation) { + return m_serialPorts.at(i); + } + } + return nullptr; +} + SerialPort *SerialPorts::get(int index) const { if (index < 0 || index >= m_serialPorts.count()) { diff --git a/libnymea-app/types/serialports.h b/libnymea-app/types/serialports.h index 730fff43..a301faac 100644 --- a/libnymea-app/types/serialports.h +++ b/libnymea-app/types/serialports.h @@ -62,6 +62,7 @@ public: void clear(); + Q_INVOKABLE SerialPort *find(const QString &systemLocation) const; Q_INVOKABLE virtual SerialPort *get(int index) const; signals: diff --git a/nymea-app/ui/components/NymeaItemDelegate.qml b/nymea-app/ui/components/NymeaItemDelegate.qml index 0a63f523..cbda9481 100644 --- a/nymea-app/ui/components/NymeaItemDelegate.qml +++ b/nymea-app/ui/components/NymeaItemDelegate.qml @@ -90,7 +90,7 @@ ItemDelegate { contentItem: RowLayout { id: innerLayout - spacing: app.margins + spacing: Style.margins Item { Layout.preferredHeight: root.iconSize Layout.preferredWidth: height @@ -140,7 +140,7 @@ ItemDelegate { Layout.fillWidth: true Layout.fillHeight: true text: root.subText - font.pixelSize: root.prominentSubText ? app.smallFont : app.extraSmallFont + font.pixelSize: root.prominentSubText ? Style.smallFont : app.extraSmallFont color: root.prominentSubText ? Material.foreground : Material.color(Material.Grey) wrapMode: root.wrapTexts ? Text.WordWrap : Text.NoWrap maximumLineCount: root.wrapTexts ? 2 : 1 @@ -159,7 +159,7 @@ ItemDelegate { id: secondaryIconMouseArea enabled: false anchors.fill: parent - anchors.margins: -app.margins + anchors.margins: -Style.margins onClicked: root.secondaryIconClicked(); } }