In the message widget, draw the icon on the right when the layout is RightToLeft.

svn path=/trunk/KDE/kdegraphics/okular/; revision=748578
This commit is contained in:
Pino Toscano 2007-12-14 21:37:00 +00:00
parent f4c249060d
commit 1bf39cf98a

View file

@ -167,6 +167,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
int width = textRect.width(),
height = textRect.height(),
textXOffset = 0,
iconXOffset = 0,
shadowOffset = message.isRightToLeft() ? -1 : 1;
// load icon (if set) and update geometry
@ -191,8 +192,15 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
symbol = SmallIcon( "dialog-information" );
break;
}
textXOffset = 2 + symbol.width();
width += textXOffset;
if ( QApplication::isRightToLeft() )
{
iconXOffset = 2 + textRect.width();
}
else
{
textXOffset = 2 + symbol.width();
}
width += 2 + symbol.width();
height = qMax( height, symbol.height() );
}
QRect geometry( 0, 0, width + 10, height + 8 );
@ -219,7 +227,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
// draw icon if present
if ( !symbol.isNull() )
bufferPainter.drawPixmap( 5, 4, symbol, 0, 0, symbol.width(), symbol.height() );
bufferPainter.drawPixmap( 5 + iconXOffset, 4, symbol, 0, 0, symbol.width(), symbol.height() );
// draw shadow and text
int yText = geometry.height() - height / 2;