Re: [Epiphany] toolbar context menu



On Thu, 2003-03-06 at 02:44, James Willcox wrote:
> Hi,
> 
> I've (finally) finished a patch that adds a context menu to the
> toolbars, which includes the much needed "remove" item.  Most of the
> patch is an updated eggtoolbar from libegg, so don't be alarmed :)
> 
> Thanks,
> James

Great ! :)


Index: data/ui/epiphany-ui.xml.in
===================================================================
RCS file: /cvs/gnome/epiphany/data/ui/epiphany-ui.xml.in,v
retrieving revision 1.13
diff -u -r1.13 epiphany-ui.xml.in
--- data/ui/epiphany-ui.xml.in  19 Feb 2003 16:34:55 -0000      1.13
+++ data/ui/epiphany-ui.xml.in  6 Mar 2003 01:41:51 -0000
@@ -154,6 +154,12 @@
        <menuitem name="CopyImageLocationILP" verb="CopyImageLocation"/>
 </popup>
 
+<popup name="EphyToolbarPopup" verb="FakeToplevel">
+       <menuitem name="RemoveToolbarTP" verb="RemoveToolbarPopup"/>
+       <menuitem name="EditToolbarTP" verb="EditToolbarPopup"/>
+</popup>
+
+
 </popups>
 </Root>

Can we put this in a separate file ? It would make our toolbar code easier to use
in other apps.

@@ -428,8 +498,10 @@
 static void
 do_merge (EphyEditableToolbar *t)
 {
+       EggActionGroup *action_group;
        char *str;
        guint ui_id;
+       int i;
 
        g_return_if_fail (IS_EPHY_EDITABLE_TOOLBAR (t));
 
@@ -470,6 +542,17 @@
        ephy_toolbars_group_foreach_toolbar (t->priv->group,
                                            
(EphyToolbarsGroupForeachToolbarFunc)
                                             ensure_toolbar_min_size,
t);
+
+       for (i = 0; i < ephy_toolbar_popups_n_entries; i++)
+       {
+               ephy_toolbar_popups[i].user_data = t;
+       }
+               
+       action_group = egg_action_group_new ("ToolbarPopupActions");
+       egg_action_group_add_actions (action_group, ephy_toolbar_popups,
+                                     ephy_toolbar_popups_n_entries);
+       egg_menu_merge_insert_action_group (t->priv->merge,
action_group, 0);
+


do_merge is called every time there is a toolbar change (yeah, it's more my naming fault
then your). Looks like we should call this in set_merge. Also I think you need to
unref the action_group on finalize.

Thanks a lot for this.

Marco
-- 
Marco Pesenti Gritti <mpgritti@oltrelinux.com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]