author | sandman <sandman> | 2002-10-28 04:43:12 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-28 04:43:12 (UTC) |
commit | f3c9e44d9d694a0a803fb6a7d79cfa8d173b9864 (patch) (unidiff) | |
tree | 311e3d30ef5d8fe4713c6ea3cbf0af6abdb8cd57 /core/settings/light-and-power | |
parent | 226ddd19ef0adeb279c3a864e24cbfcf556b2f17 (diff) | |
download | opie-f3c9e44d9d694a0a803fb6a7d79cfa8d173b9864.zip opie-f3c9e44d9d694a0a803fb6a7d79cfa8d173b9864.tar.gz opie-f3c9e44d9d694a0a803fb6a7d79cfa8d173b9864.tar.bz2 |
The brightness sliders do not need a reversed logik anymore, since they are
horizontal now
Diffstat (limited to 'core/settings/light-and-power') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/light-and-power/light.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index aa36e06..572f8ea 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -60,2 +60,3 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
60 | { | 60 | { |
61 | int res = ODevice::inst ( )-> displayBrightnessResolution ( ); | ||
61 | 62 | ||
@@ -83,9 +84,9 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
83 | LcdOffOnly->setChecked( config.readBoolEntry("LcdOffOnly",false)); | 84 | LcdOffOnly->setChecked( config.readBoolEntry("LcdOffOnly",false)); |
84 | int maxbright = ODevice::inst ( )-> displayBrightnessResolution ( ); | 85 | |
85 | initbright = config.readNumEntry("Brightness",255); | 86 | initbright = config. readNumEntry ( "Brightness", 255 ); |
86 | brightness->setMaxValue( maxbright ); | 87 | brightness-> setMaxValue ( res - 1 ); |
87 | brightness->setTickInterval( QMAX(1,maxbright/16) ); | 88 | brightness-> setTickInterval ( QMAX( 1, res / 16 )); |
88 | brightness->setLineStep( QMAX(1,maxbright/16) ); | 89 | brightness-> setLineStep ( QMAX( 1, res / 16 )); |
89 | brightness->setPageStep( QMAX(1,maxbright/16) ); | 90 | brightness-> setPageStep ( QMAX( 1, res / 16 )); |
90 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); | 91 | brightness-> setValue (( initbright * ( res - 1 ) + 127 ) / 255 ); |
91 | 92 | ||
@@ -94,4 +95,2 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
94 | 95 | ||
95 | |||
96 | |||
97 | config.setGroup( "AC" ); | 96 | config.setGroup( "AC" ); |
@@ -104,9 +103,9 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
104 | LcdOffOnly_2_3->setChecked( config.readBoolEntry("LcdOffOnly",false)); | 103 | LcdOffOnly_2_3->setChecked( config.readBoolEntry("LcdOffOnly",false)); |
105 | int maxbright_ac = ODevice::inst ( )-> displayBrightnessResolution ( ); | 104 | |
106 | initbright_ac = config.readNumEntry("Brightness",255); | 105 | initbright_ac = config. readNumEntry ( "Brightness", 255 ); |
107 | brightness_ac_3->setMaxValue( maxbright_ac ); | 106 | brightness_ac_3-> setMaxValue ( res - 1 ); |
108 | brightness_ac_3->setTickInterval( QMAX(1,maxbright_ac/16) ); | 107 | brightness_ac_3-> setTickInterval ( QMAX( 1, res / 16 )); |
109 | brightness_ac_3->setLineStep( QMAX(1,maxbright_ac/16) ); | 108 | brightness_ac_3-> setLineStep ( QMAX( 1, res / 16 )); |
110 | brightness_ac_3->setPageStep( QMAX(1,maxbright_ac/16) ); | 109 | brightness_ac_3-> setPageStep ( QMAX( 1, res / 16 )); |
111 | brightness_ac_3->setValue( (maxbright_ac*255 - initbright_ac*maxbright_ac)/255 ); | 110 | brightness_ac_3-> setValue (( initbright_ac * ( res - 1 ) + 127 ) / 255 ); |
112 | 111 | ||
@@ -140,3 +139,2 @@ static void set_fl(int bright) | |||
140 | { | 139 | { |
141 | qDebug ( QString( "Brightness" ).arg( bright ) ); | ||
142 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); | 140 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); |
@@ -194,5 +192,5 @@ void LightSettings::accept() | |||
194 | config.setGroup( "Battery" ); | 192 | config.setGroup( "Battery" ); |
195 | config.writeEntry( "LightSensor", (int)auto_brightness->isChecked() ); | 193 | config.writeEntry( "LightSensor", auto_brightness->isChecked() ); |
196 | config.setGroup( "AC" ); | 194 | config.setGroup( "AC" ); |
197 | config.writeEntry( "LightSensor", (int)auto_brightness_ac_3->isChecked() ); | 195 | config.writeEntry( "LightSensor", auto_brightness_ac_3->isChecked() ); |
198 | //config.writeEntry( "Steps", LightStepSpin->value() ); | 196 | //config.writeEntry( "Steps", LightStepSpin->value() ); |