-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 18e368e..98b61b5 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp | |||
@@ -62,49 +62,49 @@ QSize BatteryMeter::sizeHint() const | |||
62 | return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() ); | 62 | return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() ); |
63 | } | 63 | } |
64 | 64 | ||
65 | void BatteryMeter::mousePressEvent( QMouseEvent* e ) | 65 | void BatteryMeter::mousePressEvent( QMouseEvent* e ) |
66 | { | 66 | { |
67 | if ( e->button() == RightButton ) | 67 | if ( e->button() == RightButton ) |
68 | { | 68 | { |
69 | style = 1-style; | 69 | style = 1-style; |
70 | Config c( "qpe" ); | 70 | Config c( "qpe" ); |
71 | c.setGroup( "Battery" ); | 71 | c.setGroup( "Battery" ); |
72 | c.writeEntry( "Style", style ); | 72 | c.writeEntry( "Style", style ); |
73 | repaint( true ); | 73 | repaint( true ); |
74 | } | 74 | } |
75 | QWidget::mousePressEvent( e ); | 75 | QWidget::mousePressEvent( e ); |
76 | } | 76 | } |
77 | 77 | ||
78 | void BatteryMeter::mouseReleaseEvent( QMouseEvent* /*e*/ ) | 78 | void BatteryMeter::mouseReleaseEvent( QMouseEvent* /*e*/ ) |
79 | { | 79 | { |
80 | if ( batteryView && batteryView->isVisible() ) { | 80 | if ( batteryView && batteryView->isVisible() ) { |
81 | delete (QWidget *) batteryView; | 81 | delete (QWidget *) batteryView; |
82 | } else { | 82 | } else { |
83 | if ( !batteryView ) batteryView = new BatteryStatus( ps ); | 83 | if ( !batteryView ) batteryView = new BatteryStatus( ps ); |
84 | QPEApplication::showWidget( batteryView ); | 84 | QPEApplication::showWidget( batteryView ); |
85 | batteryView->raise(); | 85 | batteryView->raise(); |
86 | batteryView->show(); | 86 | batteryView->showMaximized(); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void BatteryMeter::timerEvent( QTimerEvent * ) | 90 | void BatteryMeter::timerEvent( QTimerEvent * ) |
91 | { | 91 | { |
92 | PowerStatus prev = *ps; | 92 | PowerStatus prev = *ps; |
93 | 93 | ||
94 | *ps = PowerStatusManager::readStatus(); | 94 | *ps = PowerStatusManager::readStatus(); |
95 | 95 | ||
96 | if ( prev != *ps ) { | 96 | if ( prev != *ps ) { |
97 | percent = ps->batteryPercentRemaining(); | 97 | percent = ps->batteryPercentRemaining(); |
98 | if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) { | 98 | if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) { |
99 | percent = 0; | 99 | percent = 0; |
100 | charging = true; | 100 | charging = true; |
101 | chargeTimer->start( 500 ); | 101 | chargeTimer->start( 500 ); |
102 | } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) { | 102 | } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) { |
103 | charging = false; | 103 | charging = false; |
104 | chargeTimer->stop(); | 104 | chargeTimer->stop(); |
105 | if ( batteryView ) | 105 | if ( batteryView ) |
106 | batteryView->updatePercent( percent ); | 106 | batteryView->updatePercent( percent ); |
107 | } | 107 | } |
108 | repaint( style != 0 ); | 108 | repaint( style != 0 ); |
109 | if ( batteryView ) | 109 | if ( batteryView ) |
110 | batteryView->repaint(); | 110 | batteryView->repaint(); |