From e80d466d7e4fd7b08fba2edd36aab8af27706e9c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 3 May 2013 17:16:22 -0500 Subject: Fix incorrect positions and heights in open/save dialogs when nonstandard font sizes are in use (cherry picked from commit c5463fddb10d24f0dd582765fdaf488075854d61) --- kio/kfile/kurlbar.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kio/kfile') diff --git a/kio/kfile/kurlbar.cpp b/kio/kfile/kurlbar.cpp index ee79b4e58..5a746ed98 100644 --- a/kio/kfile/kurlbar.cpp +++ b/kio/kfile/kurlbar.cpp @@ -214,10 +214,12 @@ void KURLBarItem::paint( TQPainter *p ) p->drawPixmap( margin, yPos, *pm ); if ( !text().isEmpty() ) { TQFontMetrics fm = p->fontMetrics(); - if ( pm->height() < fm.height() ) + if ( pm->height() < fm.height() ) { yPos = fm.ascent() + fm.leading()/2; - else - yPos = pm->height()/2 - fm.height()/2 + fm.ascent(); + } + else { + yPos = height(box)/2 - fm.height()/2 + fm.ascent() - margin; + } yPos += margin; int stringWidth = box->width() - pm->width() - 2 - (margin * 2); -- cgit v1.2.1