From a64227049a2fe07f54ab9e370e3afdbcc2b5890a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 25 Jun 2009 18:31:24 +0000 Subject: [PATCH] add a bit of margin when is painted in svg svn path=/trunk/KDE/kdelibs/; revision=987254 --- delegate.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/delegate.cpp b/delegate.cpp index 2a78a6616..081d0af17 100644 --- a/delegate.cpp +++ b/delegate.cpp @@ -454,7 +454,15 @@ QSize Delegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex & size.setHeight(qMax(option.decorationSize.height(), qMax(size.height(), metrics.height() + subMetrics.ascent()) + 3) + 4); // kDebug() << "size hint is" << size << (metrics.height() + subMetrics.ascent()); - size *= 1.1; + const bool useSvg = option.palette.color(QPalette::Base).alpha() == 0; + + if (useSvg) { + qreal left, top, right, bottom; + d->svg->getMargins(left, top, right, bottom); + size += QSize(left+right, top+bottom); + } else { + size *= 1.1; + } return size; }