]> git.pld-linux.org Git - packages/gnome-panel.git/commitdiff
- merged from DEVEL, but it doesn't work for now
authorgrzegol <grzegol@pld-linux.org>
Tue, 23 Mar 2004 01:40:58 +0000 (01:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gnome-panel-menu-stripe.patch -> 1.5

gnome-panel-menu-stripe.patch

index 3843f4f6d6dc9e920fbe1b2ef051b510acf8351e..636a45b8b39c67ef5f542383924656e49c92951f 100644 (file)
@@ -1,7 +1,7 @@
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/Makefile.am gnome-panel-2.4.2/gnome-panel/Makefile.am
---- gnome-panel-2.4.2.orig/gnome-panel/Makefile.am     2004-01-15 13:45:58.000000000 +0100
-+++ gnome-panel-2.4.2/gnome-panel/Makefile.am  2004-03-22 23:54:13.738819800 +0100
-@@ -89,6 +89,8 @@
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/Makefile.am gnome-panel-2.5.92/gnome-panel/Makefile.am
+--- aa/gnome-panel-2.5.92/gnome-panel/Makefile.am      2004-02-06 17:04:50.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/Makefile.am 2004-03-12 14:24:21.791325944 +0100
+@@ -80,6 +80,8 @@
        panel-typebuiltins.h    \
        panel-marshal.c         \
        panel-marshal.h         \
@@ -10,9 +10,9 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/Makefile.am gnome-panel-2.4.2/gno
        main.c                  \
        panel-widget.c          \
        button-widget.c         \
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-panel/menu.c
---- gnome-panel-2.4.2.orig/gnome-panel/menu.c  2003-10-14 12:46:30.000000000 +0200
-+++ gnome-panel-2.4.2/gnome-panel/menu.c       2004-03-22 23:54:13.740819496 +0100
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/menu.c gnome-panel-2.5.92/gnome-panel/menu.c
+--- aa/gnome-panel-2.5.92/gnome-panel/menu.c   2004-03-09 11:08:47.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/menu.c      2004-03-12 14:24:21.795325336 +0100
 @@ -44,6 +44,7 @@
  #include "menu-fentry.h"
  #include "menu-util.h"
@@ -22,14 +22,14 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
  #include "panel-gconf.h"
  #include "panel.h"
 @@ -67,6 +68,7 @@
- #include "panel-run-dialog.h"
+ #include "panel-lockdown.h"
  
  #undef MENU_DEBUG
 +#define MENU_SNAP_LENGTH 10
  
  static char *gnome_folder = NULL;
  
-@@ -610,6 +612,9 @@
+@@ -614,6 +616,9 @@
        if (repo->orig_func != NULL) {
                repo->orig_func (menu, x, y, push_in, repo->orig_data);
  
@@ -39,7 +39,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
                if (menu->parent_menu_item != NULL) {
                        /* This is a submenu so behave submenuish */
                        if (*x < monitor_basex ||
-@@ -705,8 +710,8 @@
+@@ -709,8 +714,8 @@
        reload_image_menu_items ();
  }
  
@@ -50,7 +50,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
  {
        GtkWidget       *retval;
        static gboolean  registered_icon_theme_changer = FALSE;
-@@ -718,8 +723,7 @@
+@@ -722,8 +727,7 @@
                                  G_CALLBACK (icon_theme_changed), NULL);
        }
        
@@ -60,7 +60,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
        panel_gconf_notify_add_while_alive ("/desktop/gnome/interface/menus_have_icons",
                                            (GConfClientNotifyFunc) menus_have_icons_changed,
                                            G_OBJECT (retval));
-@@ -735,12 +739,18 @@
+@@ -739,12 +743,18 @@
        return retval;
  }
  
@@ -81,7 +81,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
  
        g_signal_connect (
                retval, "show", G_CALLBACK (setup_menu_panel), NULL);
-@@ -748,6 +758,13 @@
+@@ -752,6 +762,13 @@
        return retval;
  }
  
@@ -95,7 +95,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
  static void
  icon_to_load_free (IconToLoad *icon)
  {
-@@ -3316,7 +3333,7 @@
+@@ -3314,7 +3331,7 @@
        }
  
        if (!root_menu)
@@ -104,9 +104,9 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/menu.c gnome-panel-2.4.2/gnome-pa
  
        g_object_set_data (G_OBJECT (root_menu), "menu_panel", panel);
  
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-config-global.c gnome-panel-2.4.2/gnome-panel/panel-config-global.c
---- gnome-panel-2.4.2.orig/gnome-panel/panel-config-global.c   2003-03-05 02:11:34.000000000 +0100
-+++ gnome-panel-2.4.2/gnome-panel/panel-config-global.c        2004-03-22 23:54:13.741819344 +0100
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-config-global.c gnome-panel-2.5.92/gnome-panel/panel-config-global.c
+--- aa/gnome-panel-2.5.92/gnome-panel/panel-config-global.c    2004-01-18 15:35:47.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/panel-config-global.c       2004-03-12 14:24:21.795325336 +0100
 @@ -45,6 +45,7 @@
        guint               drawer_auto_close : 1;
        guint               confirm_panel_remove : 1;
@@ -129,19 +129,21 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-config-global.c gnome-panel
  
  static void
  panel_global_config_set_entry (GConfEntry *entry)
-@@ -152,6 +160,9 @@
+@@ -151,6 +159,11 @@
+       else if (strcmp (key, "highlight_launchers_on_mouseover") == 0)
                global_config.highlight_when_over =
                        gconf_value_get_bool (value);
++
++  else if (strcmp (key, "show_menu_stripe") == 0)
++    global_config.menu_stripe =
++        gconf_value_get_bool (value);
++
+ }
  
-+      else if (strcmp (key, "show_menu_stripe") == 0)
-+              global_config.menu_stripe =
-+                              gconf_value_get_bool (value);
- #if 0
-       else
-               g_warning ("%s not handled", key);
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-config-global.h gnome-panel-2.4.2/gnome-panel/panel-config-global.h
---- gnome-panel-2.4.2.orig/gnome-panel/panel-config-global.h   2003-03-05 02:11:34.000000000 +0100
-+++ gnome-panel-2.4.2/gnome-panel/panel-config-global.h        2004-03-22 23:54:13.741819344 +0100
+ static void
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-config-global.h gnome-panel-2.5.92/gnome-panel/panel-config-global.h
+--- aa/gnome-panel-2.5.92/gnome-panel/panel-config-global.h    2004-01-18 15:32:28.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/panel-config-global.h       2004-03-12 14:24:21.796325184 +0100
 @@ -37,6 +37,7 @@
  gboolean panel_global_config_get_drawer_auto_close    (void);
  gboolean panel_global_config_get_tooltips_enabled     (void);
@@ -150,9 +152,9 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-config-global.h gnome-panel
  
  G_END_DECLS
  
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-global.schemas.in gnome-panel-2.4.2/gnome-panel/panel-global.schemas.in
---- gnome-panel-2.4.2.orig/gnome-panel/panel-global.schemas.in 2003-07-07 15:27:58.000000000 +0200
-+++ gnome-panel-2.4.2/gnome-panel/panel-global.schemas.in      2004-03-22 23:54:13.742819192 +0100
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-global.schemas.in gnome-panel-2.5.92/gnome-panel/panel-global.schemas.in
+--- aa/gnome-panel-2.5.92/gnome-panel/panel-global.schemas.in  2004-01-18 16:10:23.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/panel-global.schemas.in     2004-03-12 14:24:21.797325032 +0100
 @@ -93,6 +93,18 @@
        </schema>
  
@@ -172,17 +174,17 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-global.schemas.in gnome-pan
          <key>/schemas/apps/panel/global/enable_key_bindings</key>
          <applyto>/apps/panel/global/enable_key_bindings</applyto>
          <owner>panel</owner>
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gnome-panel/panel-menu.c
---- gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c    1970-01-01 01:00:00.000000000 +0100
-+++ gnome-panel-2.4.2/gnome-panel/panel-menu.c 2004-03-22 23:52:53.000000000 +0100
-@@ -0,0 +1,813 @@
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnome-panel/panel-menu.c
+--- aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c     1970-01-01 01:00:00.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/panel-menu.c        2004-03-12 14:39:15.063527928 +0100
+@@ -0,0 +1,916 @@
 +/*
 + * To set this up insert something like this in your ~/.gtkrc-2.0
 + *
-+ * Copyright (C) 2003 Marcin Krzy¿anowski
 + * Copyright (C) 2002 Ximian, Inc. 
 + * Copyright (C) 2001 Havoc Pennington
 + * Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
++ * Copyright (C) 2003 Marcin Krzy¿anowski
 + * 
 + * style "default"
 + * {
@@ -194,8 +196,9 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 + * Authors:
 + *       Thomas, Michael Meeks
 + *       GtkMenu code by the GTK+ team
-+ *       Gradient code from WindowMaker by Dan Pascu and Alfredo Kojima, by way of metacity by Havoc Pennington.
-+ *     Marcin Krzy¿anowski
++ *       Gradient code from WindowMaker by Dan Pascu and Alfredo Kojima, 
++ *         by way of metacity by Havoc Pennington.
++ *       Marcin Krzy¿anowski
 + */
 +#include <config.h>
 +#include <string.h>
@@ -231,13 +234,8 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +       GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
 +
 +       if (panel_global_config_get_menu_stripe () && pm->side_image != NULL)
-+       {
 +               requisition->width += gdk_pixbuf_get_width (pm->side_image)
 +                     + gtk_widget_get_style (widget)->xthickness;
-+                     
-+          if (pm->height > 0)
-+             requisition->height = pm->height + 2 * (GTK_CONTAINER (widget)->border_width + widget->style->ythickness);
-+       }
 +}
 +
 +static GdkColor *
@@ -331,7 +329,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +       if (widget->allocation.height >= gdk_pixbuf_get_height (pm->side_image)) {
 +             if (gdk_rectangle_intersect (&event->area,
 +                                          &position,
-+                                          &exposed))  {
++                                          &exposed)) {
 +                     gdk_pixbuf_render_to_drawable (
 +                             pm->side_image, window,
 +                             widget->style->black_gc,
@@ -345,10 +343,6 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +       }
 +               
 +       position = widget->allocation;
-+/*     g_print("position.height %d, gdk_pixbuf_get_height (pm->side_image) %d\n",position.height,gdk_pixbuf_get_height (pm->side_image));
-+       g_print("exposed.y - position.y %d\n",exposed.y - position.y);
-+       g_print("exposed.y = %d, position.y = %d\n",exposed.y,position.y);
-+*/
 +       if (position.height != gdk_pixbuf_get_height (pm->side_image)) {
 +               position.width = gdk_pixbuf_get_width (pm->side_image);
 +             if (position.height > gdk_pixbuf_get_height (pm->side_image)) {
@@ -359,30 +353,6 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +             
 +               if (pm->scaled_image && gdk_rectangle_intersect (&event->area,
 +                                                              &position,
-+                                                              &exposed) && (exposed.y - position.y + exposed.height > gdk_pixbuf_get_height (pm->scaled_image))) {
-+      
-+                       gdk_draw_pixbuf (window,
-+                               widget->style->black_gc,
-+                               pm->scaled_image, 
-+                               exposed.x - position.x,
-+                               exposed.y - position.y,
-+                               exposed.x, exposed.y,
-+                               exposed.width, exposed.height,
-+                               GDK_RGB_DITHER_NORMAL,
-+                               exposed.x, exposed.y);
-+               }
-+       }
-+
-+/*       if (position.height != gdk_pixbuf_get_height (pm->side_image)) {
-+               position.width = gdk_pixbuf_get_width (pm->side_image);
-+             if (position.height > gdk_pixbuf_get_height (pm->side_image)) {
-+                     position.height = bin_height - gdk_pixbuf_get_height (pm->side_image);
-+             } else {
-+                     position.height = bin_height;
-+             }
-+             
-+               if (pm->scaled_image && gdk_rectangle_intersect (&event->area,
-+                                                              &position,
 +                                                              &exposed)) {
 +      
 +                       gdk_pixbuf_render_to_drawable (
@@ -396,7 +366,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +                               exposed.x, exposed.y);
 +               }
 +       }
-+*/
++
 +       return TRUE;
 +}
 +
@@ -414,7 +384,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +  int rowstride;
 +
 +  g_return_val_if_fail (width > 0, NULL);
-+  if (height <= 0) return NULL;
++  g_return_val_if_fail (height > 0, NULL);
 +
 +  if (no_padding)
 +    rowstride = width * 3;
@@ -510,8 +480,58 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +
 +#define MENU_SCROLL_ARROW_HEIGHT 16
 +
++typedef struct _GtkMenuPrivate        GtkMenuPrivate;
++struct _GtkMenuPrivate 
++{
++  gboolean have_position;
++  gint x;
++  gint y;
++
++  /* info used for the table */
++  guint rows;
++  guint columns;
++
++  guint *heights;
++  gint heights_length;
++
++  gint monitor_num;
++};
++
 +static void
-+gtk_menu_stop_scrolling (GtkMenu *menu)
++gtk_menu_free_private (gpointer data)
++{
++  GtkMenuPrivate *priv = (GtkMenuPrivate *)data;
++
++  g_free (priv->heights);
++
++  g_free (priv);
++}
++
++static GtkMenuPrivate *
++gtk_menu_get_private (GtkMenu *menu)
++{
++  GtkMenuPrivate *private;
++  static GQuark private_quark = 0;
++
++  if (!private_quark)
++    private_quark = g_quark_from_static_string ("gtk-menu-private");
++
++  private = g_object_get_qdata (G_OBJECT (menu), private_quark);
++
++  if (!private)
++    {
++      private = g_new0 (GtkMenuPrivate, 1);
++      private->have_position = FALSE;
++      
++      g_object_set_qdata_full (G_OBJECT (menu), private_quark,
++                             private, gtk_menu_free_private);
++    }
++
++  return private;
++}
++
++static void
++gtk_menu_remove_scroll_timeout (GtkMenu *menu)
 +{
 +  if (menu->timeout_id)
 +    {
@@ -521,6 +541,15 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +}
 +
 +static void
++gtk_menu_stop_scrolling (GtkMenu *menu)
++{
++  gtk_menu_remove_scroll_timeout (menu);
++
++  menu->upper_arrow_prelight = FALSE;
++  menu->lower_arrow_prelight = FALSE;
++}
++
++static void
 +gtk_menu_scroll_to (GtkMenu *menu,
 +                  gint    offset)
 +{
@@ -530,6 +559,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +  gint border_width;
 +  gboolean last_visible;
 +  gint menu_height;
++  guint vertical_padding;
 +
 +  widget = GTK_WIDGET (menu);
 +
@@ -537,7 +567,9 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +      menu->tearoff_adjustment &&
 +      (menu->tearoff_adjustment->value != offset))
 +    {
-+      menu->tearoff_adjustment->value = offset;
++      menu->tearoff_adjustment->value =
++      CLAMP (offset,
++             0, menu->tearoff_adjustment->upper - menu->tearoff_adjustment->page_size);
 +      gtk_adjustment_value_changed (menu->tearoff_adjustment);
 +    }
 +  
@@ -545,24 +577,23 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +  view_width = widget->allocation.width;
 +  view_height = widget->allocation.height;
 +
++  gtk_widget_style_get (GTK_WIDGET (menu),
++                      "vertical-padding", &vertical_padding,
++                      NULL);
++  
 +  border_width = GTK_CONTAINER (menu)->border_width;
 +  view_width -= (border_width + widget->style->xthickness) * 2;
-+  view_height -= (border_width + widget->style->ythickness) * 2;
-+  menu_height = widget->requisition.height - (border_width + widget->style->ythickness) * 2;
-+
-+  offset = CLAMP (offset, 0, menu_height - view_height);
-+
-+  /* Scroll the menu: */
-+  if (GTK_WIDGET_REALIZED (menu))
-+    gdk_window_move (menu->bin_window, 0, -offset);
++  view_height -= (border_width + widget->style->ythickness + vertical_padding) * 2;
++  menu_height = widget->requisition.height -
++      (border_width + widget->style->ythickness + vertical_padding) * 2;
 +
 +  x = border_width + widget->style->xthickness;
-+  y = border_width + widget->style->ythickness;
-+  
++  y = border_width + widget->style->ythickness + vertical_padding;
++
 +  if (!menu->tearoff_active)
 +    {
 +      last_visible = menu->upper_arrow_visible;
-+      menu->upper_arrow_visible = (offset > 0);
++      menu->upper_arrow_visible = offset > 0;
 +      
 +      if (menu->upper_arrow_visible)
 +      view_height -= MENU_SCROLL_ARROW_HEIGHT;
@@ -574,11 +605,14 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +        
 +        /* If we hid the upper arrow, possibly remove timeout */
 +        if (menu->scroll_step < 0)
-+          gtk_menu_stop_scrolling (menu);
++          {
++            gtk_menu_stop_scrolling (menu);
++            gtk_widget_queue_draw (GTK_WIDGET (menu));
++          }
 +      }
-+      
++
 +      last_visible = menu->lower_arrow_visible;
-+      menu->lower_arrow_visible = (view_height + offset < menu_height);
++      menu->lower_arrow_visible = offset < menu_height - view_height;
 +      
 +      if (menu->lower_arrow_visible)
 +      view_height -= MENU_SCROLL_ARROW_HEIGHT;
@@ -590,13 +624,20 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +        
 +        /* If we hid the lower arrow, possibly remove timeout */
 +        if (menu->scroll_step > 0)
-+          gtk_menu_stop_scrolling (menu);
++          {
++            gtk_menu_stop_scrolling (menu);
++            gtk_widget_queue_draw (GTK_WIDGET (menu));
++          }
 +      }
 +      
 +      if (menu->upper_arrow_visible)
 +      y += MENU_SCROLL_ARROW_HEIGHT;
 +    }
 +
++  /* Scroll the menu: */
++  if (GTK_WIDGET_REALIZED (menu))
++    gdk_window_move (menu->bin_window, 0, -offset);
++
 +  if (GTK_WIDGET_REALIZED (menu))
 +    gdk_window_move_resize (menu->view_window,
 +                          x,
@@ -609,10 +650,10 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +
 +static void
 +gtk_menu_set_tearoff_hints (GtkMenu *menu,
-+                            gint     width)
++                          gint     width)
 +{
 +  GdkGeometry geometry_hints;
-+
++  
 +  if (!menu->tearoff_window)
 +    return;
 +
@@ -624,14 +665,29 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +
 +  geometry_hints.min_width = width;
 +  geometry_hints.max_width = width;
-+
++    
 +  geometry_hints.min_height = 0;
 +  geometry_hints.max_height = GTK_WIDGET (menu)->requisition.height;
 +
 +  gtk_window_set_geometry_hints (GTK_WINDOW (menu->tearoff_window),
-+                                 NULL,
-+                                 &geometry_hints,
-+                                 GDK_HINT_MAX_SIZE|GDK_HINT_MIN_SIZE);
++                               NULL,
++                               &geometry_hints,
++                               GDK_HINT_MAX_SIZE|GDK_HINT_MIN_SIZE);
++}
++
++static void
++get_child_attach (GtkWidget *child,
++                  gint      *l,
++                  gint      *r,
++                  gint      *t,
++                  gint      *b)
++{
++  gtk_container_child_get (GTK_CONTAINER (child->parent), child,
++                           "left_attach", l,
++                           "right_attach", r,
++                           "top_attach", t,
++                           "bottom_attach", b,
++                           NULL);
 +}
 +
 +static void
