]> git.pld-linux.org Git - packages/gnome-panel.git/commitdiff
- updated from ximian to work properly with GNOME 2.6
authorgrzegol <grzegol@pld-linux.org>
Sat, 27 Mar 2004 00:05:30 +0000 (00:05 +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.6

gnome-panel-menu-stripe.patch

index 636a45b8b39c67ef5f542383924656e49c92951f..92598cbc9c552c8cb05575805b8db7305b81935d 100644 (file)
@@ -1,6 +1,6 @@
-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
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/Makefile.am gnome-panel-2.6.0/gnome-panel/Makefile.am
+--- aa/gnome-panel-2.6.0/gnome-panel/Makefile.am       2004-02-06 17:04:50.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/Makefile.am  2004-03-27 00:29:00.520061944 +0100
 @@ -80,6 +80,8 @@
        panel-typebuiltins.h    \
        panel-marshal.c         \
@@ -10,9 +10,9 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/Makefile.am gnome-panel-2.5.92/gnome
        main.c                  \
        panel-widget.c          \
        button-widget.c         \
-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
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/menu.c gnome-panel-2.6.0/gnome-panel/menu.c
+--- aa/gnome-panel-2.6.0/gnome-panel/menu.c    2004-03-09 11:08:47.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/menu.c       2004-03-27 00:29:00.522061640 +0100
 @@ -44,6 +44,7 @@
  #include "menu-fentry.h"
  #include "menu-util.h"
@@ -104,9 +104,9 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/menu.c gnome-panel-2.5.92/gnome-pane
  
        g_object_set_data (G_OBJECT (root_menu), "menu_panel", panel);
  
-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
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.c gnome-panel-2.6.0/gnome-panel/panel-config-global.c
+--- aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.c     2004-01-18 15:35:47.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/panel-config-global.c        2004-03-27 00:29:00.523061488 +0100
 @@ -45,6 +45,7 @@
        guint               drawer_auto_close : 1;
        guint               confirm_panel_remove : 1;
@@ -141,9 +141,9 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-config-global.c gnome-panel-2.
  }
  
  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
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.h gnome-panel-2.6.0/gnome-panel/panel-config-global.h
+--- aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.h     2004-01-18 15:32:28.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/panel-config-global.h        2004-03-27 00:29:00.523061488 +0100
 @@ -37,6 +37,7 @@
  gboolean panel_global_config_get_drawer_auto_close    (void);
  gboolean panel_global_config_get_tooltips_enabled     (void);
@@ -152,9 +152,9 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-config-global.h gnome-panel-2.
  
  G_END_DECLS
  
-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
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in
+--- aa/gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in   2004-01-18 16:10:23.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in      2004-03-27 00:29:00.588051608 +0100
 @@ -93,6 +93,18 @@
        </schema>
  
@@ -174,10 +174,10 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-global.schemas.in gnome-panel-
          <key>/schemas/apps/panel/global/enable_key_bindings</key>
          <applyto>/apps/panel/global/enable_key_bindings</applyto>
          <owner>panel</owner>
-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 @@
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-menu.c gnome-panel-2.6.0/gnome-panel/panel-menu.c
+--- aa/gnome-panel-2.6.0/gnome-panel/panel-menu.c      1970-01-01 01:00:00.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/panel-menu.c 2004-03-27 00:49:47.929426896 +0100
+@@ -0,0 +1,1082 @@
 +/*
 + * To set this up insert something like this in your ~/.gtkrc-2.0
 + *
@@ -477,10 +477,24 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +/* end metacity cut and paste */
 +
 +/* begin gtkmenu.c cut and paste */
-+
++#define MENU_SCROLL_STEP1 8
++#define MENU_SCROLL_STEP2 15
 +#define MENU_SCROLL_ARROW_HEIGHT 16
++#define MENU_SCROLL_FAST_ZONE 8
++#define MENU_SCROLL_TIMEOUT1 50
++#define MENU_SCROLL_TIMEOUT2 50
++
++#define ATTACH_INFO_KEY "gtk-menu-child-attach-info-key"
 +
