From 017b1b4ce017600953f35a528660cca1f67dc86a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 5 Jun 2025 21:47:30 +1000 Subject: feat: network popout Also qstr dashboard performance pane labels --- modules/bar/Content.qml | 6 ++++++ modules/bar/components/StatusIcons.qml | 2 ++ modules/bar/popouts/Content.qml | 5 +++++ modules/bar/popouts/Network.qml | 22 ++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 modules/bar/popouts/Network.qml (limited to 'modules/bar') diff --git a/modules/bar/Content.qml b/modules/bar/Content.qml index 1032050..2531f4d 100644 --- a/modules/bar/Content.qml +++ b/modules/bar/Content.qml @@ -14,12 +14,18 @@ StyledRect { function checkPopout(y: real): var { const aw = activeWindow.child; const awy = activeWindow.y + aw.y; + const n = statusIconsInner.network; + const ny = statusIcons.y + statusIconsInner.y + n.y; const b = statusIconsInner.battery; const by = statusIcons.y + statusIconsInner.y + b.y; if (y >= awy && y <= awy + aw.implicitHeight) { Popouts.currentName = "activewindow"; Popouts.currentCenter = Qt.binding(() => activeWindow.y + aw.y + aw.implicitHeight / 2); Popouts.hasCurrent = true; + } else if (y >= ny && y <= ny + n.implicitHeight) { + Popouts.currentName = "network"; + Popouts.currentCenter = Qt.binding(() => statusIcons.y + statusIconsInner.y + n.y + n.implicitHeight / 2); + Popouts.hasCurrent = true; } else if (y >= by && y <= by + b.implicitHeight) { Popouts.currentName = "battery"; Popouts.currentCenter = Qt.binding(() => statusIcons.y + statusIconsInner.y + b.y + b.implicitHeight / 2); diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml index d2dbe2f..d4dba6c 100644 --- a/modules/bar/components/StatusIcons.qml +++ b/modules/bar/components/StatusIcons.qml @@ -10,6 +10,8 @@ Item { id: root property color colour: Colours.palette.m3secondary + + readonly property Item network: network readonly property Item battery: battery clip: true diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 6b65f56..43f2c8e 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -26,6 +26,11 @@ Item { source: "ActiveWindow.qml" } + Popout { + name: "network" + source: "Network.qml" + } + Popout { name: "battery" source: "Battery.qml" diff --git a/modules/bar/popouts/Network.qml b/modules/bar/popouts/Network.qml new file mode 100644 index 0000000..7a79ef1 --- /dev/null +++ b/modules/bar/popouts/Network.qml @@ -0,0 +1,22 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import QtQuick + +Column { + id: root + + spacing: Appearance.spacing.normal + + StyledText { + text: qsTr("Connected to: %1").arg(Network.active?.ssid ?? "None") + } + + StyledText { + text: qsTr("Strength: %1/100").arg(Network.active?.strength ?? 0) + } + + StyledText { + text: qsTr("Frequency: %1 MHz").arg(Network.active?.frequency ?? 0) + } +} -- cgit v1.2.3-freya