summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/bar/components/StatusIcons.qml2
-rw-r--r--modules/bar/popouts/Bluetooth.qml2
-rw-r--r--modules/bar/popouts/Content.qml11
-rw-r--r--modules/bar/popouts/Network.qml33
4 files changed, 39 insertions, 9 deletions
diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml
index 80e8fe0..2f52596 100644
--- a/modules/bar/components/StatusIcons.qml
+++ b/modules/bar/components/StatusIcons.qml
@@ -154,7 +154,7 @@ StyledRect {
// Ethernet icon
WrappedLoader {
- name: "network"
+ name: "ethernet"
active: Config.bar.status.showNetwork && Nmcli.activeEthernet
sourceComponent: MaterialIcon {
diff --git a/modules/bar/popouts/Bluetooth.qml b/modules/bar/popouts/Bluetooth.qml
index c1f2029..1415f89 100644
--- a/modules/bar/popouts/Bluetooth.qml
+++ b/modules/bar/popouts/Bluetooth.qml
@@ -21,7 +21,7 @@ ColumnLayout {
StyledText {
Layout.topMargin: Appearance.padding.normal
Layout.rightMargin: Appearance.padding.small
- text: qsTr("Bluetooth %1").arg(BluetoothAdapterState.toString(Bluetooth.defaultAdapter?.state).toLowerCase())
+ text: qsTr("Bluetooth")
font.weight: 500
}
diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml
index e3f569d..661a41c 100644
--- a/modules/bar/popouts/Content.qml
+++ b/modules/bar/popouts/Content.qml
@@ -33,7 +33,16 @@ Item {
Popout {
name: "network"
- sourceComponent: Network {}
+ sourceComponent: Network {
+ view: "wireless"
+ }
+ }
+
+ Popout {
+ name: "ethernet"
+ sourceComponent: Network {
+ view: "ethernet"
+ }
}
Popout {
diff --git a/modules/bar/popouts/Network.qml b/modules/bar/popouts/Network.qml
index d185887..b807ce4 100644
--- a/modules/bar/popouts/Network.qml
+++ b/modules/bar/popouts/Network.qml
@@ -13,25 +13,33 @@ ColumnLayout {
id: root
property string connectingToSsid: ""
+ property string view: "wireless" // "wireless" or "ethernet"
spacing: Appearance.spacing.small
width: Config.bar.sizes.networkWidth
+ // Wireless section
StyledText {
- Layout.topMargin: Appearance.padding.normal
+ visible: root.view === "wireless"
+ Layout.preferredHeight: visible ? implicitHeight : 0
+ Layout.topMargin: visible ? Appearance.padding.normal : 0
Layout.rightMargin: Appearance.padding.small
- text: qsTr("Wifi %1").arg(Nmcli.wifiEnabled ? "enabled" : "disabled")
+ text: qsTr("Wireless")
font.weight: 500
}
Toggle {
+ visible: root.view === "wireless"
+ Layout.preferredHeight: visible ? implicitHeight : 0
label: qsTr("Enabled")
checked: Nmcli.wifiEnabled
toggle.onToggled: Nmcli.enableWifi(checked)
}
StyledText {
- Layout.topMargin: Appearance.spacing.small
+ visible: root.view === "wireless"
+ Layout.preferredHeight: visible ? implicitHeight : 0
+ Layout.topMargin: visible ? Appearance.spacing.small : 0
Layout.rightMargin: Appearance.padding.small
text: qsTr("%1 networks available").arg(Nmcli.networks.length)
color: Colours.palette.m3onSurfaceVariant
@@ -39,6 +47,7 @@ ColumnLayout {
}
Repeater {
+ visible: root.view === "wireless"
model: ScriptModel {
values: [...Nmcli.networks].sort((a, b) => {
if (a.active !== b.active)
@@ -54,6 +63,8 @@ ColumnLayout {
readonly property bool isConnecting: root.connectingToSsid === modelData.ssid
readonly property bool loading: networkItem.isConnecting
+ visible: root.view === "wireless"
+ Layout.preferredHeight: visible ? implicitHeight : 0
Layout.fillWidth: true
Layout.rightMargin: Appearance.padding.small
spacing: Appearance.spacing.small
@@ -142,7 +153,9 @@ ColumnLayout {
}
StyledRect {
- Layout.topMargin: Appearance.spacing.small
+ visible: root.view === "wireless"
+ Layout.preferredHeight: visible ? implicitHeight : 0
+ Layout.topMargin: visible ? Appearance.spacing.small : 0
Layout.fillWidth: true
implicitHeight: rescanBtn.implicitHeight + Appearance.padding.small * 2
@@ -192,15 +205,20 @@ ColumnLayout {
}
}
+ // Ethernet section
StyledText {
- Layout.topMargin: Appearance.spacing.normal
+ visible: root.view === "ethernet"
+ Layout.preferredHeight: visible ? implicitHeight : 0
+ Layout.topMargin: visible ? Appearance.padding.normal : 0
Layout.rightMargin: Appearance.padding.small
text: qsTr("Ethernet")
font.weight: 500
}
StyledText {
- Layout.topMargin: Appearance.spacing.small
+ visible: root.view === "ethernet"
+ Layout.preferredHeight: visible ? implicitHeight : 0
+ Layout.topMargin: visible ? Appearance.spacing.small : 0
Layout.rightMargin: Appearance.padding.small
text: qsTr("%1 devices available").arg(Nmcli.ethernetDevices.length)
color: Colours.palette.m3onSurfaceVariant
@@ -208,6 +226,7 @@ ColumnLayout {
}
Repeater {
+ visible: root.view === "ethernet"
model: ScriptModel {
values: [...Nmcli.ethernetDevices].sort((a, b) => {
if (a.connected !== b.connected)
@@ -222,6 +241,8 @@ ColumnLayout {
required property var modelData
readonly property bool loading: false
+ visible: root.view === "ethernet"
+ Layout.preferredHeight: visible ? implicitHeight : 0
Layout.fillWidth: true
Layout.rightMargin: Appearance.padding.small
spacing: Appearance.spacing.small