From e86931545352387e7a8c5929dee2e9934d042800 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 13 Jul 2025 21:51:30 +0800 Subject: finish style bar(almost) --- components/SimpleResource.qml | 53 +++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 14 deletions(-) (limited to 'components') diff --git a/components/SimpleResource.qml b/components/SimpleResource.qml index 2d8a91f..6dc2bba 100644 --- a/components/SimpleResource.qml +++ b/components/SimpleResource.qml @@ -4,24 +4,49 @@ import QtQuick.Layouts import qs.config as Config import qs.components -RowLayout { +Item { id: root + required property string text required property string icon - Item { - Layout.fillWidth: true - } - anchors.fill: parent - spacing: Config.Bar.resourceIconTextSpacing - Icons { - text: root.icon - } - Text { - text: root.text - } + implicitWidth: container.implicitWidth + implicitHeight: container.implicitHeight + + Rectangle { + id: container + anchors { + fill: parent + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + implicitWidth: layout.implicitWidth + Config.General.rectMargin * 2 + implicitHeight: Config.Bar.height - Config.General.rectMargin + + color: Config.Colors.alt + radius: Config.Style.rounding.large + + RowLayout { + id: layout + + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + + spacing: Config.Bar.resourceIconTextSpacing + + Icons { + text: root.icon + } + Text { + text: root.text + } - Item { - Layout.fillWidth: true + Item { + Layout.fillWidth: true + Layout.fillHeight: true + } + } } } -- cgit v1.2.3