File 2000-brightness-applet.patch of Package powerdevil6
diff --git a/applets/brightness/package/contents/ui/NightLightItem.qml b/applets/brightness/package/contents/ui/NightLightItem.qml
index 317234e71287829a16c696cdfcdd70393f0a2fc0..b4c7d71d44d25c5e7a3af18fb9eb2407fc948264 100644
--- a/applets/brightness/package/contents/ui/NightLightItem.qml
+++ b/applets/brightness/package/contents/ui/NightLightItem.qml
@@ -21,6 +21,8 @@ import org.kde.plasma.private.brightnesscontrolplugin
PlasmaComponents3.ItemDelegate {
id: root
+ readonly property bool hasHeader: Plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentDrawsPlasmoidHeading
+
background.visible: highlighted
highlighted: activeFocus
hoverEnabled: false
@@ -48,7 +50,7 @@ PlasmaComponents3.ItemDelegate {
}
}
- KeyNavigation.tab: inhibitionSwitch.visible ? inhibitionSwitch : kcmButton
+ KeyNavigation.tab: inhibitionSwitch.visible ? inhibitionSwitch : inhibitionSwitch.KeyNavigation.tab
ColumnLayout {
Layout.fillWidth: true
@@ -111,8 +113,21 @@ PlasmaComponents3.ItemDelegate {
}
}
+ PlasmaComponents3.ProgressBar {
+ id: currentTemperatureBar
+
+ Layout.fillWidth: true
+ Layout.topMargin: Kirigami.Units.smallSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing
+ from: 1000
+ to: 6500
+ value: control.currentTemperature
+ }
+
RowLayout {
+ Layout.bottomMargin: Kirigami.Units.smallSpacing
spacing: Kirigami.Units.smallSpacing
+ visible: !root.hasHeader
PlasmaComponents3.Switch {
id: inhibitionSwitch
@@ -121,14 +136,10 @@ PlasmaComponents3.ItemDelegate {
checked: control.inhibited
text: i18nc("@action:button Night Light", "Suspend")
- Layout.fillWidth: true
-
Accessible.onPressAction: toggled()
KeyNavigation.up: root.KeyNavigation.up
- KeyNavigation.tab: kcmButton
- KeyNavigation.right: kcmButton
- KeyNavigation.backtab: root
+ KeyNavigation.backtab: KeyNavigation.up
Keys.onPressed: (event) => {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Return || event.key == Qt.Key_Enter) {
@@ -138,25 +149,8 @@ PlasmaComponents3.ItemDelegate {
onToggled: control.toggleInhibition()
}
- PlasmaComponents3.Button {
- id: kcmButton
- visible: KConfig.KAuthorized.authorizeControlModule("kcm_nightlight")
-
- icon.name: "configure"
- text: control.enabled ? i18n("Configure…") : i18n("Enable and Configure…")
-
- Layout.alignment: Qt.AlignRight
-
- KeyNavigation.up: root.KeyNavigation.up
- KeyNavigation.backtab: inhibitionSwitch.visible ? inhibitionSwitch : root
- KeyNavigation.left: inhibitionSwitch
-
- Keys.onPressed: (event) => {
- if (event.key == Qt.Key_Space || event.key == Qt.Key_Return || event.key == Qt.Key_Enter) {
- clicked();
- }
- }
- onClicked: KCMLauncher.openSystemSettings("kcm_nightlight")
+ Item {
+ Layout.fillWidth: true
}
}
diff --git a/applets/brightness/package/contents/ui/main.qml b/applets/brightness/package/contents/ui/main.qml
index 80309374611f755a66f8e0a919b5e6b5544619dc..ba8b93020ce96ac2c7bc6c18905b2d1522232052 100644
--- a/applets/brightness/package/contents/ui/main.qml
+++ b/applets/brightness/package/contents/ui/main.qml
@@ -231,13 +231,29 @@ PlasmoidItem {
Plasmoid.contextualActions: [
PlasmaCore.Action {
- id: configureNightLight
- icon.name: "configure"
- text: i18nc("@action:inmenu", "Configure Night Light…")
- visible: KAuthorized.authorize("kcm_nightlight")
- priority: PlasmaCore.Action.LowPriority
- onTriggered: KCMLauncher.openSystemSettings("kcm_nightlight")
+ id: toggleNightLight
+ icon.name: "redshift-status-off"
+ priority: PlasmaCore.Action.HighPriority
+ text: i18nc("@action:inmenu", "Suspend Night Light")
+ visible: nightLightControl.enabled
+ checkable: true
+ checked: nightLightControl.inhibited && nightLightControl.inhibitedFromApplet
+ onTriggered: {
+ nightLightControl.toggleInhibition();
+ }
}
]
+ PlasmaCore.Action {
+ id: configureNightLight
+ icon.name: "configure"
+ text: i18nc("@action:inmenu", "Configure Night Light…")
+ visible: KAuthorized.authorizeControlModule("kcm_nightlight")
+ priority: PlasmaCore.Action.LowPriority
+ onTriggered: KCMLauncher.openSystemSettings("kcm_nightlight")
+ }
+
+ Component.onCompleted: {
+ Plasmoid.setInternalAction("configure", configureNightLight);
+ }
}