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

List:       kde-core-devel
Subject:    [PATCH] KFileItemDelegate graying out text
From:       Rafael Fernández López <ereslibre () kde ! org>
Date:       2009-08-05 9:46:35
Message-ID: 93f85fee0908050246s17cf6385od5e4d6e1a2c1ca29 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

Ben Cooksley pointed out that in Systemsettings right now, if we use the
icon view (which uses KFileItemDelegate) is not graying out text when
filtering out elements that doesn't match our search, while on the treeview
that uses a regular Qt delegate, the text is being grayed out.

In the first case, I think we could try to use in both KFileItemDelegate,
but anyway, I attach a patch that is coherent with Qt and makes
KFileItemDelegate to gray out text too, as the Qt delegate does.

Fredrik, is this OK with you to be committed ?


Regards,
Rafael Fern=C3=A1ndez L=C3=B3pez.

[Attachment #5 (text/html)]

<div>Hi,<br></div><div><br></div><div>Ben Cooksley pointed out that in Syst=
emsettings right now, if we use the icon view (which uses KFileItemDelegate=
) is not graying out text when filtering out elements that doesn&#39;t matc=
h our search, while on the treeview that uses a regular Qt delegate, the te=
xt is being grayed out.</div>
<div><br></div><div>In the first case, I think we could try to use in both =
KFileItemDelegate, but anyway, I attach a patch that is coherent with Qt an=
d makes KFileItemDelegate to gray out text too, as the Qt delegate does.</d=
iv>
<div><br></div><div>Fredrik, is this OK with you to be committed ?</div><di=
v><br></div><div><br></div><div>Regards,</div><div>Rafael Fern=C3=A1ndez L=
=C3=B3pez.</div>

--00163641695dfe1461047061e036--
["kdelibs.diff" (application/octet-stream)]

diff --git a/kio/kio/kfileitemdelegate.cpp b/kio/kio/kfileitemdelegate.cpp
index 82bb574..ea584d4 100644
--- a/kio/kio/kfileitemdelegate.cpp
+++ b/kio/kio/kfileitemdelegate.cpp
@@ -1154,6 +1154,11 @@ void KFileItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
     QStyleOptionViewItemV4 opt(option);
     d->initStyleOption(&opt, index);
 
+    if (!(option.state & QStyle::State_Enabled))
+    {
+        opt.palette.setCurrentColorGroup(QPalette::Disabled);
+    }
+
     // Unset the mouse over bit if we're not drawing the first column
     if (index.column() > 0)
         opt.state &= ~QStyle::State_MouseOver;


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

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