@@ -642,23 +698,39 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +  GtkMenuShell *menu_shell;
 +  GtkWidget *child;
 +  GtkAllocation child_allocation;
++  GtkRequisition child_requisition;
++  GtkMenuPrivate *priv;
 +  GList *children;
 +  gint x, y;
 +  gint width, height;
++  guint vertical_padding;
++  guint menu_stripe_width;
 +
 +  g_return_if_fail (GTK_IS_MENU (widget));
 +  g_return_if_fail (allocation != NULL);
 +  
 +  menu = GTK_MENU (widget);
 +  menu_shell = GTK_MENU_SHELL (widget);
-+
++  priv = gtk_menu_get_private (menu);
++ 
 +  widget->allocation = *allocation;
++  gtk_widget_get_child_requisition (GTK_WIDGET (menu), &child_requisition);
 +
-+  x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness;
-+  y = GTK_CONTAINER (menu)->border_width + widget->style->ythickness;
++  gtk_widget_style_get (GTK_WIDGET (menu),
++                      "vertical-padding", &vertical_padding,
++                      NULL);
 +  
++  x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness;
++  y = GTK_CONTAINER (menu)->border_width + widget->style->ythickness + vertical_padding;
++
 +  width = MAX (1, allocation->width - x * 2);
 +  height = MAX (1, allocation->height - y * 2);
++
++  child_requisition.width -= x * 2;
++  child_requisition.height -= y * 2;
++
++  if (menu_shell->active)
++    gtk_menu_scroll_to (menu, menu->scroll_offset);
 +  
 +  if (menu->upper_arrow_visible && !menu->tearoff_active)
 +    {
@@ -669,7 +741,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +  if (menu->lower_arrow_visible && !menu->tearoff_active)
 +    height -= MENU_SCROLL_ARROW_HEIGHT;
 +  
-+/*  if (GTK_WIDGET_REALIZED (widget))
++  if (GTK_WIDGET_REALIZED (widget))
 +    {
 +      gdk_window_move_resize (widget->window,
 +                            allocation->x, allocation->y,
@@ -681,40 +753,74 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +                            width,
 +                            height);
 +    }
-+*/
-+  if (menu_shell->children)
-+    {
-+      child_allocation.x = 0;
-+      child_allocation.y = 0;
-+      child_allocation.width = width;
 +
 +/* inserted for panel-menu.c */
-+      if (panel_global_config_get_menu_stripe () && PANEL_MENU (widget)->side_image) 
-+      {
-+        child_allocation.x = gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image) + gtk_widget_get_style (widget)->xthickness;
-+      }
++  if (panel_global_config_get_menu_stripe () && PANEL_MENU (widget)->side_image) {
++    menu_stripe_width = gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image) + gtk_widget_get_style (widget)->xthickness;
++  } else {
++    menu_stripe_width = 0;
++  }
++/* end panel-menu.c */
 +
