-rw-r--r-- | core/settings/light-and-power/light.cpp | 17 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 22 | ||||
-rw-r--r-- | core/settings/light-and-power/settings.h | 1 |
3 files changed, 34 insertions, 6 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 8721a95..1a94209 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -142,3 +142,3 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) | |||
142 | connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); | 142 | connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); |
143 | connect(brightness_ac_3, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); | 143 | connect(brightness_ac_3, SIGNAL( valueChanged(int) ), this, SLOT( applyBrightnessAC() ) ); |
144 | } | 144 | } |
@@ -155,2 +155,3 @@ static void set_fl(int bright) | |||
155 | { | 155 | { |
156 | qDebug( QString("BRIGHT !! : %1").arg( bright ) ); | ||
156 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); | 157 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); |
@@ -241,8 +242,14 @@ void LightSettings::applyBrightness() | |||
241 | { | 242 | { |
243 | if ( !PowerStatus::Online ) { | ||
244 | int bright = ( brightness->value() ) * 255 / brightness->maxValue(); | ||
245 | set_fl(bright); | ||
246 | } | ||
247 | } | ||
248 | |||
249 | void LightSettings::applyBrightnessAC() | ||
250 | { | ||
251 | qDebug( QString("SLIDER : %1").arg( brightness_ac_3->value() ) ); | ||
242 | // if ac is attached, set directly that sliders setting, else the "on battery" sliders setting | 252 | // if ac is attached, set directly that sliders setting, else the "on battery" sliders setting |
243 | if ( PowerStatus::Online ) { | 253 | if ( PowerStatus::Online ) { |
244 | int bright = (brightness_ac_3->maxValue() - brightness_ac_3->value())*255 / brightness_ac_3->maxValue(); | 254 | int bright = ( brightness_ac_3->value() ) * 255 / brightness_ac_3->maxValue(); |
245 | set_fl(bright); | ||
246 | } else { | ||
247 | int bright = (brightness->maxValue()-brightness->value())*255 / brightness->maxValue(); | ||
248 | set_fl(bright); | 255 | set_fl(bright); |
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index fd85017..5e62626 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>419</width> | 14 | <width>415</width> |
15 | <height>532</height> | 15 | <height>532</height> |
@@ -310,2 +310,6 @@ | |||
310 | <property stdset="1"> | 310 | <property stdset="1"> |
311 | <name>tracking</name> | ||
312 | <bool>true</bool> | ||
313 | </property> | ||
314 | <property stdset="1"> | ||
311 | <name>orientation</name> | 315 | <name>orientation</name> |
@@ -725,2 +729,6 @@ | |||
725 | <property stdset="1"> | 729 | <property stdset="1"> |
730 | <name>minValue</name> | ||
731 | <number>0</number> | ||
732 | </property> | ||
733 | <property stdset="1"> | ||
726 | <name>maxValue</name> | 734 | <name>maxValue</name> |
@@ -737,2 +745,10 @@ | |||
737 | <property stdset="1"> | 745 | <property stdset="1"> |
746 | <name>value</name> | ||
747 | <number>255</number> | ||
748 | </property> | ||
749 | <property stdset="1"> | ||
750 | <name>tracking</name> | ||
751 | <bool>true</bool> | ||
752 | </property> | ||
753 | <property stdset="1"> | ||
738 | <name>orientation</name> | 754 | <name>orientation</name> |
@@ -1209,2 +1225,6 @@ warning at</string> | |||
1209 | <property stdset="1"> | 1225 | <property stdset="1"> |
1226 | <name>tracking</name> | ||
1227 | <bool>false</bool> | ||
1228 | </property> | ||
1229 | <property stdset="1"> | ||
1210 | <name>orientation</name> | 1230 | <name>orientation</name> |
diff --git a/core/settings/light-and-power/settings.h b/core/settings/light-and-power/settings.h index 77f90d6..adfd735 100644 --- a/core/settings/light-and-power/settings.h +++ b/core/settings/light-and-power/settings.h | |||
@@ -44,2 +44,3 @@ private slots: | |||
44 | void applyBrightness(); | 44 | void applyBrightness(); |
45 | void applyBrightnessAC(); | ||
45 | void slotSliderTicks( int steps ); | 46 | void slotSliderTicks( int steps ); |