Commit 69ec1755 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix two easy deprecation warnings

width -> horizontalAdvance

background -> window
parent f1ba0d29
......@@ -919,7 +919,7 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
if ( advanceWidth > 0.0 ) {
originAdvance.rx() += advanceWidth;
} else {
originAdvance.rx() += metrics.width( thisChar );
originAdvance.rx() += metrics.horizontalAdvance( thisChar );
}
}
// qCWarning(OkularXpsDebug) << "Glyphs: " << atts.value("Fill") << ", " << atts.value("FontUri");
......@@ -1659,7 +1659,7 @@ Okular::TextPage* XpsPage::textPage()
int lastWidth = 0;
for (int i = 0; i < text.length(); i++) {
int width = metrics.width( text, i + 1 );
int width = metrics.horizontalAdvance( text, i + 1 );
Okular::NormalizedRect * rect = new Okular::NormalizedRect( (origin.x() + lastWidth) / m_pageSize.width(),
(origin.y() - metrics.height()) / m_pageSize.height(),
......
......@@ -182,7 +182,7 @@ PresentationWidget::PresentationWidget( QWidget * parent, Okular::Document * doc
QFontMetrics fm( m_pagesEdit->font() );
QStyleOptionFrame option;
option.initFrom( m_pagesEdit );
m_pagesEdit->setMaximumWidth( fm.width( QString::number( m_document->pages() ) ) + 2 * style()->pixelMetric( QStyle::PM_DefaultFrameWidth, &option, m_pagesEdit ) + 4 ); // the 4 comes from 2*horizontalMargin, horizontalMargin being a define in qlineedit.cpp
m_pagesEdit->setMaximumWidth( fm.horizontalAdvance( QString::number( m_document->pages() ) ) + 2 * style()->pixelMetric( QStyle::PM_DefaultFrameWidth, &option, m_pagesEdit ) + 4 ); // the 4 comes from 2*horizontalMargin, horizontalMargin being a define in qlineedit.cpp
QIntValidator *validator = new QIntValidator( 1, m_document->pages(), m_pagesEdit );
m_pagesEdit->setValidator( validator );
m_topBar->addWidget( m_pagesEdit );
......
......@@ -68,7 +68,7 @@ class TreeView : public QTreeView
const uint w = document.size().width() + 20;
const uint h = document.size().height() + 20;
p.setBrush( palette().background() );
p.setBrush( palette().window() );
p.translate( 0.5, 0.5 );
p.drawRoundRect( 15, 15, w, h, (8*200)/w, (8*200)/h );
p.translate( 20, 20 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment