don't reset brightness at start

This commit is contained in:
Marco Martin 2019-02-07 12:58:08 +01:00
parent 56dc2ad23f
commit 86b6265690
2 changed files with 10 additions and 5 deletions

View file

@ -20,15 +20,19 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Layouts 1.1 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.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as Components import org.kde.plasma.components 2.0 as Components
RowLayout { RowLayout {
id: brightnessRoot
property alias icon: brightnessIcon.source property alias icon: brightnessIcon.source
property alias label: brightnessLabel.text property alias label: brightnessLabel.text
property alias value: brightnessSlider.value property alias value: brightnessSlider.value
property alias maximumValue: brightnessSlider.maximumValue property alias maximumValue: brightnessSlider.to
signal moved
spacing: units.gridUnit spacing: units.gridUnit
@ -51,13 +55,14 @@ RowLayout {
height: paintedHeight height: paintedHeight
} }
Components.Slider { Controls.Slider {
id: brightnessSlider id: brightnessSlider
width: parent.width width: parent.width
onMoved: brightnessRoot.moved()
// Don't allow the slider to turn off the screen // Don't allow the slider to turn off the screen
// Please see https://git.reviewboard.kde.org/r/122505/ for more information // Please see https://git.reviewboard.kde.org/r/122505/ for more information
minimumValue: maximumValue > 100 ? 1 : 0 from: to > 100 ? 1 : 0
stepSize: 1 //stepSize: 1
} }
} }
} }

View file

@ -127,7 +127,7 @@ Item {
}); });
} }
brightnessSlider.valueChanged.connect(function() { brightnessSlider.moved.connect(function() {
root.screenBrightness = brightnessSlider.value; root.screenBrightness = brightnessSlider.value;
}); });
disableBrightnessUpdate = false; disableBrightnessUpdate = false;