-rw-r--r-- | noncore/applets/brightnessapplet/brightnessapplet.cpp | 16 | ||||
-rw-r--r-- | noncore/applets/brightnessapplet/brightnessapplet.h | 2 | ||||
-rw-r--r-- | noncore/applets/brightnessapplet/brightnessapplet.pro | 2 |
3 files changed, 13 insertions, 7 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 | |||
@@ -141,2 +141,9 @@ BrightnessAppletControl::~BrightnessAppletControl() | |||
141 | 141 | ||
142 | void BrightnessAppletControl::hideEvent( QHideEvent* e ) | ||
143 | { | ||
144 | BrightnessApplet* applet = static_cast<BrightnessApplet*>( parent() ); | ||
145 | applet->writeSystemBrightness( applet->calcBrightnessValue() ); | ||
146 | QFrame::hideEvent( e ); | ||
147 | } | ||
148 | |||
142 | BrightnessApplet::BrightnessApplet( QWidget *parent, const char *name ) | 149 | BrightnessApplet::BrightnessApplet( QWidget *parent, const char *name ) |
@@ -162,2 +169,4 @@ void BrightnessApplet::writeSystemBrightness(int brightness) | |||
162 | cfg.writeEntry("Brightness", brightness); | 169 | cfg.writeEntry("Brightness", brightness); |
170 | odebug << "writing brightness " << brightness << oendl; | ||
171 | cfg.write(); | ||
163 | } | 172 | } |
@@ -176,2 +185,4 @@ int BrightnessApplet::readSystemBrightness(void) | |||
176 | 185 | ||
186 | odebug << "reading brightness " << cfg.readNumEntry("Brightness", 128) << oendl; | ||
187 | |||
177 | return cfg.readNumEntry("Brightness", 128); | 188 | return cfg.readNumEntry("Brightness", 128); |
@@ -225,7 +236,2 @@ void BrightnessApplet::mousePressEvent( QMouseEvent* ) | |||
225 | } | 236 | } |
226 | else | ||
227 | { | ||
228 | _control->hide(); | ||
229 | writeSystemBrightness( calcBrightnessValue() ); | ||
230 | } | ||
231 | } | 237 | } |
diff --git a/noncore/applets/brightnessapplet/brightnessapplet.h b/noncore/applets/brightnessapplet/brightnessapplet.h index 8b88bd1..6d6d369 100644 --- a/noncore/applets/brightnessapplet/brightnessapplet.h +++ b/noncore/applets/brightnessapplet/brightnessapplet.h | |||
@@ -49,3 +49,3 @@ class BrightnessAppletControl : public QFrame | |||
49 | ~BrightnessAppletControl(); | 49 | ~BrightnessAppletControl(); |
50 | 50 | virtual void hideEvent( QHideEvent* ); | |
51 | QSlider* slider; | 51 | QSlider* slider; |
diff --git a/noncore/applets/brightnessapplet/brightnessapplet.pro b/noncore/applets/brightnessapplet/brightnessapplet.pro index 5044f38..8c65120 100644 --- a/noncore/applets/brightnessapplet/brightnessapplet.pro +++ b/noncore/applets/brightnessapplet/brightnessapplet.pro | |||
@@ -9,3 +9,3 @@ DEPENDPATH += $(OPIEDIR)/include | |||
9 | LIBS += -lqpe -lopiecore2 -lopieui2 | 9 | LIBS += -lqpe -lopiecore2 -lopieui2 |
10 | VERSION = 0.1.0 | 10 | VERSION = 0.1.1 |
11 | 11 | ||