[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdelibs/kio/kio
From:       Frank Reininghaus <frank78ac () googlemail ! com>
Date:       2010-02-22 18:10:49
Message-ID: 1266862249.033294.26719.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1094408 by freininghaus:

Make it possible to set the maximum size for editing in
KFileItemDelegate also if the icon is not above or below the text.

This will be in KDE SC 4.4.1.

CCBUG: 226666


 M  +18 -4     kfileitemdelegate.cpp  


--- branches/KDE/4.4/kdelibs/kio/kio/kfileitemdelegate.cpp #1094407:1094408
@@ -1402,10 +1402,24 @@
     QRect r = d->labelRectangle(opt);
 
     // Use the full available width for the editor when maximumSize is set
-    if (d->verticalLayout(option) && !d->maximumSize.isEmpty()) {
-        int diff = qMax(r.width(), d->maximumSize.width()) - r.width();
-        if (diff > 1)
-            r.adjust(-(diff / 2), 0, diff / 2, 0);
+    if (!d->maximumSize.isEmpty()) {
+        if (d->verticalLayout(option)) {
+            int diff = qMax(r.width(), d->maximumSize.width()) - r.width();
+            if (diff > 1) {
+                r.adjust(-(diff / 2), 0, diff / 2, 0);
+            }
+        }
+        else {
+            int diff = qMax(r.width(), d->maximumSize.width() - opt.decorationSize.width()) - r.width();
+            if (diff > 0) {
+                if (opt.decorationPosition == QStyleOptionViewItem::Left) {
+                    r.adjust(0, 0, diff, 0);
+                }
+                else {
+                    r.adjust(-diff, 0, 0, 0);
+                }
+            }
+        }
     }
 
     KTextEdit *textedit = qobject_cast<KTextEdit*>(editor);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic