mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
assure that the minimized width can never get larger than the default width
svn path=/trunk/KDE/kdebase/apps/; revision=871881
This commit is contained in:
parent
d39451d6d1
commit
49fd5b1c4b
|
@ -60,7 +60,13 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
|
|||
int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOptionViewItem& option)
|
||||
{
|
||||
QFontMetrics fontMetrics(option.font);
|
||||
return option.decorationSize.width() + fontMetrics.width(name) + 16;
|
||||
int width = option.decorationSize.width() + fontMetrics.width(name) + 16;
|
||||
|
||||
const int defaultWidth = option.rect.width();
|
||||
if ((defaultWidth > 0) && (defaultWidth < width)) {
|
||||
width = defaultWidth;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
#include "dolphinfileitemdelegate.moc"
|
||||
|
|
Loading…
Reference in a new issue