Added a 'Connected' indicator if one or more bluetooth devices are connected.
This commit is contained in:
@@ -10,13 +10,19 @@ const Bluetooth = () => {
|
||||
});
|
||||
|
||||
const btText = Widget.Label({
|
||||
label: Utils.merge([bluetooth.bind("enabled"), options.bar.bluetooth.label.bind("value")], (btEnabled, showLabel) => {
|
||||
if (showLabel) {
|
||||
return btEnabled ? " On" : " Off"
|
||||
}
|
||||
return "";
|
||||
label: Utils.merge([
|
||||
bluetooth.bind("enabled"),
|
||||
bluetooth.bind("connected_devices"),
|
||||
options.bar.bluetooth.label.bind("value")],
|
||||
(btEnabled, btDevices, showLabel) => {
|
||||
if (showLabel) {
|
||||
return btEnabled && btDevices.length ? ` Connected (${btDevices.length})`
|
||||
: btEnabled ? " On"
|
||||
: " Off"
|
||||
}
|
||||
return "";
|
||||
|
||||
}),
|
||||
}),
|
||||
class_name: "bar-bt_label",
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ const devices = (bluetooth: Bluetooth, self: Box<any, any>) => {
|
||||
hpack: "center",
|
||||
children: [
|
||||
Widget.Label({
|
||||
class_name: "dim",
|
||||
class_name: "bluetooth-disabled dim",
|
||||
hexpand: true,
|
||||
label: "Bluetooth is disabled",
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user