summaryrefslogtreecommitdiff
path: root/noncore/applets/brightnessapplet/brightnessapplet.cpp
Unidiff
Diffstat (limited to 'noncore/applets/brightnessapplet/brightnessapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/brightnessapplet/brightnessapplet.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/noncore/applets/brightnessapplet/brightnessapplet.cpp b/noncore/applets/brightnessapplet/brightnessapplet.cpp
index 1ade35e..5aaa27e 100644
--- a/noncore/applets/brightnessapplet/brightnessapplet.cpp
+++ b/noncore/applets/brightnessapplet/brightnessapplet.cpp
@@ -140,4 +140,11 @@ BrightnessAppletControl::~BrightnessAppletControl()
140 140
141 141
142void BrightnessAppletControl::hideEvent( QHideEvent* e )
143{
144 BrightnessApplet* applet = static_cast<BrightnessApplet*>( parent() );
145 applet->writeSystemBrightness( applet->calcBrightnessValue() );
146 QFrame::hideEvent( e );
147}
148
142BrightnessApplet::BrightnessApplet( QWidget *parent, const char *name ) 149BrightnessApplet::BrightnessApplet( QWidget *parent, const char *name )
143 :OTaskbarApplet( parent, name ) 150 :OTaskbarApplet( parent, name )
@@ -161,4 +168,6 @@ void BrightnessApplet::writeSystemBrightness(int brightness)
161 } 168 }
162 cfg.writeEntry("Brightness", brightness); 169 cfg.writeEntry("Brightness", brightness);
170 odebug << "writing brightness " << brightness << oendl;
171 cfg.write();
163} 172}
164 173
@@ -174,4 +183,6 @@ int BrightnessApplet::readSystemBrightness(void)
174 cfg.setGroup("Battery"); 183 cfg.setGroup("Battery");
175 } 184 }
185
186 odebug << "reading brightness " << cfg.readNumEntry("Brightness", 128) << oendl;
176 187
177 return cfg.readNumEntry("Brightness", 128); 188 return cfg.readNumEntry("Brightness", 128);
@@ -224,9 +235,4 @@ void BrightnessApplet::mousePressEvent( QMouseEvent* )
224 connect(_control->slider, SIGNAL(valueChanged(int)), this, SLOT(sliderMoved(int))); 235 connect(_control->slider, SIGNAL(valueChanged(int)), this, SLOT(sliderMoved(int)));
225 } 236 }
226 else
227 {
228 _control->hide();
229 writeSystemBrightness( calcBrightnessValue() );
230 }
231} 237}
232 238