summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-03 17:16:22 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-05 19:26:38 +0200
commite80d466d7e4fd7b08fba2edd36aab8af27706e9c (patch)
treee8fc54db49bb9b70973bbe8dbab527a8597ffdd4
parenta40d90b98203e83af363f6f40ceaac2329ebede5 (diff)
downloadtdelibs-e80d466d7e4fd7b08fba2edd36aab8af27706e9c.tar.gz
tdelibs-e80d466d7e4fd7b08fba2edd36aab8af27706e9c.zip
Fix incorrect positions and heights in open/save dialogs when nonstandard font sizes are in use
(cherry picked from commit c5463fddb10d24f0dd582765fdaf488075854d61)
-rw-r--r--kdeui/kiconview.cpp12
-rw-r--r--kdeui/ksystemtray.cpp2
-rw-r--r--kio/kfile/kurlbar.cpp8
3 files changed, 12 insertions, 10 deletions
diff --git a/kdeui/kiconview.cpp b/kdeui/kiconview.cpp
index 4e854aba1..26ff21e86 100644
--- a/kdeui/kiconview.cpp
+++ b/kdeui/kiconview.cpp
@@ -540,18 +540,18 @@ void KIconViewItem::calcRect( const TQString& text_ )
tw = view->maxItemWidth() - ( view->itemTextPos() == TQIconView::Bottom ? 0 :
itemIconRect.width() );
}
-
+
TQFontMetrics *fm = view->itemFontMetrics();
TQString t;
TQRect r;
-
+
// When is text_ set ? Doesn't look like it's ever set.
t = text_.isEmpty() ? text() : text_;
-
+
// Max text height
int nbLines = static_cast<KIconView*>( iconView() )->iconTextHeight();
int height = nbLines > 0 ? fm->height() * nbLines : 0xFFFFFFFF;
-
+
// Should not be higher than pixmap if text is alongside icons
if ( view->itemTextPos() != TQIconView::Bottom ) {
if ( d && !d->m_pixmapSize.isNull() )
@@ -560,7 +560,7 @@ void KIconViewItem::calcRect( const TQString& text_ )
height = QMIN( itemIconRect.height(), height );
height = QMAX( height, fm->height() );
}
-
+
// Calculate the word-wrap
TQRect outerRect( 0, 0, tw - 6, height );
m_wordWrap = KWordWrap::formatText( *fm, outerRect, 0, t );
@@ -634,8 +634,8 @@ void KIconViewItem::calcRect( const TQString& text_ )
}
if ( ( itemIconRect.height() <= 20 ) && ( itemTextRect.height() < itemIconRect.height() ) ) {
d->realTextHeight = itemTextRect.height();
- itemTextRect.setHeight( itemIconRect.height() - 2 );
itemTextRect.setY( itemIconRect.y() );
+ itemTextRect.setHeight( itemIconRect.height() - 2 );
}
}
diff --git a/kdeui/ksystemtray.cpp b/kdeui/ksystemtray.cpp
index 9d8d0b4fc..ceeac9be6 100644
--- a/kdeui/ksystemtray.cpp
+++ b/kdeui/ksystemtray.cpp
@@ -85,7 +85,7 @@ KSystemTray::KSystemTray( TQWidget* parent, const char* name )
TQT_TQOBJECT(this), TQT_SLOT( minimizeRestoreAction() ),
d->actionCollection, "minimizeRestore");
#ifdef Q_WS_X11
- KWin::WindowInfo info = KWin::windowInfo( parentWidget()->winId());
+ KWin::WindowInfo info = KWin::windowInfo( parentWidget()->winId() );
d->on_all_desktops = info.onAllDesktops();
#else
d->on_all_desktops = false;
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);