mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
don't reset brightness at start
This commit is contained in:
parent
56dc2ad23f
commit
86b6265690
2 changed files with 10 additions and 5 deletions
|
|
@ -20,15 +20,19 @@
|
|||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.2 as Controls
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as Components
|
||||
|
||||
RowLayout {
|
||||
id: brightnessRoot
|
||||
property alias icon: brightnessIcon.source
|
||||
property alias label: brightnessLabel.text
|
||||
property alias value: brightnessSlider.value
|
||||
property alias maximumValue: brightnessSlider.maximumValue
|
||||
property alias maximumValue: brightnessSlider.to
|
||||
|
||||
signal moved
|
||||
|
||||
spacing: units.gridUnit
|
||||
|
||||
|
|
@ -51,13 +55,14 @@ RowLayout {
|
|||
height: paintedHeight
|
||||
}
|
||||
|
||||
Components.Slider {
|
||||
Controls.Slider {
|
||||
id: brightnessSlider
|
||||
width: parent.width
|
||||
onMoved: brightnessRoot.moved()
|
||||
// Don't allow the slider to turn off the screen
|
||||
// Please see https://git.reviewboard.kde.org/r/122505/ for more information
|
||||
minimumValue: maximumValue > 100 ? 1 : 0
|
||||
stepSize: 1
|
||||
from: to > 100 ? 1 : 0
|
||||
//stepSize: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ Item {
|
|||
});
|
||||
}
|
||||
|
||||
brightnessSlider.valueChanged.connect(function() {
|
||||
brightnessSlider.moved.connect(function() {
|
||||
root.screenBrightness = brightnessSlider.value;
|
||||
});
|
||||
disableBrightnessUpdate = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue