icons in desktop menu patch

Christopher Carroll christopher.carroll at birch.net
Mon Jan 5 21:53:31 CET 2004


If anyone is interested - I made a patch to add icons to xfdesktop's
desktop menu.  Just add icon="path/to/icon/file" to any app entry in
menu.xml.  It also works with builtin.  Also, I'm not sure how to
dertermine the best icon height automatically, so if you don't like the
default of 16 you can also set icon_size="24" or whatever you like. The
patch was made against xfdesktop-4.0.2 (should be applied with -Np1 from
the xfdesktop top source dir).

You cannot add icons to menu items that are submenus themselves. 
xfdesktop uses an item factory to create the menu - and I don't think
there's a way to have an item factory do this.  If I have some free time
before school starts back up I may write a patch that manually creates
the items so you can set icons on these enties too.

To any developers who read this:  I noticed that this was marked as TODO
in the source code.  My method probably isn't the best way to add icons
(I'm really just learning gtk) so this patch probably won't be too
useful.  But it may save you someone a little time to know that to get
the item factory to create icons the extra_data field of the entries
must point to a serialized GdkPixdata bytestream (rather than a
GdkPixbuf as the comments suggest).

Hope someone finds this useful...
Christopher



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xfdesktop-4.0.2-menu-icons.patch
URL: <http://mail.xfce.org/pipermail/xfce/attachments/20040105/0a6596fa/attachment.ksh>


More information about the Xfce mailing list