mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-28 19:28:38 +00:00
Review toolbar tweaks.
svn path=/trunk/KDE/kdegraphics/okular/; revision=756192
This commit is contained in:
parent
93fdfab88c
commit
a56276f00d
1 changed files with 6 additions and 4 deletions
|
@ -636,18 +636,19 @@ void ToolBarPrivate::buildToolBar()
|
||||||
q->resize( myWidth + 1, myHeight + 1 );
|
q->resize( myWidth + 1, myHeight + 1 );
|
||||||
|
|
||||||
// 4. create and set transparency mask // 4. draw background
|
// 4. create and set transparency mask // 4. draw background
|
||||||
QPainter maskPainter( &mask);
|
QPainter maskPainter( &mask);
|
||||||
mask.fill( Qt::white );
|
mask.fill( Qt::white );
|
||||||
maskPainter.setBrush( Qt::black );
|
maskPainter.setBrush( Qt::black );
|
||||||
if ( vertical )
|
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
|
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();
|
maskPainter.end();
|
||||||
q->setMask( mask );
|
q->setMask( mask );
|
||||||
|
|
||||||
// 5. draw background
|
// 5. draw background
|
||||||
QPainter bufferPainter( &backgroundPixmap );
|
QPainter bufferPainter( &backgroundPixmap );
|
||||||
|
bufferPainter.translate( 0.5, 0.5 );
|
||||||
QPalette pal = q->palette();
|
QPalette pal = q->palette();
|
||||||
// 5.1. draw horizontal/vertical gradient
|
// 5.1. draw horizontal/vertical gradient
|
||||||
QLinearGradient grad;
|
QLinearGradient grad;
|
||||||
|
@ -670,13 +671,14 @@ void ToolBarPrivate::buildToolBar()
|
||||||
grad.setColorAt( 1, pal.color( QPalette::Active, QPalette::Light ) );
|
grad.setColorAt( 1, pal.color( QPalette::Active, QPalette::Light ) );
|
||||||
bufferPainter.setBrush( QBrush( grad ) );
|
bufferPainter.setBrush( QBrush( grad ) );
|
||||||
// 5.2. draw rounded border
|
// 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 );
|
bufferPainter.setRenderHints( QPainter::Antialiasing );
|
||||||
if ( vertical )
|
if ( vertical )
|
||||||
bufferPainter.drawRoundRect( topLeft ? -10 : 0, 0, myWidth + 10, myHeight, 2000 / (myWidth + 10), 2000 / myHeight );
|
bufferPainter.drawRoundRect( topLeft ? -10 : 0, 0, myWidth + 10, myHeight, 2000 / (myWidth + 10), 2000 / myHeight );
|
||||||
else
|
else
|
||||||
bufferPainter.drawRoundRect( 0, topLeft ? -10 : 0, myWidth, myHeight + 10, 2000 / myWidth, 2000 / (myHeight + 10) );
|
bufferPainter.drawRoundRect( 0, topLeft ? -10 : 0, myWidth, myHeight + 10, 2000 / myWidth, 2000 / (myHeight + 10) );
|
||||||
// 5.3. draw handle
|
// 5.3. draw handle
|
||||||
|
bufferPainter.translate( -0.5, -0.5 );
|
||||||
bufferPainter.setPen( pal.color( QPalette::Active, QPalette::Mid ) );
|
bufferPainter.setPen( pal.color( QPalette::Active, QPalette::Mid ) );
|
||||||
if ( vertical )
|
if ( vertical )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue