mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
Use not deprecated methods
This commit is contained in:
parent
d120f2b655
commit
2406bf9c4c
5 changed files with 14 additions and 14 deletions
|
@ -412,7 +412,7 @@ void ProgressWidget::paintEvent( QPaintEvent * e )
|
|||
p.fillRect( fRect, pal.color( QPalette::Active, QPalette::Highlight ) );
|
||||
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;
|
||||
p.drawLine( delta, 0, delta, h );
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ void PagesEdit::updatePalette()
|
|||
if ( hasFocus() )
|
||||
pal.setColor( QPalette::Active, QPalette::Base, QApplication::palette().color( QPalette::Active, QPalette::Base ) );
|
||||
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 );
|
||||
}
|
||||
|
|
|
@ -1740,7 +1740,7 @@ void PageView::paintEvent(QPaintEvent *pe)
|
|||
(blendRect.left() - contentsRect.left()) * devicePixelRatioF(), (blendRect.top() - contentsRect.top()) * devicePixelRatioF(),
|
||||
blendRect.width() * devicePixelRatioF(), blendRect.height() * devicePixelRatioF() );
|
||||
|
||||
QColor blCol = selBlendColor.dark( 140 );
|
||||
QColor blCol = selBlendColor.darker( 140 );
|
||||
blCol.setAlphaF( 0.2 );
|
||||
p.fillRect( blendedPixmap.rect(), blCol );
|
||||
p.end();
|
||||
|
@ -1772,7 +1772,7 @@ void PageView::paintEvent(QPaintEvent *pe)
|
|||
(blendRect.left() - contentsRect.left()) * devicePixelRatioF(), (blendRect.top() - contentsRect.top()) * devicePixelRatioF(),
|
||||
blendRect.width() * devicePixelRatioF(), blendRect.height() * devicePixelRatioF() );
|
||||
|
||||
QColor blCol = d->mouseSelectionColor.dark( 140 );
|
||||
QColor blCol = d->mouseSelectionColor.darker( 140 );
|
||||
blCol.setAlphaF( 0.2 );
|
||||
p.fillRect( blendedPixmap.rect(), blCol );
|
||||
p.end();
|
||||
|
@ -1810,7 +1810,7 @@ void PageView::paintEvent(QPaintEvent *pe)
|
|||
if ( !selectionRect.isNull() && selectionRect.intersects( 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 );
|
||||
}
|
||||
// 2b) Layer 1b: paint opaque selection (table)
|
||||
|
@ -1822,7 +1822,7 @@ void PageView::paintEvent(QPaintEvent *pe)
|
|||
if ( !selectionPartRect.isNull() && selectionPartRect.intersects( 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 );
|
||||
}
|
||||
}
|
||||
|
@ -1846,7 +1846,7 @@ void PageView::paintEvent(QPaintEvent *pe)
|
|||
void PageView::drawTableDividers(QPainter * screenPainter)
|
||||
{
|
||||
if (!d->tableSelectionParts.isEmpty()) {
|
||||
screenPainter->setPen( d->mouseSelectionColor.dark() );
|
||||
screenPainter->setPen( d->mouseSelectionColor.darker() );
|
||||
if (d->tableDividersGuessed) {
|
||||
QPen p = screenPainter->pen();
|
||||
p.setStyle( Qt::DashLine );
|
||||
|
@ -2208,7 +2208,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
|
|||
d->aPrevAction = d->aMouseNormal;
|
||||
d->aMouseSelect->trigger();
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
@ -2382,7 +2382,7 @@ void PageView::mousePressEvent( QMouseEvent * e )
|
|||
case Okular::Settings::EnumMouseMode::TrimSelect:
|
||||
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;
|
||||
case Okular::Settings::EnumMouseMode::TableSelect:
|
||||
|
@ -2390,7 +2390,7 @@ void PageView::mousePressEvent( QMouseEvent * e )
|
|||
{
|
||||
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 {
|
||||
QRect updatedRect;
|
||||
foreach (const TableSelectionPart &tsp, d->tableSelectionParts) {
|
||||
|
|
|
@ -407,7 +407,7 @@ class PolyLineEngine : public AnnotatorEngine
|
|||
const Okular::NormalizedPoint second = points[1];
|
||||
// draw a semitransparent block around the 2 points
|
||||
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),
|
||||
(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;
|
||||
|
||||
// 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 );
|
||||
if ( !m_details.isEmpty() )
|
||||
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 )
|
||||
{
|
||||
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();
|
||||
hover = true;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ void SidebarDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opti
|
|||
{
|
||||
Qt::BrushStyle bs = opt.backgroundBrush.style();
|
||||
if ( bs > Qt::NoBrush && bs < Qt::TexturePattern )
|
||||
opt.backgroundBrush = opt.backgroundBrush.color().light( 115 );
|
||||
opt.backgroundBrush = opt.backgroundBrush.color().lighter( 115 );
|
||||
else
|
||||
opt.backgroundBrush = backBrush;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue