From a7d430e309cbc89eff468fd34bd02f78b79543be Mon Sep 17 00:00:00 2001 From: Noelia Date: Wed, 25 Oct 2023 12:38:56 +0200 Subject: [PATCH] feat(ShapeRectangle): Added icon Added icon --- ui/imports/shared/controls/ShapeRectangle.qml | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/ui/imports/shared/controls/ShapeRectangle.qml b/ui/imports/shared/controls/ShapeRectangle.qml index 9f75923afe..618c21a1a6 100644 --- a/ui/imports/shared/controls/ShapeRectangle.qml +++ b/ui/imports/shared/controls/ShapeRectangle.qml @@ -1,5 +1,6 @@ import QtQuick 2.15 import QtQuick.Shapes 1.15 +import QtQuick.Layouts 1.15 import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 @@ -29,6 +30,7 @@ import utils 1.0 Shape { id: root + property string icon property string text property color textColor: Theme.palette.baseColor1 property alias font: description.font @@ -46,13 +48,27 @@ Shape { implicitWidth: 448 implicitHeight: 44 - StatusBaseText { - id: description + RowLayout { + spacing: 4 anchors.centerIn: parent - color: root.textColor - text: root.text - font.pixelSize: 13 - visible: (!!text) + + StatusIcon { + id: icon + + visible: root.icon + color: root.textColor + icon: root.icon + width: 16 + height: width + } + + StatusBaseText { + id: description + color: root.textColor + text: root.text + font.pixelSize: 13 + visible: !!text + } } ShapePath {