bar/statusicons: allow disabling wifi icon when ethernet is active (#1107)

Signed-off-by: Dan Griffiths <dgriffiths@widgitlabs.com>
This commit is contained in:
Evertiro 2026-01-20 06:37:45 -06:00 committed by GitHub
parent 685ad569a3
commit d50f6080ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 6 deletions

View file

@ -96,6 +96,7 @@ JsonObject {
property bool showMicrophone: false property bool showMicrophone: false
property bool showKbLayout: false property bool showKbLayout: false
property bool showNetwork: true property bool showNetwork: true
property bool showWifi: true
property bool showBluetooth: true property bool showBluetooth: true
property bool showBattery: true property bool showBattery: true
property bool showLockStatus: true property bool showLockStatus: true

View file

@ -201,6 +201,7 @@ Singleton {
showMicrophone: bar.status.showMicrophone, showMicrophone: bar.status.showMicrophone,
showKbLayout: bar.status.showKbLayout, showKbLayout: bar.status.showKbLayout,
showNetwork: bar.status.showNetwork, showNetwork: bar.status.showNetwork,
showWifi: bar.status.showWifi,
showBluetooth: bar.status.showBluetooth, showBluetooth: bar.status.showBluetooth,
showBattery: bar.status.showBattery, showBattery: bar.status.showBattery,
showLockStatus: bar.status.showLockStatus showLockStatus: bar.status.showLockStatus

View file

@ -143,7 +143,7 @@ StyledRect {
// Network icon // Network icon
WrappedLoader { WrappedLoader {
name: "network" name: "network"
active: Config.bar.status.showNetwork active: Config.bar.status.showNetwork && (! Nmcli.activeEthernet || Config.bar.status.showWifi)
sourceComponent: MaterialIcon { sourceComponent: MaterialIcon {
animate: true animate: true

View file

@ -27,6 +27,7 @@ Item {
property bool showMicrophone: Config.bar.status.showMicrophone ?? true property bool showMicrophone: Config.bar.status.showMicrophone ?? true
property bool showKbLayout: Config.bar.status.showKbLayout ?? false property bool showKbLayout: Config.bar.status.showKbLayout ?? false
property bool showNetwork: Config.bar.status.showNetwork ?? true property bool showNetwork: Config.bar.status.showNetwork ?? true
property bool showWifi: Config.bar.status.showWifi ?? true
property bool showBluetooth: Config.bar.status.showBluetooth ?? true property bool showBluetooth: Config.bar.status.showBluetooth ?? true
property bool showBattery: Config.bar.status.showBattery ?? true property bool showBattery: Config.bar.status.showBattery ?? true
property bool showLockStatus: Config.bar.status.showLockStatus ?? true property bool showLockStatus: Config.bar.status.showLockStatus ?? true
@ -69,6 +70,7 @@ Item {
Config.bar.status.showMicrophone = root.showMicrophone; Config.bar.status.showMicrophone = root.showMicrophone;
Config.bar.status.showKbLayout = root.showKbLayout; Config.bar.status.showKbLayout = root.showKbLayout;
Config.bar.status.showNetwork = root.showNetwork; Config.bar.status.showNetwork = root.showNetwork;
Config.bar.status.showWifi = root.showWifi;
Config.bar.status.showBluetooth = root.showBluetooth; Config.bar.status.showBluetooth = root.showBluetooth;
Config.bar.status.showBattery = root.showBattery; Config.bar.status.showBattery = root.showBattery;
Config.bar.status.showLockStatus = root.showLockStatus; Config.bar.status.showLockStatus = root.showLockStatus;
@ -176,7 +178,7 @@ Item {
ConnectedButtonGroup { ConnectedButtonGroup {
rootItem: root rootItem: root
options: [ options: [
{ {
label: qsTr("Speakers"), label: qsTr("Speakers"),
@ -210,6 +212,14 @@ Item {
root.saveConfig(); root.saveConfig();
} }
}, },
{
label: qsTr("Wifi"),
propertyName: "showWifi",
onToggled: function(checked) {
root.showWifi = checked;
root.saveConfig();
}
},
{ {
label: qsTr("Bluetooth"), label: qsTr("Bluetooth"),
propertyName: "showBluetooth", propertyName: "showBluetooth",
@ -437,7 +447,7 @@ Item {
ConnectedButtonGroup { ConnectedButtonGroup {
rootItem: root rootItem: root
options: [ options: [
{ {
label: qsTr("Workspaces"), label: qsTr("Workspaces"),
@ -525,7 +535,7 @@ Item {
SliderInput { SliderInput {
Layout.fillWidth: true Layout.fillWidth: true
label: qsTr("Drag threshold") label: qsTr("Drag threshold")
value: root.dragThreshold value: root.dragThreshold
from: 0 from: 0
@ -534,7 +544,7 @@ Item {
validator: IntValidator { bottom: 0; top: 100 } validator: IntValidator { bottom: 0; top: 100 }
formatValueFunction: (val) => Math.round(val).toString() formatValueFunction: (val) => Math.round(val).toString()
parseValueFunction: (text) => parseInt(text) parseValueFunction: (text) => parseInt(text)
onValueModified: (newValue) => { onValueModified: (newValue) => {
root.dragThreshold = Math.round(newValue); root.dragThreshold = Math.round(newValue);
root.saveConfig(); root.saveConfig();
@ -598,7 +608,7 @@ Item {
ConnectedButtonGroup { ConnectedButtonGroup {
rootItem: root rootItem: root
options: [ options: [
{ {
label: qsTr("Background"), label: qsTr("Background"),