++typedef struct _GtkMenuAttachData     GtkMenuAttachData;
 +typedef struct _GtkMenuPrivate        GtkMenuPrivate;
++
++struct _GtkMenuAttachData
++{
++      GtkWidget *attach_widget;
++      GtkMenuDetachFunc detacher;
++};
++
 +struct _GtkMenuPrivate 
 +{
 +  gboolean have_position;
@@ -488,15 +502,29 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +  gint y;
 +
 +  /* info used for the table */
-+  guint rows;
-+  guint columns;
-+
 +  guint *heights;
 +  gint heights_length;
 +
 +  gint monitor_num;
++
++      /* Cached layout information */
++      gboolean have_layout;
++      gint n_rows;
++      gint n_columns;
 +};
 +
++typedef struct
++{
++      gint left_attach;
++      gint right_attach;
++      gint top_attach;
++      gint bottom_attach;
++      gint effective_left_attach;
++      gint effective_right_attach;
++      gint effective_top_attach;
++      gint effective_bottom_attach;
++} AttachInfo;
++
 +static void
 +gtk_menu_free_private (gpointer data)
 +{
@@ -648,6 +676,159 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +  menu->scroll_offset = offset;
 +}
 +
++static AttachInfo *
++get_attach_info (GtkWidget *child)
++{
++      GObject *object = G_OBJECT (child);
++      AttachInfo *ai = g_object_get_data (object, ATTACH_INFO_KEY);
++
++      if (!ai)
++      {
++              ai = g_new0 (AttachInfo, 1);
++              g_object_set_data_full (object, ATTACH_INFO_KEY, ai, g_free);
++      }
++
++      return ai;
++}
++
++static gboolean
++is_grid_attached (AttachInfo *ai)
++{
++      return (ai->left_attach >= 0 &&
++                      ai->right_attach >= 0 &&
++                      ai->top_attach >= 0 &&
++                      ai->bottom_attach >= 0);
++}
++
++static void
++menu_ensure_layout (GtkMenu *menu)
++{
++      GtkMenuPrivate *priv = gtk_menu_get_private (menu);
++
++      if (!priv->have_layout)
++      {
++              GtkMenuShell *menu_shell = GTK_MENU_SHELL (menu);
++              GList *l;
++              gchar *row_occupied;
++              gint current_row;
++              gint max_right_attach;
++              gint max_bottom_attach;
++
++              /* Find extents of gridded portion */
++              max_right_attach = 1;
++              max_bottom_attach = 0;
++
++              for (l = menu_shell->children; l; l = l->next)
++              {
++                      GtkWidget *child = l->data;
++                      AttachInfo *ai = get_attach_info (child);
++
++                      if (is_grid_attached (ai))
++                      {
++                              max_bottom_attach = MAX (max_bottom_attach, ai->bottom_attach);
++                              max_right_attach = MAX (max_right_attach, ai->right_attach);
++                      }
++              }
++
++              /* Find empty rows */
++              row_occupied = g_malloc0 (max_bottom_attach);
++
++              for (l = menu_shell->children; l; l = l->next)
++              {
++                      GtkWidget *child = l->data;
++                      AttachInfo *ai = get_attach_info (child);
++
++                      if (is_grid_attached (ai))
++                      {
++                              gint i;
++
++                              for (i = ai->top_attach; i < ai->bottom_attach; i++)
++                                      row_occupied[i] = TRUE;
++                      }
++              }
++
++              /* Lay non-grid-items out in those rows */
++              current_row = 0;
++              for (l = menu_shell->children; l; l = l->next)
++              {
++                      GtkWidget *child = l->data;
++                      AttachInfo *ai = get_attach_info (child);
++
++                      if (!is_grid_attached (ai))
++                      {
++                              while (current_row < max_bottom_attach && row_occupied[current_row])
++                                      current_row++;
++
++                              ai->effective_left_attach = 0;
++                              ai->effective_right_attach = max_right_attach;
++                              ai->effective_top_attach = current_row;
++                              ai->effective_bottom_attach = current_row + 1;
++
++                              current_row++;
++                      }
++                      else
++                      {
++                              ai->effective_left_attach = ai->left_attach;
++                              ai->effective_right_attach = ai->right_attach;
++                              ai->effective_top_attach = ai->top_attach;
++                              ai->effective_bottom_attach = ai->bottom_attach;
++                      }
++              }
++
++              g_free (row_occupied);
++
++              priv->n_rows = MAX (current_row, max_bottom_attach);
++              priv->n_columns = max_right_attach;
++              priv->have_layout = TRUE;
++      }
++}
++
++
++static gint
++gtk_menu_get_n_columns (GtkMenu *menu)
++{
++      GtkMenuPrivate *priv = gtk_menu_get_private (menu);
++
++      menu_ensure_layout (menu);
++
++      return priv->n_columns;
++}
++
++static gint
++gtk_menu_get_n_rows (GtkMenu *menu)
++{
++      GtkMenuPrivate *priv = gtk_menu_get_private (menu);
++
++      menu_ensure_layout (menu);
++
++      return priv->n_rows;
++}
++
++static void
++get_effective_child_attach (GtkWidget *child,
++              int       *l,
++              int       *r,
++              int       *t,
++              int       *b)
++{
++      GtkMenu *menu = GTK_MENU (child->parent);
++      AttachInfo *ai;
++
++      menu_ensure_layout (menu);
++
++      ai = get_attach_info (child);
++
++      if (l)
++              *l = ai->effective_left_attach;
++      if (r)
++              *r = ai->effective_right_attach;
++      if (t)
++              *t = ai->effective_top_attach;
++      if (b)
++              *b = ai->effective_bottom_attach;
++
++}
++
 +static void
 +gtk_menu_set_tearoff_hints (GtkMenu *menu,
 +                          gint     width)
