summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-04-25 18:03:55 (UTC)
committer harlekin <harlekin>2004-04-25 18:03:55 (UTC)
commit22d51bcaa58b90a3ffd4d429c43e6c24e1694ab3 (patch) (unidiff)
treea4027f012a4bfe2596a35fadf0ed6409ac3278f4
parent37b6ddee96e789bcc3b4fdd2828889efa3adabc4 (diff)
downloadopie-22d51bcaa58b90a3ffd4d429c43e6c24e1694ab3.zip
opie-22d51bcaa58b90a3ffd4d429c43e6c24e1694ab3.tar.gz
opie-22d51bcaa58b90a3ffd4d429c43e6c24e1694ab3.tar.bz2
show applet fullscreen
Diffstat (more/less context) (ignore 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 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
65void BatteryMeter::mousePressEvent( QMouseEvent* e ) 65void 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
78void BatteryMeter::mouseReleaseEvent( QMouseEvent* /*e*/ ) 78void 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
90void BatteryMeter::timerEvent( QTimerEvent * ) 90void 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();