┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-10-15 21:41:59 +0000
committerPeter Penz <[email protected]>2008-10-15 21:41:59 +0000
commit49fd5b1c4b57abd09babe33de0313b2789256515 (patch)
tree3845dc206d2c42b78f2f210309a0fe872d6caec9
parentd39451d6d17cda145527ef1bdc05277de164d765 (diff)
assure that the minimized width can never get larger than the default width
svn path=/trunk/KDE/kdebase/apps/; revision=871881
-rw-r--r--src/dolphinfileitemdelegate.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dolphinfileitemdelegate.cpp b/src/dolphinfileitemdelegate.cpp
index 53c1d781e..c0e032570 100644
--- a/src/dolphinfileitemdelegate.cpp
+++ b/src/dolphinfileitemdelegate.cpp
@@ -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"