--- a/src/hbcore/gui/hbsettingswindow_p.cpp Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbcore/gui/hbsettingswindow_p.cpp Mon Oct 04 00:38:12 2010 +0300
@@ -103,7 +103,6 @@
mGeneralSettingsForSensorsComboBox = new QComboBox(this); //krazy:exclude=qclasses
mUnsetOrientationButton = new QPushButton(tr("&Unset orientation"), this); //krazy:exclude=qclasses
- mLights = true;
HbIcon icon("qtg_mono_light");
mLightsButton = new QPushButton(icon.pixmap(), "", this); //krazy:exclude=qclasses
mAnimationButton = new QPushButton(tr("&Animation on"), this); //krazy:exclude=qclasses
@@ -376,21 +375,25 @@
void HbSettingsWindow::toggleLights()
{
- HbIcon icon("qtg_mono_light");
+ HbIcon icon;
+ if (mLights) {
+ mLights = false;
+ icon.setIconName("qtg_mono_light_off");
+ } else {
+ mLights = true;
+ icon.setIconName("qtg_mono_light");
+ }
+ mLightsButton->setIcon(icon.pixmap());
+
QList<HbMainWindow *> mainWindowList = hbInstance->allMainWindows();
for (int i = 0; i < mainWindowList.count(); ++i) {
if (mLights) {
- icon.setIconName("qtg_mono_light_off");
- mainWindowList[i]->broadcastEvent(HbEvent::SleepModeEnter);
- mLights = false;
- mainWindowList[i]->setForegroundBrush(QBrush(Qt::black, Qt::Dense1Pattern));
+ mainWindowList[i]->broadcastEvent(HbEvent::SleepModeExit);
+ mainWindowList[i]->setForegroundBrush(Qt::NoBrush);
} else {
- icon.setIconName("qtg_mono_light");
- mainWindowList[i]->broadcastEvent(HbEvent::SleepModeExit);
- mLights = true;
- mainWindowList[i]->setForegroundBrush(Qt::NoBrush);
+ mainWindowList[i]->broadcastEvent(HbEvent::SleepModeEnter);
+ mainWindowList[i]->setForegroundBrush(QBrush(Qt::black, Qt::Dense1Pattern));
}
- mLightsButton->setIcon(icon.pixmap());
}
}