summaryrefslogtreecommitdiff
path: root/core/applets/batteryapplet/battery.cpp
Side-by-side diff
Diffstat (limited to 'core/applets/batteryapplet/battery.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 4adcab4..3b64fb5 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -55,49 +55,49 @@ BatteryMeter::~BatteryMeter()
QSize BatteryMeter::sizeHint() const
{
return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() );
}
void BatteryMeter::mousePressEvent( QMouseEvent* e )
{
if ( e->button() == RightButton )
{
style = 1-style;
Config c( "qpe" );
c.setGroup( "Battery" );
c.writeEntry( "Style", style );
repaint( true );
}
QWidget::mousePressEvent( e );
}
void BatteryMeter::mouseReleaseEvent( QMouseEvent* e)
{
if ( batteryView && batteryView->isVisible() ) {
delete (QWidget *) batteryView;
} else {
if ( !batteryView ) batteryView = new BatteryStatus( ps );
- batteryView->showMaximized();
+ QPEApplication::showWidget( batteryView );
batteryView->raise();
batteryView->show();
}
}
void BatteryMeter::timerEvent( QTimerEvent * )
{
PowerStatus prev = *ps;
*ps = PowerStatusManager::readStatus();
if ( prev != *ps ) {
percent = ps->batteryPercentRemaining();
if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) {
percent = 0;
charging = true;
chargeTimer->start( 500 );
} else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) {
charging = false;
chargeTimer->stop();
if ( batteryView )
batteryView->updatePercent( percent );
}
repaint( style != 0 );