Only increase the height of the statusbar for long texts if the message type is not DolphinStatusBar::Default (otherwise the layout of the icons view might get changed when hovering items).

svn path=/trunk/KDE/kdebase/apps/; revision=759053
This commit is contained in:
Peter Penz 2008-01-09 21:42:48 +00:00
parent 600fd01bc2
commit fa042ee797

View file

@ -229,16 +229,21 @@ void StatusBarMessageLabel::assureVisibleText()
return; return;
} }
// calculate the required height of the widget thats int requiredHeight = m_minTextHeight;
// needed for having a fully visible text if (m_type != DolphinStatusBar::Default) {
// Calculate the required height of the widget thats
// needed for having a fully visible text. Note that for the default
// statusbar type (e. g. hover information) increasing the text height
// is not wanted, as this might rearrange the layout of items.
QFontMetrics fontMetrics(font()); QFontMetrics fontMetrics(font());
const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(), const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
Qt::AlignVCenter | Qt::TextWordWrap, Qt::AlignVCenter | Qt::TextWordWrap, m_text));
m_text)); requiredHeight = bounds.height();
int requiredHeight = bounds.height();
if (requiredHeight < m_minTextHeight) { if (requiredHeight < m_minTextHeight) {
requiredHeight = m_minTextHeight; requiredHeight = m_minTextHeight;
} }
}
// Increase/decrease the current height of the widget to the // Increase/decrease the current height of the widget to the
// required height. The increasing/decreasing is done in several // required height. The increasing/decreasing is done in several