summaryrefslogtreecommitdiff
path: root/core/applets/batteryapplet/batterystatus.cpp
Unidiff
Diffstat (limited to 'core/applets/batteryapplet/batterystatus.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/batteryapplet/batterystatus.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp
index 64e0499..86b20e8 100644
--- a/core/applets/batteryapplet/batterystatus.cpp
+++ b/core/applets/batteryapplet/batterystatus.cpp
@@ -21,2 +21,4 @@ BatteryStatus::BatteryStatus( const PowerStatus *p, QWidget *parent )
21 setCaption( tr("Battery status") ); 21 setCaption( tr("Battery status") );
22 setMinimumSize( 150, 200 );
23
22 QPushButton *pb = new QPushButton( tr("Close"), this ); 24 QPushButton *pb = new QPushButton( tr("Close"), this );
@@ -26,4 +28,3 @@ BatteryStatus::BatteryStatus( const PowerStatus *p, QWidget *parent )
26 28
27 pb->setMaximumHeight(40); 29 pb->setMaximumSize( 120, 40 );
28 pb->setMaximumWidth( 120 );
29 30
@@ -31,3 +32,3 @@ BatteryStatus::BatteryStatus( const PowerStatus *p, QWidget *parent )
31 32
32 layout->addStretch( 0 ); 33 layout->addStretch();
33 layout->addWidget( pb ); 34 layout->addWidget( pb );
@@ -81,5 +82,5 @@ bool BatteryStatus::getProcApmStatusIpaq() {
81 if (bat2 == true) { 82 if (bat2 == true) {
82 jackStatus = (*line).mid((*line).find('(')+1., (*line).find(')')-(*line).find('(')-1); 83 jackStatus = (*line).mid((*line).find('(')+1, (*line).find(')')-(*line).find('(')-1);
83 } else { 84 } else {
84 ipaqStatus = (*line).mid((*line).find('(')+1., (*line).find(')')-(*line).find('(')-1); 85 ipaqStatus = (*line).mid((*line).find('(')+1, (*line).find(')')-(*line).find('(')-1);
85 } 86 }
@@ -148,6 +149,2 @@ void BatteryStatus::paintEvent( QPaintEvent * ) {
148 149
149
150 int screenWidth = qApp->desktop()->width();
151 int screenHeight = qApp->desktop()->height();
152
153 QPainter p(this); 150 QPainter p(this);
@@ -215,5 +212,5 @@ void BatteryStatus::paintEvent( QPaintEvent * ) {
215 212
216 int rightEnd1 = screenWidth - 47; 213 int rightEnd1 = width() - 47;
217 int rightEnd2 = screenWidth - 35; 214 int rightEnd2 = width() - 35;
218 int percent2 = ( percent / 100.0 ) * rightEnd1 ; 215 int percent2 = ( percent / 100 ) * rightEnd1 ;
219 p.setPen( black ); 216 p.setPen( black );
@@ -242,3 +239,3 @@ void BatteryStatus::paintEvent( QPaintEvent * ) {
242 239
243 int jackPerc = ( jackPercent / 100.0 ) * ( screenWidth - 47 ) ; 240 int jackPerc = ( jackPercent / 100 ) * ( width() - 47 ) ;
244 241