@@ -676,21 +857,6 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +}
 +
 +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
 +gtk_menu_size_allocate (GtkWidget     *widget,
 +                      GtkAllocation *allocation)
 +{
@@ -766,9 +932,9 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +    {
 +/* inserted for panel-menu.c */
 +#if 0
-+      gint base_width = width / priv->columns;
++      gint base_width = width / gtk_menu_get_n_columns (menu);
 +#else
-+      gint base_width = (width - menu_stripe_width) / priv->columns;
++      gint base_width = (width - menu_stripe_width) / gtk_menu_get_n_columns (menu);
 +#endif
 +/* end panel-menu.c */
 +
@@ -783,13 +949,13 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +              gint i;
 +            guint l, r, t, b;
 +
-+              get_child_attach (child, &l, &r, &t, &b);
++              get_effective_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;
++                  tmp = gtk_menu_get_n_columns (menu) - l;
++                  l = gtk_menu_get_n_columns (menu) - r;
 +                  r = tmp;
 +                }
 +
@@ -855,14 +1021,14 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +          gint width, height;
 +
 +          height = 0;
-+          for (i = 0; i < priv->rows; i++)
++          for (i = 0; i < gtk_menu_get_n_rows (menu); i++)
 +            height += priv->heights[i];
 +
 +/* inserted for panel-menu.c */
 +#if 0
-+          width = priv->columns * base_width;
++          width = gtk_menu_get_n_columns (menu) * base_width;
 +#else
-+          width = priv->columns * base_width + menu_stripe_width;
++          width = gtk_menu_get_n_columns (menu) * base_width + menu_stripe_width;
 +#endif
 +/* end panel-menu.c */
 +
@@ -1094,9 +1260,9 @@ diff -urN aa/gnome-panel-2.5.92/gnome-panel/panel-menu.c gnome-panel-2.5.92/gnom
 +              GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
 +              GDK_POINTER_MOTION_MASK);
 +}
-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
+diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-menu.h gnome-panel-2.6.0/gnome-panel/panel-menu.h
+--- aa/gnome-panel-2.6.0/gnome-panel/panel-menu.h      1970-01-01 01:00:00.000000000 +0100
++++ gnome-panel-2.6.0/gnome-panel/panel-menu.h 2004-03-27 00:29:00.640043704 +0100
 @@ -0,0 +1,31 @@
 +#include <gtk/gtkmenu.h>
 +#include <gtk/gtkimage.h>
This page took 1.662734 seconds and 4 git commands to generate.