[Patch] Add xfce_image_menu_item_new to libxfce4ui

André Miranda andre42m at gmail.com
Sun Feb 5 17:51:27 CET 2017


This function would be very helpful, as we have lots of menu items and 
IMHO dropping icons is not desired in the porting process.
Just a couple questions/requests:
* An option to create the icon from a string:
   xfce_image_menu_item_new_with_icon ("About", TRUE, "gtk-about", 
GTK_ICON_SIZE_MENU);
* What about accelerators? I can use gtk_widget_add_accelerator with the 
returned GtkMenuItem, but the label is required to use 
gtk_accel_label_set_accel_widget. Creating a label and adding it to 
menu_item defeats the purpose of this function.
* Is it possible to remove the ugly left pad of menu? (See attachment).

Cheers,
André miranda

On 02/04/2017 08:32 PM, Simon Steinbeiss wrote:
> Hi Florian,
>
> without having reviewed the patch (although if it's based on upstream 
> anyway, it should be fine) I agree we may want/need something like this.
>
> So far the approach we've taken in other components was to wrap all 
> gtk_image_menu_items in ignore deprecation statements (e.g. xfpm). I 
> wouldn't mind using libxfce4ui instead, as it would result in cleaner 
> code.
>
> I don't think you have to worry much about Gtk2, it's not our goal to 
> have a cross-compatible desktop anyway, we don't even seem to have 
> enough manpower for one toolkit version alone...
>
> Thanks for your efforts
> Simon
>
>
>
>
> Igor Zakharov <f2404 at yandex.ru <mailto:f2404 at yandex.ru>> schrieb am 
> Sa., 4. Feb. 2017, 09:01:
>
>     Hi,
>     The patch looks good to me, and I'd like to have it merged.
>     Ristretto is also using GtkImageMenuItem, and this proposed
>     functionality could be used in the gtk3 port.
>     Igor
>     04.02.2017, 04:59, "Florian Weigelt" <weigelt.florian at gmx.net
>     <mailto:weigelt.florian at gmx.net>>:
>>
>>     Please find attached a patch which adds some functionality to
>>     libxfce4ui
>>     to use a GtkMenuItem with an icon without using the (in gtk3)
>>     deprecated
>>     GtkImageMenuItem.
>>     The code is based on the example given here:
>>     https://developer.gnome.org/gtk3/stable/GtkImageMenuItem.html
>>
>>     This function is not intended to be used for creating menu bars.
>>     Using
>>     GtkBuilder with GMenu (which actually has an icon property) is by far
>>     better suited for this purpose.
>>     However, applications like xfdesktop and xfce4-panel also use
>>     GtkImageMenuItem's and it would be nice to offer the same
>>     functionality
>>     in a gtk3 port of these applications.
>>
>>     I decided on those three parameters because those were the three
>>     information usually available when I looked at xfdesktop's
>>     sources. It
>>     is also possible to let the user create a GtkLabel first and pass
>>     this
>>     widget to the function.
>>     It would also be possible to exclude this function entirely from the
>>     gtk2 build of libxfce4ui where GtkImageMenuItems weren't deprecated.
>>     Please share your thoughts on this.
>>
>>     Kind regards
>>
>>     ,
>>
>>     _______________________________________________
>>     Xfce4-dev mailing list
>>     Xfce4-dev at xfce.org <mailto:Xfce4-dev at xfce.org>
>>     https://mail.xfce.org/mailman/listinfo/xfce4-dev
>>
>     _______________________________________________
>     Xfce4-dev mailing list
>     Xfce4-dev at xfce.org <mailto:Xfce4-dev at xfce.org>
>     https://mail.xfce.org/mailman/listinfo/xfce4-dev
>
>
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20170205/17ba51bf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu.png
Type: image/png
Size: 8983 bytes
Desc: not available
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20170205/17ba51bf/attachment.png>


More information about the Xfce4-dev mailing list