summaryrefslogtreecommitdiff
path: root/modules/bar
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bar')
-rw-r--r--modules/bar/Content.qml6
-rw-r--r--modules/bar/components/StatusIcons.qml2
-rw-r--r--modules/bar/popouts/Content.qml5
-rw-r--r--modules/bar/popouts/Network.qml22
4 files changed, 35 insertions, 0 deletions
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
@@ -27,6 +27,11 @@ Item {
}
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)
+ }
+}