1 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/Makefile.am gnome-panel-2.4.1/gnome-panel/Makefile.am
2 --- gnome-panel-2.4.1.orig/gnome-panel/Makefile.am 2003-09-05 14:35:53.000000000 +0200
3 +++ gnome-panel-2.4.1/gnome-panel/Makefile.am 2003-12-02 22:42:53.000000000 +0100
13 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/menu.c gnome-panel-2.4.1/gnome-panel/menu.c
14 --- gnome-panel-2.4.1.orig/gnome-panel/menu.c 2003-10-14 12:46:30.000000000 +0200
15 +++ gnome-panel-2.4.1/gnome-panel/menu.c 2003-12-02 22:42:53.000000000 +0100
17 #include "menu-fentry.h"
18 #include "menu-util.h"
19 #include "menu-ditem.h"
20 +#include "panel-menu.h"
21 #include "panel-util.h"
22 #include "panel-gconf.h"
25 #include "panel-run-dialog.h"
28 +#define MENU_SNAP_LENGTH 10
30 static char *gnome_folder = NULL;
33 if (repo->orig_func != NULL) {
34 repo->orig_func (menu, x, y, push_in, repo->orig_data);
36 + if (*x < MENU_SNAP_LENGTH)
39 if (menu->parent_menu_item != NULL) {
40 /* This is a submenu so behave submenuish */
41 if (*x < monitor_basex ||
43 reload_image_menu_items ();
47 -panel_create_menu (void)
49 +panel_create_menu_of_type (GType menu_type)
52 static gboolean registered_icon_theme_changer = FALSE;
54 G_CALLBACK (icon_theme_changed), NULL);
57 - retval = gtk_menu_new ();
59 + retval = g_object_new (menu_type, NULL);
60 panel_gconf_notify_add_while_alive ("/desktop/gnome/interface/menus_have_icons",
61 (GConfClientNotifyFunc) menus_have_icons_changed,
68 +panel_create_menu (void)
70 + return panel_create_menu_of_type (gtk_menu_get_type());
75 +menu_new_of_type (GType menu_type)
79 - retval = panel_create_menu ();
80 + retval = panel_create_menu_of_type (menu_type);
83 retval, "show", G_CALLBACK (setup_menu_panel), NULL);
91 + return menu_new_of_type (gtk_menu_get_type ());
96 icon_to_load_free (IconToLoad *icon)
102 - root_menu = menu_new ();
103 + root_menu = menu_new_of_type (panel_menu_get_type ());
105 g_object_set_data (G_OBJECT (root_menu), "menu_panel", panel);
107 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/panel-config-global.c gnome-panel-2.4.1/gnome-panel/panel-config-global.c
108 --- gnome-panel-2.4.1.orig/gnome-panel/panel-config-global.c 2003-03-05 02:11:34.000000000 +0100
109 +++ gnome-panel-2.4.1/gnome-panel/panel-config-global.c 2003-12-02 22:42:53.000000000 +0100
111 guint drawer_auto_close : 1;
112 guint confirm_panel_remove : 1;
113 guint highlight_when_over : 1;
114 + guint menu_stripe : 1;
117 static GlobalConfig global_config = { 0, };
120 return global_config.confirm_panel_remove;
123 +panel_global_config_get_menu_stripe (void)
125 + g_assert (global_config_initialised == TRUE);
127 + return global_config.menu_stripe;
131 panel_global_config_set_entry (GConfEntry *entry)
133 global_config.highlight_when_over =
134 gconf_value_get_bool (value);
136 + else if (strcmp (key, "show_menu_stripe") == 0)
137 + global_config.menu_stripe =
138 + gconf_value_get_bool (value);
141 g_warning ("%s not handled", key);
142 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/panel-config-global.h gnome-panel-2.4.1/gnome-panel/panel-config-global.h
143 --- gnome-panel-2.4.1.orig/gnome-panel/panel-config-global.h 2003-03-05 02:11:34.000000000 +0100
144 +++ gnome-panel-2.4.1/gnome-panel/panel-config-global.h 2003-12-02 22:42:53.000000000 +0100
146 gboolean panel_global_config_get_drawer_auto_close (void);
147 gboolean panel_global_config_get_tooltips_enabled (void);
148 gboolean panel_global_config_get_confirm_panel_remove (void);
149 +gboolean panel_global_config_get_menu_stripe (void);
153 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/panel-global.schemas.in gnome-panel-2.4.1/gnome-panel/panel-global.schemas.in
154 --- gnome-panel-2.4.1.orig/gnome-panel/panel-global.schemas.in 2003-07-07 15:27:58.000000000 +0200
155 +++ gnome-panel-2.4.1/gnome-panel/panel-global.schemas.in 2003-12-02 22:42:53.000000000 +0100
160 + <key>/schemas/apps/panel/global/show_menu_stripe</key>
161 + <applyto>/apps/panel/global/show_menu_stripe</applyto>
162 + <owner>panel</owner>
164 + <default>true</default>
172 <key>/schemas/apps/panel/global/enable_key_bindings</key>
173 <applyto>/apps/panel/global/enable_key_bindings</applyto>
175 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/panel-menu.c gnome-panel-2.4.1/gnome-panel/panel-menu.c
176 --- gnome-panel-2.4.1.orig/gnome-panel/panel-menu.c 1970-01-01 01:00:00.000000000 +0100
177 +++ gnome-panel-2.4.1/gnome-panel/panel-menu.c 2003-12-03 01:30:49.228495360 +0100
180 + * To set this up insert something like this in your ~/.gtkrc-2.0
182 + * Copyright (C) 2003 Marcin Krzy¿anowski
183 + * Copyright (C) 2002 Ximian, Inc.
184 + * Copyright (C) 2001 Havoc Pennington
185 + * Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
189 + * PanelMenu::default_side_image = "/tmp/stripelogo.png"
190 + * PanelMenu::gradient_bg = true
192 + * class "PanelMenu" style "default"
195 + * Thomas, Michael Meeks
196 + * GtkMenu code by the GTK+ team
197 + * Gradient code from WindowMaker by Dan Pascu and Alfredo Kojima, by way of metacity by Havoc Pennington.
198 + * Marcin Krzy¿anowski
202 +#include <libgnome/gnome-macros.h>
203 +#include <libgnome/gnome-program.h>
204 +#include <libgnome/gnome-i18n.h>
205 +#include <gtk/gtkgc.h>
206 +#include <gtk/gtkimagemenuitem.h>
207 +#include <gtk/gtkseparatormenuitem.h>
208 +#include <gtk/gtkmenu.h>
209 +#include <gtk/gtkwidget.h>
210 +#include <gtk/gtkwindow.h>
211 +#include <gtk/gtkmain.h>
212 +#include <gdk/gdkwindow.h>
213 +#include <panel-menu.h>
215 +#include "panel-config-global.h"
217 +#define dprintf(a) g_warning a
218 +/*#define dprintf(a) G_STMT_START { (void) 0; } G_STMT_END*/
220 +GNOME_CLASS_BOILERPLATE (PanelMenu, panel_menu,
221 + GtkMenu, GTK_TYPE_MENU)
226 +panel_menu_size_request (GtkWidget *widget,
227 + GtkRequisition *requisition)
229 + PanelMenu *pm = PANEL_MENU (widget);
231 + GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
233 + if (panel_global_config_get_menu_stripe () && pm->side_image != NULL)
234 + requisition->width += gdk_pixbuf_get_width (pm->side_image)
235 + + gtk_widget_get_style (widget)->xthickness;
239 +get_light_stripe_color (PanelMenu *pm)
243 + gtk_widget_style_get (GTK_WIDGET (pm),
244 + "stripe-color-light", &color,
248 + color = gdk_color_copy (>K_WIDGET (pm)->style->bg[GTK_STATE_NORMAL]);
255 +get_stripe_color (PanelMenu *pm)
259 + gtk_widget_style_get (GTK_WIDGET (pm),
260 + "stripe-color", &color,
264 + color = gdk_color_copy (>K_WIDGET (pm)->style->bg[GTK_STATE_SELECTED]);
271 +get_stripe_gc (PanelMenu *pm)
273 + GdkGCValues gc_values;
274 + GdkGCValuesMask gc_values_mask;
277 + color = get_stripe_color (pm);
278 + gc_values.foreground = *color;
279 + gdk_color_free (color);
280 + gc_values_mask = GDK_GC_FOREGROUND;
282 + gdk_rgb_find_color (GTK_WIDGET (pm)->style->colormap, &gc_values.foreground);
284 + return gtk_gc_get (GTK_WIDGET (pm)->style->depth,
285 + GTK_WIDGET (pm)->style->colormap,
286 + &gc_values, gc_values_mask);
290 +panel_menu_expose_event (GtkWidget *widget,
291 + GdkEventExpose *event)
293 + GdkRectangle exposed;
294 + GdkRectangle position;
298 + PanelMenu *pm = PANEL_MENU (widget);
300 + GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
302 + if (!panel_global_config_get_menu_stripe () || !pm->side_image) {
305 + window = GTK_MENU (widget)->bin_window;
307 + stripe_gc = get_stripe_gc (pm);
309 + gdk_gc_set_clip_rectangle (stripe_gc, &event->area);
310 + gdk_draw_rectangle (window,
313 + widget->allocation.x,
314 + widget->allocation.y,
315 + gdk_pixbuf_get_width (pm->side_image),
316 + widget->allocation.height);
317 + gdk_gc_set_clip_rectangle (stripe_gc, NULL);
319 + bin_height = widget->allocation.height - 2 * (GTK_CONTAINER (widget)->border_width + widget->style->ythickness);
321 + position = widget->allocation;
322 + position.y += bin_height - gdk_pixbuf_get_height (pm->side_image);
323 + position.width = gdk_pixbuf_get_width (pm->side_image);
324 + position.height = gdk_pixbuf_get_height (pm->side_image);
326 + if (widget->allocation.height >= gdk_pixbuf_get_height (pm->side_image)) {
327 + if (gdk_rectangle_intersect (&event->area,
330 + gdk_pixbuf_render_to_drawable (
331 + pm->side_image, window,
332 + widget->style->black_gc,
333 + exposed.x - position.x,
334 + exposed.y - position.y,
335 + exposed.x, exposed.y,
336 + exposed.width, exposed.height,
337 + GDK_RGB_DITHER_NORMAL,
338 + exposed.x, exposed.y);
342 + position = widget->allocation;
343 + if (position.height != gdk_pixbuf_get_height (pm->side_image)) {
344 + position.width = gdk_pixbuf_get_width (pm->side_image);
345 + if (position.height > gdk_pixbuf_get_height (pm->side_image)) {
346 + position.height = bin_height - gdk_pixbuf_get_height (pm->side_image);
348 + position.height = bin_height;
351 + if (pm->scaled_image && gdk_rectangle_intersect (&event->area,
355 + gdk_pixbuf_render_to_drawable (
356 + pm->scaled_image, window,
357 + widget->style->black_gc,
358 + exposed.x - position.x,
359 + exposed.y - position.y,
360 + exposed.x, exposed.y,
361 + exposed.width, exposed.height,
362 + GDK_RGB_DITHER_NORMAL,
363 + exposed.x, exposed.y);
370 +/* begin metacity cut and paste */
372 +free_buffer (guchar *pixels, gpointer data)
378 +blank_pixbuf (int width, int height, gboolean no_padding)
383 + g_return_val_if_fail (width > 0, NULL);
384 + g_return_val_if_fail (height > 0, NULL);
387 + rowstride = width * 3;
389 + /* Always align rows to 32-bit boundaries */
390 + rowstride = 4 * ((3 * width + 3) / 4);
392 + buf = g_try_malloc (height * rowstride);
396 + return gdk_pixbuf_new_from_data (buf, GDK_COLORSPACE_RGB,
398 + width, height, rowstride,
399 + free_buffer, NULL);
403 +meta_gradient_create_vertical (int width, int height,
404 + const GdkColor *from,
405 + const GdkColor *to)
408 + long r, g, b, dr, dg, db;
410 + unsigned char *ptr;
411 + unsigned char rr, gg, bb;
415 + unsigned char *pixels;
417 + pixbuf = blank_pixbuf (width, height, FALSE);
418 + if (pixbuf == NULL)
421 + pixels = gdk_pixbuf_get_pixels (pixbuf);
422 + rowstride = gdk_pixbuf_get_rowstride (pixbuf);
424 + r0 = (guchar) (from->red / 256.0);
425 + g0 = (guchar) (from->green / 256.0);
426 + b0 = (guchar) (from->blue / 256.0);
427 + rf = (guchar) (to->red / 256.0);
428 + gf = (guchar) (to->green / 256.0);
429 + bf = (guchar) (to->blue / 256.0);
435 + dr = ((rf-r0)<<16)/(int)height;
436 + dg = ((gf-g0)<<16)/(int)height;
437 + db = ((bf-b0)<<16)/(int)height;
439 + for (i=0; i<height; i++)
441 + ptr = pixels + i * rowstride;
446 + for (j=0; j<width/8; j++)
448 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
449 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
450 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
451 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
452 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
453 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
454 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
455 + *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
459 + case 7: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
460 + case 6: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
461 + case 5: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
462 + case 4: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
463 + case 3: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
464 + case 2: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
465 + case 1: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
474 +/* end metacity cut and paste */
476 +/* begin gtkmenu.c cut and paste */
478 +#define MENU_SCROLL_ARROW_HEIGHT 16
481 +gtk_menu_stop_scrolling (GtkMenu *menu)
483 + if (menu->timeout_id)
485 + g_source_remove (menu->timeout_id);
486 + menu->timeout_id = 0;
491 +gtk_menu_scroll_to (GtkMenu *menu,
496 + gint view_width, view_height;
498 + gboolean last_visible;
501 + widget = GTK_WIDGET (menu);
503 + if (menu->tearoff_active &&
504 + menu->tearoff_adjustment &&
505 + (menu->tearoff_adjustment->value != offset))
507 + menu->tearoff_adjustment->value = offset;
508 + gtk_adjustment_value_changed (menu->tearoff_adjustment);
511 + /* Move/resize the viewport according to arrows: */
512 + view_width = widget->allocation.width;
513 + view_height = widget->allocation.height;
515 + border_width = GTK_CONTAINER (menu)->border_width;
516 + view_width -= (border_width + widget->style->xthickness) * 2;
517 + view_height -= (border_width + widget->style->ythickness) * 2;
518 + menu_height = widget->requisition.height - (border_width + widget->style->ythickness) * 2;
520 + offset = CLAMP (offset, 0, menu_height - view_height);
522 + /* Scroll the menu: */
523 + if (GTK_WIDGET_REALIZED (menu))
524 + gdk_window_move (menu->bin_window, 0, -offset);
526 + x = border_width + widget->style->xthickness;
527 + y = border_width + widget->style->ythickness;
529 + if (!menu->tearoff_active)
531 + last_visible = menu->upper_arrow_visible;
532 + menu->upper_arrow_visible = (offset > 0);
534 + if (menu->upper_arrow_visible)
535 + view_height -= MENU_SCROLL_ARROW_HEIGHT;
537 + if ( (last_visible != menu->upper_arrow_visible) &&
538 + !menu->upper_arrow_visible)
540 + menu->upper_arrow_prelight = FALSE;
542 + /* If we hid the upper arrow, possibly remove timeout */
543 + if (menu->scroll_step < 0)
544 + gtk_menu_stop_scrolling (menu);
547 + last_visible = menu->lower_arrow_visible;
548 + menu->lower_arrow_visible = (view_height + offset < menu_height);
550 + if (menu->lower_arrow_visible)
551 + view_height -= MENU_SCROLL_ARROW_HEIGHT;
553 + if ( (last_visible != menu->lower_arrow_visible) &&
554 + !menu->lower_arrow_visible)
556 + menu->lower_arrow_prelight = FALSE;
558 + /* If we hid the lower arrow, possibly remove timeout */
559 + if (menu->scroll_step > 0)
560 + gtk_menu_stop_scrolling (menu);
563 + if (menu->upper_arrow_visible)
564 + y += MENU_SCROLL_ARROW_HEIGHT;
567 + if (GTK_WIDGET_REALIZED (menu))
568 + gdk_window_move_resize (menu->view_window,
574 + menu->scroll_offset = offset;
578 +gtk_menu_set_tearoff_hints (GtkMenu *menu,
581 + GdkGeometry geometry_hints;
583 + if (!menu->tearoff_window)
586 + if (GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
588 + gtk_widget_size_request (menu->tearoff_scrollbar, NULL);
589 + width += menu->tearoff_scrollbar->requisition.width;
592 + geometry_hints.min_width = width;
593 + geometry_hints.max_width = width;
595 + geometry_hints.min_height = 0;
596 + geometry_hints.max_height = GTK_WIDGET (menu)->requisition.height;
598 + gtk_window_set_geometry_hints (GTK_WINDOW (menu->tearoff_window),
601 + GDK_HINT_MAX_SIZE|GDK_HINT_MIN_SIZE);
605 +gtk_menu_size_allocate (GtkWidget *widget,
606 + GtkAllocation *allocation)
609 + GtkMenuShell *menu_shell;
611 + GtkAllocation child_allocation;
614 + gint width, height;
616 + g_return_if_fail (GTK_IS_MENU (widget));
617 + g_return_if_fail (allocation != NULL);
619 + menu = GTK_MENU (widget);
620 + menu_shell = GTK_MENU_SHELL (widget);
622 + widget->allocation = *allocation;
624 + x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness;
625 + y = GTK_CONTAINER (menu)->border_width + widget->style->ythickness;
627 + width = MAX (1, allocation->width - x * 2);
628 + height = MAX (1, allocation->height - y * 2);
630 + if (menu->upper_arrow_visible && !menu->tearoff_active)
632 + y += MENU_SCROLL_ARROW_HEIGHT;
633 + height -= MENU_SCROLL_ARROW_HEIGHT;
636 + if (menu->lower_arrow_visible && !menu->tearoff_active)
637 + height -= MENU_SCROLL_ARROW_HEIGHT;
639 + if (GTK_WIDGET_REALIZED (widget))
641 + gdk_window_move_resize (widget->window,
642 + allocation->x, allocation->y,
643 + allocation->width, allocation->height);
645 + gdk_window_move_resize (menu->view_window,
652 + if (menu_shell->children)
654 + child_allocation.x = 0;
655 + child_allocation.y = 0;
656 + child_allocation.width = width;
658 +/* inserted for panel-menu.c */
659 + if (panel_global_config_get_menu_stripe () && PANEL_MENU (widget)->side_image)
661 + child_allocation.x = gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image) + gtk_widget_get_style (widget)->xthickness;
664 + child_allocation.width = width - child_allocation.x;
665 +/* end panel-menu.c */
667 + children = menu_shell->children;
670 + child = children->data;
671 + children = children->next;
673 + if (GTK_WIDGET_VISIBLE (child))
675 + GtkRequisition child_requisition;
676 + gtk_widget_get_child_requisition (child, &child_requisition);
678 + child_allocation.height = child_requisition.height;
680 + gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
681 + menu->toggle_size);
683 +/* inserted for panel-menu.c */
684 + if (PANEL_MENU (widget)->side_image && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM))
686 + /* this is dumb, gtkmenuitem.c uses allocation.width as an absolute point */
687 + child_allocation.width += gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image);
690 + gtk_widget_size_allocate (child, &child_allocation);
692 + if (PANEL_MENU(widget)->side_image && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM))
694 + child_allocation.width -= gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image);
697 + /* Hack to handle events on the stripe area */
698 + if (GTK_WIDGET_REALIZED (child))
700 + gdk_window_move_resize (GTK_MENU_ITEM (child)->event_window,
701 + 0, child_allocation.y,
703 + child_allocation.height);
705 +/* end panel-menu.c */
707 + gtk_widget_queue_draw (child);
709 + child_allocation.y += child_allocation.height;
713 + /* Resize the item window */
714 + if (GTK_WIDGET_REALIZED (widget))
716 +/* inserted for panel-menu.c */
717 + gdk_window_resize (menu->bin_window,
719 + child_allocation.width,
723 + child_allocation.y);
724 +/* end panel-menu.c */
728 + if (menu->tearoff_active)
730 + if (allocation->height >= widget->requisition.height)
732 + if (GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
734 + gtk_widget_hide (menu->tearoff_scrollbar);
735 + gtk_menu_set_tearoff_hints (menu, allocation->width);
736 + gtk_widget_set_size_request (menu->tearoff_window, -1, allocation->height);
738 + gtk_menu_scroll_to (menu, 0);
743 + menu->tearoff_adjustment->upper = widget->requisition.height;
744 + menu->tearoff_adjustment->page_size = allocation->height;
746 + if (menu->tearoff_adjustment->value + menu->tearoff_adjustment->page_size >
747 + menu->tearoff_adjustment->upper)
750 + value = menu->tearoff_adjustment->upper - menu->tearoff_adjustment->page_size;
753 + gtk_menu_scroll_to (menu, value);
756 + gtk_adjustment_changed (menu->tearoff_adjustment);
758 + if (!GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
760 + gtk_widget_show (menu->tearoff_scrollbar);
761 + gtk_menu_set_tearoff_hints (menu, allocation->width);
762 + gtk_widget_set_size_request (menu->tearoff_window, -1, allocation->height);
767 +/* inserted for panel-menu.c */
770 + PanelMenu *pm = PANEL_MENU (widget);
772 + gint scaled_height = height;
774 + if (pm->side_image && widget->allocation.height > gdk_pixbuf_get_height (pm->side_image))
776 + scaled_height -= gdk_pixbuf_get_height (pm->side_image);
779 + if (pm->side_image && widget->allocation.height < gdk_pixbuf_get_height (pm->side_image))
781 + gint scaled_width = ((scaled_height * gdk_pixbuf_get_width (pm->side_image)) / gdk_pixbuf_get_height (pm->side_image));
783 + pm->scaled_image = gdk_pixbuf_scale_simple (pm->side_image,
786 + GDK_INTERP_BILINEAR); /* maybe HYPER ? */
790 + gboolean draw_gradient;
791 + gtk_widget_style_get (GTK_WIDGET (pm),
792 + "gradient_bg", &draw_gradient,
795 + if (pm->side_image && draw_gradient)
797 + GdkColor *stripe_color;
798 + GdkColor *light_color;
800 + stripe_color = get_stripe_color (pm);
801 + light_color = get_light_stripe_color (pm);
802 + pm->scaled_image = meta_gradient_create_vertical
803 + (gdk_pixbuf_get_width (pm->side_image),
807 + gdk_color_free (light_color);
808 + gdk_color_free (stripe_color);
812 +/* end panel-menu.c */
815 +/* end gtkmenu cut and paste */
818 +unload_images (PanelMenu *pm)
820 + if (pm->side_image) {
821 + g_object_unref (pm->side_image);
822 + pm->side_image = NULL;
825 + if (pm->scaled_image) {
826 + g_object_unref (pm->scaled_image);
827 + pm->scaled_image = NULL;
833 +get_stripe_image (PanelMenu *pm,
835 + const char *default_filename)
837 + GdkPixbuf *image = NULL;
840 + gtk_widget_style_get (GTK_WIDGET (pm), name, &file_src, NULL);
843 + file_src = gnome_program_locate_file (NULL,
844 + GNOME_FILE_DOMAIN_PIXMAP,
851 + image = gdk_pixbuf_new_from_file (file_src, NULL);
859 +load_images (PanelMenu *pm)
863 + unload_images (pm);
865 + pm->side_image = get_stripe_image (pm, "default_side_image",
866 + "pld-desktop-stripe.png");
871 +panel_menu_style_set (GtkWidget *widget,
872 + GtkStyle *old_style)
874 + load_images (PANEL_MENU (widget));
875 + GNOME_CALL_PARENT (GTK_WIDGET_CLASS, style_set, (widget, old_style));
879 +panel_menu_destroy (GtkObject *object)
881 + PanelMenu *pm = PANEL_MENU (object);
883 + unload_images (pm);
885 + GNOME_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
889 +panel_menu_finalize (GObject *object)
891 + GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
895 +panel_menu_class_init (PanelMenuClass *klass)
897 + GtkWidgetClass *widget_class = (GtkWidgetClass *) klass;
898 + GtkObjectClass *gtk_object_class = (GtkObjectClass *)klass;
899 + GObjectClass *object_class = (GObjectClass *) klass;
901 + gtk_widget_class_install_style_property (
903 + g_param_spec_string ("default_side_image",
904 + _("Default Side Image"),
905 + _("Filename of logo down the side of applications menu"),
907 + G_PARAM_READWRITE));
909 + gtk_widget_class_install_style_property (
911 + g_param_spec_boolean ("gradient_bg",
912 + _("Gradient Background"),
913 + _("Draw a gradient in the menu stripe"),
915 + G_PARAM_READWRITE));
916 + gtk_widget_class_install_style_property (
918 + g_param_spec_boxed ("stripe_color",
920 + _("Color of the panel menu stripe"),
922 + G_PARAM_READABLE));
924 + gtk_widget_class_install_style_property (
926 + g_param_spec_boxed ("stripe_color_light",
927 + _("Light Stripe Color"),
928 + _("Light color of the panel menu stripe, for gradients"),
930 + G_PARAM_READABLE));
932 + object_class->finalize = panel_menu_finalize;
933 + gtk_object_class->destroy = panel_menu_destroy;
934 + widget_class->size_request = panel_menu_size_request;
935 + widget_class->size_allocate = gtk_menu_size_allocate;
936 + widget_class->expose_event = panel_menu_expose_event;
937 + widget_class->style_set = panel_menu_style_set;
941 +panel_menu_instance_init (PanelMenu *pm)
943 + gtk_widget_ensure_style (GTK_WIDGET (pm));
947 + gtk_widget_add_events (
949 + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
950 + GDK_POINTER_MOTION_MASK);
952 diff -Nuard gnome-panel-2.4.1.orig/gnome-panel/panel-menu.h gnome-panel-2.4.1/gnome-panel/panel-menu.h
953 --- gnome-panel-2.4.1.orig/gnome-panel/panel-menu.h 1970-01-01 01:00:00.000000000 +0100
954 +++ gnome-panel-2.4.1/gnome-panel/panel-menu.h 2003-12-03 01:22:39.710913344 +0100
956 +#include <gtk/gtkmenu.h>
957 +#include <gtk/gtkimage.h>
959 +typedef struct _PanelMenu PanelMenu;
960 +typedef struct _PanelMenuClass PanelMenuClass;
962 +#define PANEL_MENU(obj) \
963 + GTK_CHECK_CAST (obj, panel_menu_get_type (), PanelMenu)
964 +#define PANEL_MENU_CLASS(k) \
965 + GTK_CHECK_CLASS_CAST (k, panel_menu_get_type (), PanelMenuClass)
966 +#define PANEL_IS_MENU(obj) \
967 + GTK_CHECK_TYPE (obj, panel_menu_get_type ())
974 + GdkPixbuf *side_image;
975 + GdkPixbuf *scaled_image;
977 + GdkRegion *navigation_region;
980 +struct _PanelMenuClass
982 + GtkMenuClass parent_class;
985 +GType panel_menu_get_type (void);
986 +GtkWidget *panel_menu_evolve (void);