diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 21:51:30 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-13 21:51:30 +0800 |
| commit | e86931545352387e7a8c5929dee2e9934d042800 (patch) | |
| tree | 52935af186e3592241bc9096e093e9d34bb0c365 /bar/Network.qml | |
| parent | 8e31e45ffa1b0029c91556ca29337eb7162dfd1d (diff) | |
finish style bar(almost)
Diffstat (limited to 'bar/Network.qml')
| -rw-r--r-- | bar/Network.qml | 72 |
1 files changed, 52 insertions, 20 deletions
diff --git a/bar/Network.qml b/bar/Network.qml index 3559df0..14e8851 100644 --- a/bar/Network.qml +++ b/bar/Network.qml @@ -6,29 +6,61 @@ import qs.components import qs.config as Config Item { - id: root - RowLayout { - Item { - Layout.fillWidth: true - } - anchors.fill: parent - spacing: Config.Bar.resourceIconTextSpacing + implicitWidth: container.implicitWidth + implicitHeight: container.implicitHeight - Config.General.rectMargin - Icons { - text: Services.Network.state - } - Text { - text: Math.round(Services.Resource.cpuUsage * 100) - } - Text { - text: Services.NetworkUsage.up + " " + Services.NetworkUsage.upUnit + Rectangle { + id: container + anchors { + fill: parent + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter } - Text { - text: Services.NetworkUsage.down + " " + Services.NetworkUsage.downUnit - } - Item { - Layout.fillWidth: true + + implicitWidth: layout.implicitWidth + Config.General.rectMargin * 2 + implicitHeight: Config.Bar.height + color: Config.Colors.alt + radius: Config.Style.rounding.large + + RowLayout { + id: layout + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + spacing: Config.Bar.resourceIconTextSpacing + + Item { + Layout.fillWidth: true + } + + Icons { + text: Services.Network.state + } + + RowLayout { + spacing: Config.Bar.resourceIconTextSpacing / 2 + Text { + text: Config.Icons.resource.network.download + } + Text { + text: Services.NetworkUsage.down + Services.NetworkUsage.downUnit + } + } + RowLayout { + spacing: Config.Bar.resourceIconTextSpacing / 2 + Text { + text: Config.Icons.resource.network.upload + } + Text { + text: Services.NetworkUsage.up + Services.NetworkUsage.upUnit + } + } + + Item { + Layout.fillWidth: true + } } } } |
