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

List:       kde-devel
Subject:    Re: icon overlay question
From:       Robert Hogan <lists () roberthogan ! net>
Date:       2008-06-15 20:14:23
Message-ID: 200806152114.31803.lists () roberthogan ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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.

["signature.asc" (application/pgp-signature)]

>> 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