mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
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:
parent
600fd01bc2
commit
fa042ee797
|
@ -229,15 +229,20 @@ 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) {
|
||||||
QFontMetrics fontMetrics(font());
|
// Calculate the required height of the widget thats
|
||||||
const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
|
// needed for having a fully visible text. Note that for the default
|
||||||
Qt::AlignVCenter | Qt::TextWordWrap,
|
// statusbar type (e. g. hover information) increasing the text height
|
||||||
m_text));
|
// is not wanted, as this might rearrange the layout of items.
|
||||||
int requiredHeight = bounds.height();
|
|
||||||
if (requiredHeight < m_minTextHeight) {
|
QFontMetrics fontMetrics(font());
|
||||||
requiredHeight = m_minTextHeight;
|
const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
|
||||||
|
Qt::AlignVCenter | Qt::TextWordWrap, m_text));
|
||||||
|
requiredHeight = bounds.height();
|
||||||
|
if (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
|
||||||
|
|
Loading…
Reference in a new issue