mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 07:03:08 +00:00
quicksettings: Fix brightness slider
Status: - Tested on my OP6 with PostmarketOS edge. (Pmbootstrap build + sideload) Fix issue https://invent.kde.org/teams/plasma-mobile/issues/-/issues/306
This commit is contained in:
parent
eef3a2822a
commit
a6a16507c3
2 changed files with 29 additions and 15 deletions
|
|
@ -12,16 +12,16 @@ import org.kde.kirigami 2.20 as Kirigami
|
|||
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.plasma.components 3.0 as PC3
|
||||
import org.kde.plasma.private.brightnesscontrolplugin as BC
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
implicitHeight: brightnessRow.implicitHeight
|
||||
|
||||
BC.ScreenBrightnessControl {
|
||||
id: screenBrightnessControl
|
||||
}
|
||||
property alias value: brightnessSlider.value
|
||||
property alias maximumValue: brightnessSlider.to
|
||||
|
||||
signal moved()
|
||||
|
||||
RowLayout {
|
||||
id: brightnessRow
|
||||
|
|
@ -44,12 +44,8 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
from: 1
|
||||
to: screenBrightnessControl.brightnessMax
|
||||
value: screenBrightnessControl.brightness
|
||||
|
||||
onMoved: {
|
||||
screenBrightnessControl.brightness = value;
|
||||
}
|
||||
onMoved: root.moved()
|
||||
}
|
||||
|
||||
Kirigami.Icon {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
|||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.plasma.private.brightnesscontrolplugin as BC
|
||||
|
||||
/**
|
||||
* Quick settings elements layout, change the height to clip.
|
||||
|
|
@ -106,12 +107,29 @@ Item {
|
|||
sourceComponent: root.mode === QuickSettings.Pages ? swipeViewComponent : scrollViewComponent
|
||||
}
|
||||
|
||||
BrightnessItem {
|
||||
id: brightnessItem
|
||||
Layout.bottomMargin: Kirigami.Units.smallSpacing * 2
|
||||
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||
Layout.fillWidth: true
|
||||
BC.ScreenBrightnessControl {
|
||||
id: screenBrightnessControl
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: brightnessRepeater
|
||||
model: screenBrightnessControl.displays
|
||||
|
||||
BrightnessItem {
|
||||
required property string displayName
|
||||
required property int brightness
|
||||
required property int maxBrightness
|
||||
|
||||
Layout.bottomMargin: Kirigami.Units.smallSpacing * 2
|
||||
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||
Layout.fillWidth: true
|
||||
|
||||
value: brightness
|
||||
maximumValue: maxBrightness
|
||||
|
||||
onMoved: screenBrightnessControl.setBrightness(displayName, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue