From 4364269ddceef65bf06f475e2dcface882d37ed4 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 22 May 2003 13:59:27 +0000 Subject: fix for the textual display to display "F" and "E" instead of "100%" and <"5%" zecke: please backport to 0.9.9 --- (limited to 'core/applets/batteryapplet/battery.cpp') 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* ) QFont f( "Fixed", AppLnk::smallIconSize()/2 ); QFontMetrics fm( f ); p.setFont( f ); - p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); - p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); + if ( percent > 98 ) { + p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) ); + } + else if ( percent < 5 ) + { + p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) ); + } + else + { + p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); + p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); + } return; } -- cgit v0.9.0.2