From 5bfd0d5bd2fb98b55d2da80ae5d394dbf479786a Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 6 Aug 2007 13:21:10 +0000 Subject: [PATCH] don't draw garbage in the progress widget when there's no document open svn path=/trunk/KDE/kdegraphics/okular/; revision=696988 --- ui/minibar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/minibar.cpp b/ui/minibar.cpp index e02d17e76..2ea486945 100644 --- a/ui/minibar.cpp +++ b/ui/minibar.cpp @@ -290,8 +290,13 @@ void ProgressWidget::wheelEvent( QWheelEvent * e ) void ProgressWidget::paintEvent( QPaintEvent * e ) { + QPainter p( this ); + if ( m_progressPercentage < 0.0 ) + { + p.fillRect( rect(), palette().color( QPalette::Active, QPalette::HighlightedText ) ); return; + } // find out the 'fill' and the 'clear' rectangles int w = width(), @@ -299,7 +304,6 @@ void ProgressWidget::paintEvent( QPaintEvent * e ) l = (int)( (float)w * m_progressPercentage ); QRect cRect = ( QApplication::isRightToLeft() ? QRect( 0, 0, w - l, h ) : QRect( l, 0, w - l, h ) ).intersect( e->rect() ); QRect fRect = ( QApplication::isRightToLeft() ? QRect( w - l, 0, l, h ) : QRect( 0, 0, l, h ) ).intersect( e->rect() ); - QPainter p( this ); QPalette pal = palette(); // paint clear rect