[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: icon overlay question
From: "Ramazan Girgin" <ramazangirgin () gmail ! com>
Date: 2008-06-16 6:19:56
Message-ID: 4f2df0310806152319k558652ccxe5dcd41951e5bd8d () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
[Attachment #4 (text/plain)]
Where will I put this code in? As a plugin ? How?
On Sun, Jun 15, 2008 at 11:14 PM, Robert Hogan <lists@roberthogan.net>
wrote:
> On Friday 13 June 2008 14:37:51 Ramazan Girgin wrote:
> > Hi all,
> > I want to set overlay icon for some of files like .gz , locked and hidden
> > files. Ex . .gz extension files have small rectangle overlay icon. How
> can
> > i do this for my extension. ýs there any way to writing plugin code for
> > this. I want to show orijinal file extension (Ex.open office files) and
> my
> > overlay icon.Files name may be like this ExFile.m4f.doc
> > . m4f is my extension for overlay. I have looked in source code of kde
> > and i haven't find any solution for this.?
> > On windows we can do this with icon overlay shell extensions . How can do
> > this on kde.
> > Thanks in advance
> > Ramazan
>
> Here's the code in minicli that overlays a website's favicon over the
> konqueror
> icon when you type in a web address:
>
> QPixmap icon = DesktopIcon( m_iconName );
> QPixmap overlay( locate ( "icon", KMimeType::favIconForURL(
> m_filterData->uri() ) + ".png" ) );
> if ( !overlay.isNull() )
> {
> int x = icon.width() - overlay.width();
> int y = icon.height() - overlay.height();
> if ( icon.mask() )
> {
> QBitmap mask = *icon.mask();
> bitBlt( &mask, x, y,
> overlay.mask() ? const_cast<QBitmap *>(overlay.mask()) :
> &overlay,
> 0, 0, overlay.width(), overlay.height(),
> overlay.mask() ? OrROP : SetROP );
> icon.setMask(mask);
> }
> bitBlt( &icon, x, y, &overlay );
> }
>
> This should help you get started.
>
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> unsubscribe <<
>
>
[Attachment #5 (text/html)]
Where will I put this code in? As a plugin ? How?<br><br><div class="gmail_quote">On \
Sun, Jun 15, 2008 at 11:14 PM, Robert Hogan <<a \
href="mailto:lists@roberthogan.net">lists@roberthogan.net</a>> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div><div></div><div \
class="Wj3C7c">On Friday 13 June 2008 14:37:51 Ramazan Girgin wrote:<br> > Hi \
all,<br> > I want to set overlay icon for some of files like .gz , locked and \
hidden<br> > files. Ex . .gz extension files have small rectangle overlay icon. \
How can<br> > i do this for my extension. ýs there any way to writing plugin code \
for<br> > this. I want to show orijinal file extension (Ex.open office files) and \
my<br> > overlay icon.Files name may be like this ExFile.m4f.doc<br>
> . m4f is my extension for overlay. I have looked in source code of \
kde<br> > and i haven't find any solution for this.?<br>
> On windows we can do this with icon overlay shell extensions . How can do<br>
> this on kde.<br>
> Thanks in advance<br>
> Ramazan<br>
<br>
</div></div>Here's the code in minicli that overlays a website's favicon over \
the konqueror<br> icon when you type in a web address:<br>
<br>
QPixmap icon = DesktopIcon( m_iconName );<br>
QPixmap overlay( locate ( "icon", \
KMimeType::favIconForURL(<br> m_filterData->uri() ) + ".png" ) );<br>
if ( !overlay.isNull() )<br>
{<br>
int x = icon.width() - overlay.width();<br>
int y = icon.height() - overlay.height();<br>
if ( icon.mask() )<br>
{<br>
QBitmap mask = *icon.mask();<br>
bitBlt( &mask, x, y,<br>
overlay.mask() ? \
const_cast<QBitmap *>(overlay.mask()) :<br> &overlay,<br>
0, 0, overlay.width(), \
overlay.height(),<br> \
overlay.mask() ? OrROP : SetROP );<br> \
icon.setMask(mask);<br> }<br>
bitBlt( &icon, x, y, &overlay );<br>
}<br>
<br>
This should help you get started.<br>
<br><br>
>> Visit <a href="http://mail.kde.org/mailman/listinfo/kde-devel#unsub" \
target="_blank">http://mail.kde.org/mailman/listinfo/kde-devel#unsub</a> to \
unsubscribe <<<br> <br></blockquote></div><br>
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic