author | mickeyl <mickeyl> | 2003-05-22 13:59:27 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-22 13:59:27 (UTC) |
commit | 4364269ddceef65bf06f475e2dcface882d37ed4 (patch) (unidiff) | |
tree | c30a0596cf84f542ff6bc217e94ccb79459c55e4 /core | |
parent | ac74e73175ef4fecbcb77cd23b792983ca6ea06b (diff) | |
download | opie-4364269ddceef65bf06f475e2dcface882d37ed4.zip opie-4364269ddceef65bf06f475e2dcface882d37ed4.tar.gz opie-4364269ddceef65bf06f475e2dcface882d37ed4.tar.bz2 |
fix for the textual display to display "F" and "E" instead of "100%" and <"5%"
zecke: please backport to 0.9.9
-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 | |||
@@ -122,8 +122,18 @@ void BatteryMeter::paintEvent( QPaintEvent* ) | |||
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 | ||