[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kde-workspace] plasma/generic/applets/batterymonitor/contents: Only update brightness if fullview i
From: David Edmundson <kde () davidedmundson ! co ! uk>
Date: 2014-02-06 16:16:19
Message-ID: E1WBRch-0000Jj-Pk () scm ! kde ! org
[Download RAW message or body]
Git commit 9fb499d9adf26434c200748a93ce0bc7cc3027ed by David Edmundson.
Committed on 06/02/2014 at 16:15.
Pushed by davidedmundson into branch 'master'.
Only update brightness if fullview is available.
Logic.js no longer can access the fullRepresentation, so we
pass the instance as an arg.
M +1 -1 plasma/generic/applets/batterymonitor/contents/code/logic.js
M +9 -5 plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
http://commits.kde.org/kde-workspace/9fb499d9adf26434c200748a93ce0bc7cc3027ed
diff --git a/plasma/generic/applets/batterymonitor/contents/code/logic.js \
b/plasma/generic/applets/batterymonitor/contents/code/logic.js index a48500c..5e1d0ec \
100755
--- a/plasma/generic/applets/batterymonitor/contents/code/logic.js
+++ b/plasma/generic/applets/batterymonitor/contents/code/logic.js
@@ -194,7 +194,7 @@ function updateTooltip() {
batteries.tooltipImage = image;
}
-function updateBrightness(source) {
+function updateBrightness(dialogItem, source) {
// we don't want passive brightness change send setBrightness call
if (!source.data["PowerDevil"]) {
return;
diff --git a/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml \
b/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml index \
bc6054d..b9cd99e 100755
--- a/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
+++ b/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
@@ -44,7 +44,7 @@ Item {
show_remaining_time = plasmoid.readConfig("showRemainingTime");
}
- function updateLogic(updateBrightness) {
+ function updateLogic() {
Logic.updateCumulative();
plasmoid.status = Logic.plasmoidStatus();
@@ -54,9 +54,6 @@ Item {
print(plasmoid.status);
Logic.updateTooltip();
- if (updateBrightness) {
- Logic.updateBrightness(pmSource);
- }
}
Plasmoid.compactRepresentation: CompactRepresentation { }
@@ -66,7 +63,7 @@ Item {
engine: "powermanagement"
connectedSources: sources
onDataChanged: {
- updateLogic(true);
+ updateLogic();
}
onSourceAdded: {
if (source == "Battery0") {
@@ -130,6 +127,13 @@ Item {
dialogItem.forceActiveFocus();
}
+ Connections {
+ target: pmSource
+ onDataChanged : {
+ Logic.updateBrightness(dialogItem, pmSource);
+ }
+ }
+
onBrightnessChanged: {
if (disableBrightnessUpdate) {
return;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic