Use not deprecated methods

remotes/origin/Applications/19.04
Laurent Montel 7 years ago
parent d120f2b655
commit 2406bf9c4c
  1. 4
      ui/minibar.cpp
  2. 16
      ui/pageview.cpp
  3. 2
      ui/pageviewannotator.cpp
  4. 2
      ui/pageviewutils.cpp
  5. 4
      ui/sidebar.cpp

@ -412,7 +412,7 @@ void ProgressWidget::paintEvent( QPaintEvent * e )
p.fillRect( fRect, pal.color( QPalette::Active, QPalette::Highlight ) ); p.fillRect( fRect, pal.color( QPalette::Active, QPalette::Highlight ) );
if ( l && l != w ) if ( l && l != w )
{ {
p.setPen( pal.color( QPalette::Active, QPalette::Highlight ).dark( 120 ) ); p.setPen( pal.color( QPalette::Active, QPalette::Highlight ).darker( 120 ) );
int delta = QApplication::isRightToLeft() ? w - l : l; int delta = QApplication::isRightToLeft() ? w - l : l;
p.drawLine( delta, 0, delta, h ); p.drawLine( delta, 0, delta, h );
} }
@ -540,7 +540,7 @@ void PagesEdit::updatePalette()
if ( hasFocus() ) if ( hasFocus() )
pal.setColor( QPalette::Active, QPalette::Base, QApplication::palette().color( QPalette::Active, QPalette::Base ) ); pal.setColor( QPalette::Active, QPalette::Base, QApplication::palette().color( QPalette::Active, QPalette::Base ) );
else else
pal.setColor( QPalette::Base, QApplication::palette().color( QPalette::Base ).dark( 102 ) ); pal.setColor( QPalette::Base, QApplication::palette().color( QPalette::Base ).darker( 102 ) );
setPalette( pal ); setPalette( pal );
} }

@ -1740,7 +1740,7 @@ void PageView::paintEvent(QPaintEvent *pe)
(blendRect.left() - contentsRect.left()) * devicePixelRatioF(), (blendRect.top() - contentsRect.top()) * devicePixelRatioF(), (blendRect.left() - contentsRect.left()) * devicePixelRatioF(), (blendRect.top() - contentsRect.top()) * devicePixelRatioF(),
blendRect.width() * devicePixelRatioF(), blendRect.height() * devicePixelRatioF() ); blendRect.width() * devicePixelRatioF(), blendRect.height() * devicePixelRatioF() );
QColor blCol = selBlendColor.dark( 140 ); QColor blCol = selBlendColor.darker( 140 );
blCol.setAlphaF( 0.2 ); blCol.setAlphaF( 0.2 );
p.fillRect( blendedPixmap.rect(), blCol ); p.fillRect( blendedPixmap.rect(), blCol );
p.end(); p.end();
@ -1772,7 +1772,7 @@ void PageView::paintEvent(QPaintEvent *pe)
(blendRect.left() - contentsRect.left()) * devicePixelRatioF(), (blendRect.top() - contentsRect.top()) * devicePixelRatioF(), (blendRect.left() - contentsRect.left()) * devicePixelRatioF(), (blendRect.top() - contentsRect.top()) * devicePixelRatioF(),
blendRect.width() * devicePixelRatioF(), blendRect.height() * devicePixelRatioF() ); blendRect.width() * devicePixelRatioF(), blendRect.height() * devicePixelRatioF() );
QColor blCol = d->mouseSelectionColor.dark( 140 ); QColor blCol = d->mouseSelectionColor.darker( 140 );
blCol.setAlphaF( 0.2 ); blCol.setAlphaF( 0.2 );
p.fillRect( blendedPixmap.rect(), blCol ); p.fillRect( blendedPixmap.rect(), blCol );
p.end(); p.end();
@ -1810,7 +1810,7 @@ void PageView::paintEvent(QPaintEvent *pe)
if ( !selectionRect.isNull() && selectionRect.intersects( contentsRect ) && if ( !selectionRect.isNull() && selectionRect.intersects( contentsRect ) &&
!selectionRectInternal.contains( contentsRect ) ) !selectionRectInternal.contains( contentsRect ) )
{ {
screenPainter.setPen( palette().color( QPalette::Active, QPalette::Highlight ).dark(110) ); screenPainter.setPen( palette().color( QPalette::Active, QPalette::Highlight ).darker(110) );
screenPainter.drawRect( selectionRect ); screenPainter.drawRect( selectionRect );
} }
// 2b) Layer 1b: paint opaque selection (table) // 2b) Layer 1b: paint opaque selection (table)
@ -1822,7 +1822,7 @@ void PageView::paintEvent(QPaintEvent *pe)
if ( !selectionPartRect.isNull() && selectionPartRect.intersects( contentsRect ) && if ( !selectionPartRect.isNull() && selectionPartRect.intersects( contentsRect ) &&
!selectionPartRectInternal.contains( contentsRect ) ) !selectionPartRectInternal.contains( contentsRect ) )
{ {
screenPainter.setPen( palette().color( QPalette::Active, QPalette::Highlight ).dark(110) ); screenPainter.setPen( palette().color( QPalette::Active, QPalette::Highlight ).darker(110) );
screenPainter.drawRect( selectionPartRect ); screenPainter.drawRect( selectionPartRect );
} }
} }
@ -1846,7 +1846,7 @@ void PageView::paintEvent(QPaintEvent *pe)
void PageView::drawTableDividers(QPainter * screenPainter) void PageView::drawTableDividers(QPainter * screenPainter)
{ {
if (!d->tableSelectionParts.isEmpty()) { if (!d->tableSelectionParts.isEmpty()) {
screenPainter->setPen( d->mouseSelectionColor.dark() ); screenPainter->setPen( d->mouseSelectionColor.darker() );
if (d->tableDividersGuessed) { if (d->tableDividersGuessed) {
QPen p = screenPainter->pen(); QPen p = screenPainter->pen();
p.setStyle( Qt::DashLine ); p.setStyle( Qt::DashLine );
@ -2208,7 +2208,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
d->aPrevAction = d->aMouseNormal; d->aPrevAction = d->aMouseNormal;
d->aMouseSelect->trigger(); d->aMouseSelect->trigger();
QPoint newPos = eventPos + QPoint( deltaX, deltaY ); QPoint newPos = eventPos + QPoint( deltaX, deltaY );
selectionStart( newPos, palette().color( QPalette::Active, QPalette::Highlight ).light( 120 ), false ); selectionStart( newPos, palette().color( QPalette::Active, QPalette::Highlight ).lighter( 120 ), false );
updateSelection( eventPos ); updateSelection( eventPos );
break; break;
} }
@ -2382,7 +2382,7 @@ void PageView::mousePressEvent( QMouseEvent * e )
case Okular::Settings::EnumMouseMode::TrimSelect: case Okular::Settings::EnumMouseMode::TrimSelect:
if ( leftButton ) if ( leftButton )
{ {
selectionStart( eventPos, palette().color( QPalette::Active, QPalette::Highlight ).light( 120 ), false ); selectionStart( eventPos, palette().color( QPalette::Active, QPalette::Highlight ).lighter( 120 ), false );
} }
break; break;
case Okular::Settings::EnumMouseMode::TableSelect: case Okular::Settings::EnumMouseMode::TableSelect:
@ -2390,7 +2390,7 @@ void PageView::mousePressEvent( QMouseEvent * e )
{ {
if (d->tableSelectionParts.isEmpty()) if (d->tableSelectionParts.isEmpty())
{ {
selectionStart( eventPos, palette().color( QPalette::Active, QPalette::Highlight ).light( 120 ), false ); selectionStart( eventPos, palette().color( QPalette::Active, QPalette::Highlight ).lighter( 120 ), false );
} else { } else {
QRect updatedRect; QRect updatedRect;
foreach (const TableSelectionPart &tsp, d->tableSelectionParts) { foreach (const TableSelectionPart &tsp, d->tableSelectionParts) {

@ -407,7 +407,7 @@ class PolyLineEngine : public AnnotatorEngine
const Okular::NormalizedPoint second = points[1]; const Okular::NormalizedPoint second = points[1];
// draw a semitransparent block around the 2 points // draw a semitransparent block around the 2 points
painter->setPen( m_engineColor ); painter->setPen( m_engineColor );
painter->setBrush( QBrush( m_engineColor.light(), Qt::Dense4Pattern ) ); painter->setBrush( QBrush( m_engineColor.lighter(), Qt::Dense4Pattern ) );
painter->drawRect( (int)(first.x * (double)xScale), (int)(first.y * (double)yScale), painter->drawRect( (int)(first.x * (double)xScale), (int)(first.y * (double)yScale),
(int)((second.x - first.x) * (double)xScale), (int)((second.y - first.y) * (double)yScale) ); (int)((second.x - first.x) * (double)xScale), (int)((second.y - first.y) * (double)yScale) );
} }

@ -412,7 +412,7 @@ void PageViewMessage::paintEvent( QPaintEvent * /* e */ )
const int textDrawingFlags = Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap; const int textDrawingFlags = Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap;
// draw shadow and text // draw shadow and text
painter.setPen( palette().color( QPalette::Window ).dark( 115 ) ); painter.setPen( palette().color( QPalette::Window ).darker( 115 ) );
painter.drawText( xStartPoint + shadowOffset, yStartPoint + shadowOffset, textRect.width(), textRect.height(), textDrawingFlags, m_message ); painter.drawText( xStartPoint + shadowOffset, yStartPoint + shadowOffset, textRect.width(), textRect.height(), textDrawingFlags, m_message );
if ( !m_details.isEmpty() ) if ( !m_details.isEmpty() )
painter.drawText( xStartPoint + shadowOffset, yStartPoint + textRect.height() + m_lineSpacing + shadowOffset, textRect.width(), detailsRect.height(), textDrawingFlags, m_details ); painter.drawText( xStartPoint + shadowOffset, yStartPoint + textRect.height() + m_lineSpacing + shadowOffset, textRect.width(), detailsRect.height(), textDrawingFlags, m_details );

@ -150,7 +150,7 @@ void SidebarDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opti
} }
else if ( option.state & QStyle::State_MouseOver ) else if ( option.state & QStyle::State_MouseOver )
{ {
backBrush = m_selectionBackground->brush(option.palette).color().light( 115 ); backBrush = m_selectionBackground->brush(option.palette).color().lighter( 115 );
foreColor = m_windowForeground->brush(option.palette).color(); foreColor = m_windowForeground->brush(option.palette).color();
hover = true; hover = true;
} }
@ -167,7 +167,7 @@ void SidebarDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opti
{ {
Qt::BrushStyle bs = opt.backgroundBrush.style(); Qt::BrushStyle bs = opt.backgroundBrush.style();
if ( bs > Qt::NoBrush && bs < Qt::TexturePattern ) if ( bs > Qt::NoBrush && bs < Qt::TexturePattern )
opt.backgroundBrush = opt.backgroundBrush.color().light( 115 ); opt.backgroundBrush = opt.backgroundBrush.color().lighter( 115 );
else else
opt.backgroundBrush = backBrush; opt.backgroundBrush = backBrush;
} }

Loading…
Cancel
Save