mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 14:08:29 -04:00
control center: fix brightness icon not showing up if no pinned devices
fixes #2488
This commit is contained in:
@@ -175,7 +175,7 @@ BasePill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getBrightnessIconName() {
|
function getBrightnessIconName() {
|
||||||
const deviceName = getPinnedBrightnessDevice();
|
const deviceName = getEffectiveBrightnessDevice();
|
||||||
if (!deviceName)
|
if (!deviceName)
|
||||||
return "brightness_medium";
|
return "brightness_medium";
|
||||||
const level = DisplayService.getDeviceBrightness(deviceName);
|
const level = DisplayService.getDeviceBrightness(deviceName);
|
||||||
@@ -207,8 +207,8 @@ BasePill {
|
|||||||
return pins[pinKey] || "";
|
return pins[pinKey] || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasPinnedBrightnessDevice() {
|
function getEffectiveBrightnessDevice() {
|
||||||
return getPinnedBrightnessDevice().length > 0;
|
return getPinnedBrightnessDevice() || DisplayService.getDefaultDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleVolumeWheel(delta) {
|
function handleVolumeWheel(delta) {
|
||||||
@@ -258,7 +258,7 @@ BasePill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleBrightnessWheel(delta) {
|
function handleBrightnessWheel(delta) {
|
||||||
const deviceName = getPinnedBrightnessDevice();
|
const deviceName = getEffectiveBrightnessDevice();
|
||||||
if (!deviceName) {
|
if (!deviceName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -281,7 +281,7 @@ BasePill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getBrightness() {
|
function getBrightness() {
|
||||||
const deviceName = getPinnedBrightnessDevice();
|
const deviceName = getEffectiveBrightnessDevice();
|
||||||
if (!deviceName) {
|
if (!deviceName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -350,7 +350,7 @@ BasePill {
|
|||||||
case "microphone":
|
case "microphone":
|
||||||
return root.showMicIcon;
|
return root.showMicIcon;
|
||||||
case "brightness":
|
case "brightness":
|
||||||
return root.showBrightnessIcon && DisplayService.brightnessAvailable && root.hasPinnedBrightnessDevice();
|
return root.showBrightnessIcon && DisplayService.brightnessAvailable && root.getEffectiveBrightnessDevice().length > 0;
|
||||||
case "battery":
|
case "battery":
|
||||||
return root.showBatteryIcon && BatteryService.batteryAvailable;
|
return root.showBatteryIcon && BatteryService.batteryAvailable;
|
||||||
case "printer":
|
case "printer":
|
||||||
|
|||||||
Reference in New Issue
Block a user