-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 078ce8d..480d261 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp | |||
@@ -117,18 +117,28 @@ void BatteryMeter::chargeTimeout() | |||
117 | void BatteryMeter::paintEvent( QPaintEvent* ) | 117 | void BatteryMeter::paintEvent( QPaintEvent* ) |
118 | { | 118 | { |
119 | if ( style == 1 ) | 119 | if ( style == 1 ) |
120 | { | 120 | { |
121 | QPainter p(this); | 121 | QPainter p(this); |
122 | QFont f( "Fixed", AppLnk::smallIconSize()/2 ); | 122 | QFont f( "Fixed", AppLnk::smallIconSize()/2 ); |
123 | QFontMetrics fm( f ); | 123 | QFontMetrics fm( f ); |
124 | p.setFont( f ); | 124 | p.setFont( f ); |
125 | p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); | 125 | if ( percent > 98 ) { |
126 | p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); | 126 | p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) ); |
127 | } | ||
128 | else if ( percent < 5 ) | ||
129 | { | ||
130 | p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) ); | ||
131 | } | ||
132 | else | ||
133 | { | ||
134 | p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); | ||
135 | p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); | ||
136 | } | ||
127 | return; | 137 | return; |
128 | } | 138 | } |
129 | 139 | ||
130 | QPainter p(this); | 140 | QPainter p(this); |
131 | QColor color; | 141 | QColor color; |
132 | QColor g = gray.light( 160 ); | 142 | QColor g = gray.light( 160 ); |
133 | switch ( ps->acStatus() ) | 143 | switch ( ps->acStatus() ) |
134 | { | 144 | { |