Review toolbar tweaks.

svn path=/trunk/KDE/kdegraphics/okular/; revision=756192
This commit is contained in:
Eike Hein 2008-01-02 22:09:12 +00:00
parent 93fdfab88c
commit a56276f00d

View file

@ -636,18 +636,19 @@ void ToolBarPrivate::buildToolBar()
q->resize( myWidth + 1, myHeight + 1 );
// 4. create and set transparency mask // 4. draw background
QPainter maskPainter( &mask);
QPainter maskPainter( &mask);
mask.fill( Qt::white );
maskPainter.setBrush( Qt::black );
if ( vertical )
maskPainter.drawRoundRect( topLeft ? -10 : 0, 0, myWidth + 10, myHeight, 2000 / (myWidth + 10), 2000 / myHeight );
maskPainter.drawRoundRect( topLeft ? -10 : 0, 0, myWidth + 11, myHeight, 2000 / (myWidth + 10), 2000 / myHeight );
else
maskPainter.drawRoundRect( 0, topLeft ? -10 : 0, myWidth, myHeight + 10, 2000 / myWidth, 2000 / (myHeight + 10) );
maskPainter.drawRoundRect( 0, topLeft ? -10 : 0, myWidth, myHeight + 11, 2000 / myWidth, 2000 / (myHeight + 10) );
maskPainter.end();
q->setMask( mask );
// 5. draw background
QPainter bufferPainter( &backgroundPixmap );
bufferPainter.translate( 0.5, 0.5 );
QPalette pal = q->palette();
// 5.1. draw horizontal/vertical gradient
QLinearGradient grad;
@ -670,13 +671,14 @@ void ToolBarPrivate::buildToolBar()
grad.setColorAt( 1, pal.color( QPalette::Active, QPalette::Light ) );
bufferPainter.setBrush( QBrush( grad ) );
// 5.2. draw rounded border
bufferPainter.setPen( pal.color( QPalette::Active, QPalette::Dark ) );
bufferPainter.setPen( pal.color( QPalette::Active, QPalette::Dark ).lighter( 140 ) );
bufferPainter.setRenderHints( QPainter::Antialiasing );
if ( vertical )
bufferPainter.drawRoundRect( topLeft ? -10 : 0, 0, myWidth + 10, myHeight, 2000 / (myWidth + 10), 2000 / myHeight );
else
bufferPainter.drawRoundRect( 0, topLeft ? -10 : 0, myWidth, myHeight + 10, 2000 / myWidth, 2000 / (myHeight + 10) );
// 5.3. draw handle
bufferPainter.translate( -0.5, -0.5 );
bufferPainter.setPen( pal.color( QPalette::Active, QPalette::Mid ) );
if ( vertical )
{