-+      child_allocation.width = width - child_allocation.x;
++  if (menu_shell->children)
++    {
++/* inserted for panel-menu.c */
++#if 0
++      gint base_width = width / priv->columns;
++#else
++      gint base_width = (width - menu_stripe_width) / priv->columns;
++#endif
 +/* end panel-menu.c */
-+      
++
 +      children = menu_shell->children;
 +      while (children)
 +      {
 +        child = children->data;
 +        children = children->next;
-+        
++
 +        if (GTK_WIDGET_VISIBLE (child))
 +          {
-+            GtkRequisition child_requisition;
-+            gtk_widget_get_child_requisition (child, &child_requisition);
-+            
-+            child_allocation.height = child_requisition.height;
++              gint i;
++            guint l, r, t, b;
++
++              get_child_attach (child, &l, &r, &t, &b);
++
++              if (gtk_widget_get_direction (GTK_WIDGET (menu)) == GTK_TEXT_DIR_RTL)
++                {
++                  guint tmp;
++                  tmp = priv->columns - l;
++                  l = priv->columns - r;
++                  r = tmp;
++                }
++
++              child_allocation.width = (r - l) * base_width;
++              child_allocation.height = 0;
++/* inserted for panel-menu.c */
++#if 0
++              child_allocation.x = l * base_width;
++#else
++              child_allocation.x = l * base_width + menu_stripe_width;
++#endif
++              child_allocation.y = 0;
++
++              for (i = 0; i < b; i++)
++                {
++                  if (i < t)
++                    child_allocation.y += priv->heights[i];
++                  else
++                    child_allocation.height += priv->heights[i];
++                }
++
 +
 +            gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
 +                                                menu->toggle_size);
 +
++            gtk_widget_size_allocate (child, &child_allocation);
++
++#if 0
++
 +/* inserted for panel-menu.c */
-+            if (PANEL_MENU (widget)->side_image && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM)) 
++            if (use_menu_stripe && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM)) 
 +              {
 +                /* this is dumb, gtkmenuitem.c uses allocation.width as an absolute point */
 +                child_allocation.width += gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image);
@@ -722,38 +828,46 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +
 +            gtk_widget_size_allocate (child, &child_allocation);
 +
-+            if (PANEL_MENU(widget)->side_image && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM)) 
++            if (use_menu_stripe && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM)) 
 +              {
 +                child_allocation.width -= gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image);
 +              }
++#endif
 +
 +            /* Hack to handle events on the stripe area */
-+            if (GTK_WIDGET_REALIZED (child)) 
++            if (GTK_WIDGET_REALIZED (child) && l == 0
 +              { 
 +                gdk_window_move_resize (GTK_MENU_ITEM (child)->event_window,
 +                                        0, child_allocation.y,
-+                                        allocation->width
++                                        child_allocation.width + child_allocation.x
 +                                        child_allocation.height);
 +              }
-+
 +/* end panel-menu.c */
 +
 +            gtk_widget_queue_draw (child);
-+            
-+            child_allocation.y += child_allocation.height;
 +          }
 +      }
-+      PANEL_MENU(widget)->height = child_allocation.y;
-+
 +      
 +      /* Resize the item window */
 +      if (GTK_WIDGET_REALIZED (widget))
 +      {
-+        gdk_window_resize (menu->bin_window,
-+                           allocation->width,
-+                           child_allocation.y);
-+      }
++          gint i;
++          gint width, height;
 +
++          height = 0;
++          for (i = 0; i < priv->rows; i++)
++            height += priv->heights[i];
++
++/* inserted for panel-menu.c */
++#if 0
++          width = priv->columns * base_width;
++#else
++          width = priv->columns * base_width + menu_stripe_width;
++#endif
++/* end panel-menu.c */
++
++        gdk_window_resize (menu->bin_window, width, height);
++      }
 +
 +      if (menu->tearoff_active)
 +      {
@@ -763,7 +877,6 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +              {
 +                gtk_widget_hide (menu->tearoff_scrollbar);
 +                gtk_menu_set_tearoff_hints (menu, allocation->width);
-+                gtk_widget_set_size_request (menu->tearoff_window, -1, allocation->height);
 +
 +                gtk_menu_scroll_to (menu, 0);
 +              }
@@ -789,7 +902,6 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +              {
 +                gtk_widget_show (menu->tearoff_scrollbar);
 +                gtk_menu_set_tearoff_hints (menu, allocation->width);
-+                gtk_widget_set_size_request (menu->tearoff_window, -1, allocation->height);
 +              }
 +          }
 +      }
