mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 04:09:15 -04:00
Add DoNotDisturb & IdleInhibitor Indicators for the ControlCenterButton widget + Add optional icon to KeyboardLayoutName widget (#2513)
* feat(ControlCenterButton): add IdleInhibitor icon * feat(ControlCenterButton): add DoNotDisturb icon * fix(WidgetTabSection): adjust text width for the SystemTray Widget popup * feat(KeyboardLayoutName): add optional icon * refactor(KeyboardLayoutName): simplify icon visibility logic by using root.showIcon ---------
This commit is contained in:
@@ -26,6 +26,8 @@ BasePill {
|
||||
property bool showBatteryIcon: widgetData?.showBatteryIcon !== undefined ? widgetData.showBatteryIcon : SettingsData.controlCenterShowBatteryIcon
|
||||
property bool showPrinterIcon: widgetData?.showPrinterIcon !== undefined ? widgetData.showPrinterIcon : SettingsData.controlCenterShowPrinterIcon
|
||||
property bool showScreenSharingIcon: widgetData?.showScreenSharingIcon !== undefined ? widgetData.showScreenSharingIcon : SettingsData.controlCenterShowScreenSharingIcon
|
||||
property bool showIdleInhibitorIcon: widgetData?.showIdleInhibitorIcon !== undefined ? widgetData.showIdleInhibitorIcon : SettingsData.controlCenterShowIdleInhibitorIcon
|
||||
property bool showDoNotDisturbIcon: widgetData?.showDoNotDisturbIcon !== undefined ? widgetData.showDoNotDisturbIcon : SettingsData.controlCenterShowDoNotDisturbIcon
|
||||
property real touchpadThreshold: 100
|
||||
property real micAccumulator: 0
|
||||
property real volumeAccumulator: 0
|
||||
@@ -40,7 +42,7 @@ BasePill {
|
||||
property var _vBrightness: null
|
||||
property var _vMic: null
|
||||
property var _interactionDelegates: []
|
||||
readonly property var defaultControlCenterGroupOrder: ["network", "vpn", "bluetooth", "audio", "microphone", "brightness", "battery", "printer", "screenSharing"]
|
||||
readonly property var defaultControlCenterGroupOrder: ["network", "vpn", "bluetooth", "audio", "microphone", "brightness", "battery", "printer", "screenSharing", "idleInhibitor", "doNotDisturb"]
|
||||
readonly property var effectiveControlCenterGroupOrder: getEffectiveControlCenterGroupOrder()
|
||||
readonly property var controlCenterRenderModel: getControlCenterRenderModel()
|
||||
|
||||
@@ -353,6 +355,10 @@ BasePill {
|
||||
return root.showBatteryIcon && BatteryService.batteryAvailable;
|
||||
case "printer":
|
||||
return root.showPrinterIcon && CupsService.cupsAvailable && root.hasPrintJobs();
|
||||
case "idleInhibitor":
|
||||
return root.showIdleInhibitorIcon && SessionService.idleInhibited;
|
||||
case "doNotDisturb":
|
||||
return root.showDoNotDisturbIcon && SessionData.doNotDisturb;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -512,6 +518,10 @@ BasePill {
|
||||
return Theme.getBatteryIcon(BatteryService.batteryLevel, BatteryService.isCharging, BatteryService.batteryAvailable);
|
||||
case "printer":
|
||||
return "print";
|
||||
case "idleInhibitor":
|
||||
return "motion_sensor_active";
|
||||
case "doNotDisturb":
|
||||
return "do_not_disturb_on";
|
||||
default:
|
||||
return "settings";
|
||||
}
|
||||
@@ -531,6 +541,10 @@ BasePill {
|
||||
return root.getBatteryIconColor();
|
||||
case "printer":
|
||||
return Theme.primary;
|
||||
case "idleInhibitor":
|
||||
return Theme.primary;
|
||||
case "doNotDisturb":
|
||||
return Theme.primary;
|
||||
default:
|
||||
return Theme.widgetIconColor;
|
||||
}
|
||||
@@ -689,6 +703,10 @@ BasePill {
|
||||
return Theme.getBatteryIcon(BatteryService.batteryLevel, BatteryService.isCharging, BatteryService.batteryAvailable);
|
||||
case "printer":
|
||||
return "print";
|
||||
case "idleInhibitor":
|
||||
return "motion_sensor_active";
|
||||
case "doNotDisturb":
|
||||
return "do_not_disturb_on";
|
||||
default:
|
||||
return "settings";
|
||||
}
|
||||
@@ -708,6 +726,10 @@ BasePill {
|
||||
return root.getBatteryIconColor();
|
||||
case "printer":
|
||||
return Theme.primary;
|
||||
case "idleInhibitor":
|
||||
return Theme.primary;
|
||||
case "doNotDisturb":
|
||||
return Theme.primary;
|
||||
default:
|
||||
return Theme.widgetIconColor;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ BasePill {
|
||||
|
||||
property var widgetData: null
|
||||
property bool compactMode: widgetData?.keyboardLayoutNameCompactMode !== undefined ? widgetData.keyboardLayoutNameCompactMode : SettingsData.keyboardLayoutNameCompactMode
|
||||
property bool showIcon: widgetData?.keyboardLayoutNameShowIcon !== undefined ? widgetData.keyboardLayoutNameShowIcon : SettingsData.keyboardLayoutNameShowIcon
|
||||
readonly property var langCodes: ({
|
||||
"afrikaans": "af",
|
||||
"albanian": "sq",
|
||||
@@ -134,6 +135,7 @@ BasePill {
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: root.showIcon
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -156,6 +158,14 @@ BasePill {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankIcon {
|
||||
name: "keyboard"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showIcon
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
if (!root.currentLayout)
|
||||
|
||||
Reference in New Issue
Block a user