Re: gtkmenu.c - attachment issues ...
- From: Alexander Larsson <alexl redhat com>
- To: Matthias Clasen <maclas gmx de>
- Cc: Michael Meeks <michael ximian com>, "gtk-devel-list gnome org" <gtk-devel-list gnome org>
- Subject: Re: gtkmenu.c - attachment issues ...
- Date: 22 Jan 2004 15:22:18 +0100
On Thu, 2004-01-22 at 13:52, Matthias Clasen wrote:
> Ouch, appears there is a simple thinko in my version of Michaels
> gtk_menu_do_remove(). I'm setting priv->columns to zero before the loop in
> order to recalculate it, yet expect to check priv->columns == 1 in order to
> recognize regular menus in the loop. You could try
> to insert
>
> gboolean single_column = priv->columns == 1 ? TRUE : FALSE;
>
> before the resetting of priv->columns, and replace the priv->columns == 1
> check by
>
> single_column
>
> and see if that fixes it for you.
I tried the attached patch, and it didn't help.
If you have nautilus built this is easy to test, just switch to a
different view (e.g. list view) and see if all separators and some other
items in the menus get reordered.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson Red Hat, Inc
alexl redhat com alla lysator liu se
He's a sword-wielding amnesiac grifter with a robot buddy named Sparky. She's
a cold-hearted tomboy femme fatale from Mars. They fight crime!
Index: gtkmenu.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenu.c,v
retrieving revision 1.155
diff -u -p -r1.155 gtkmenu.c
--- gtkmenu.c 20 Jan 2004 21:11:30 -0000 1.155
+++ gtkmenu.c 22 Jan 2004 14:20:49 -0000
@@ -941,10 +941,12 @@ gtk_menu_do_remove (GtkMenuShell *menu_s
GList *children;
GtkMenuPrivate *priv;
gint delta;
-
+ gboolean single_column;
+
ai = get_attach_info (G_OBJECT (child));
priv = gtk_menu_get_private (GTK_MENU (menu_shell));
delta = ai->bottom_attach - ai->top_attach;
+ single_column = priv->columns == 1 ? TRUE : FALSE;
/* recalculate these, assuming the child has already been removed */
priv->rows = 0;
@@ -955,7 +957,7 @@ gtk_menu_do_remove (GtkMenuShell *menu_s
AttachInfo *child_ai = get_attach_info (children->data);
/* Do not move items in table menus */
- if (priv->columns == 1 && child_ai->bottom_attach > ai->bottom_attach)
+ if (single_column && child_ai->bottom_attach > ai->bottom_attach)
gtk_container_child_set (GTK_CONTAINER (menu_shell), children->data,
"top_attach", child_ai->top_attach - delta,
"bottom_attach", child_ai->bottom_attach - delta,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]