@@ -798,34 +910,29 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +
 +  {
 +    PanelMenu *pm = PANEL_MENU (widget);
-+    
-+//    gint scaled_height = height;
-+    gint scaled_height = child_allocation.y;
-+    
++              
++    gint scaled_height = height;
++              
 +    if (pm->side_image && widget->allocation.height > gdk_pixbuf_get_height (pm->side_image)) 
 +      {
 +      scaled_height -= gdk_pixbuf_get_height (pm->side_image);
-+      } 
-+
-+    if (pm->side_image && widget->allocation.height < gdk_pixbuf_get_height (pm->side_image))
++      }
++    
++    if (pm->side_image && widget->allocation.height < gdk_pixbuf_get_height (pm->side_image)) 
 +      {
-+      gint scaled_width = ((scaled_height * gdk_pixbuf_get_width (pm->side_image)) / gdk_pixbuf_get_height (pm->side_image));
++      gint scaled_width = ((scaled_height * gdk_pixbuf_get_width (pm->side_image)) / gdk_pixbuf_get_height (pm->side_image));
 +
 +      if (pm->scaled_image)
 +              gdk_pixbuf_unref(pm->scaled_image);
-+      
-+      if (pm->side_image)
-+      {
-+          pm->scaled_image = gdk_pixbuf_scale_simple (pm->side_image,
++
++      pm->scaled_image = gdk_pixbuf_scale_simple (pm->side_image,
 +                                                  scaled_width,
 +                                                  scaled_height,
 +                                                  GDK_INTERP_BILINEAR); /* maybe HYPER ? */
-+          gdk_pixbuf_unref(pm->side_image);
-+          
-+          pm->side_image = pm->scaled_image;
-+      }
++      gdk_pixbuf_unref(pm->side_image);
++      pm->side_image = pm->scaled_image;
 +      } 
-+    else
++    else 
 +      {
 +      gboolean draw_gradient;
 +      gtk_widget_style_get (GTK_WIDGET (pm),
@@ -866,7 +973,6 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +              g_object_unref (pm->scaled_image);
 +              pm->scaled_image = NULL;
 +      }
-+
 +}
 +
 +static GdkPixbuf *
@@ -904,7 +1010,6 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +      
 +      pm->side_image = get_stripe_image (pm, "default_side_image",
 +                                "pld-desktop-stripe.png");
-+
 +}
 +
 +static void
@@ -989,10 +1094,10 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.c gnome-panel-2.4.2/gn
 +              GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
 +              GDK_POINTER_MOTION_MASK);
 +}
-diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.h gnome-panel-2.4.2/gnome-panel/panel-menu.h
---- gnome-panel-2.4.2.orig/gnome-panel/panel-menu.h    1970-01-01 01:00:00.000000000 +0100
-+++ gnome-panel-2.4.2/gnome-panel/panel-menu.h 2004-03-22 21:43:11.000000000 +0100
-@@ -0,0 +1,32 @@
+diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.h gnome-panel-2.5.92/gnome-panel/panel-menu.h
+--- aa/gnome-panel-2.5.92/gnome-panel/panel-menu.h     1970-01-01 01:00:00.000000000 +0100
++++ gnome-panel-2.5.92/gnome-panel/panel-menu.h        2004-03-12 14:41:46.122563464 +0100
+@@ -0,0 +1,31 @@
 +#include <gtk/gtkmenu.h>
 +#include <gtk/gtkimage.h>
 +
@@ -1012,8 +1117,7 @@ diff -Nuard gnome-panel-2.4.2.orig/gnome-panel/panel-menu.h gnome-panel-2.4.2/gn
 +       GtkMenu parent;
 +
 +       GdkPixbuf *side_image;
-+       GdkPixbuf *scaled_image; 
-+       gint height;
++       GdkPixbuf *scaled_image;
 +
 +      GdkRegion *navigation_region;
 +};
This page took 0.222424 seconds and 4 git commands to generate.