]> git.pld-linux.org Git - packages/gnome-panel.git/blame - gnome-panel-menu-stripe.patch
- updated for gnome-panel-2.6.2
[packages/gnome-panel.git] / gnome-panel-menu-stripe.patch
CommitLineData
6ff43b9e 1diff -urN aa/gnome-panel-2.6.0/gnome-panel/Makefile.am gnome-panel-2.6.0/gnome-panel/Makefile.am
2--- aa/gnome-panel-2.6.0/gnome-panel/Makefile.am 2004-02-06 17:04:50.000000000 +0100
3+++ gnome-panel-2.6.0/gnome-panel/Makefile.am 2004-03-27 00:29:00.520061944 +0100
44b3d376 4@@ -80,6 +80,8 @@
921d10b3
MK
5 panel-typebuiltins.h \
6 panel-marshal.c \
7 panel-marshal.h \
8+ panel-menu.c \
9+ panel-menu.h \
10 main.c \
11 panel-widget.c \
12 button-widget.c \
6ff43b9e 13diff -urN aa/gnome-panel-2.6.0/gnome-panel/menu.c gnome-panel-2.6.0/gnome-panel/menu.c
14--- aa/gnome-panel-2.6.0/gnome-panel/menu.c 2004-03-09 11:08:47.000000000 +0100
15+++ gnome-panel-2.6.0/gnome-panel/menu.c 2004-03-27 00:29:00.522061640 +0100
921d10b3
MK
16@@ -44,6 +44,7 @@
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"
23 #include "panel.h"
24@@ -67,6 +68,7 @@
44b3d376 25 #include "panel-lockdown.h"
921d10b3
MK
26
27 #undef MENU_DEBUG
28+#define MENU_SNAP_LENGTH 10
29
30 static char *gnome_folder = NULL;
31
44b3d376 32@@ -614,6 +616,9 @@
921d10b3
MK
33 if (repo->orig_func != NULL) {
34 repo->orig_func (menu, x, y, push_in, repo->orig_data);
35
36+ if (*x < MENU_SNAP_LENGTH)
37+ *x = 0;
38+
39 if (menu->parent_menu_item != NULL) {
40 /* This is a submenu so behave submenuish */
41 if (*x < monitor_basex ||
44b3d376 42@@ -709,8 +714,8 @@
921d10b3
MK
43 reload_image_menu_items ();
44 }
45
46-GtkWidget *
47-panel_create_menu (void)
48+static GtkWidget *
49+panel_create_menu_of_type (GType menu_type)
50 {
51 GtkWidget *retval;
52 static gboolean registered_icon_theme_changer = FALSE;
44b3d376 53@@ -722,8 +727,7 @@
921d10b3
MK
54 G_CALLBACK (icon_theme_changed), NULL);
55 }
56
57- retval = gtk_menu_new ();
58-
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,
62 G_OBJECT (retval));
44b3d376 63@@ -739,12 +743,18 @@
921d10b3
MK
64 return retval;
65 }
66
67+GtkWidget *
68+panel_create_menu (void)
69+{
70+ return panel_create_menu_of_type (gtk_menu_get_type());
71+}
72+
73 static GtkWidget *
74-menu_new (void)
75+menu_new_of_type (GType menu_type)
76 {
77 GtkWidget *retval;
78
79- retval = panel_create_menu ();
80+ retval = panel_create_menu_of_type (menu_type);
81
82 g_signal_connect (
83 retval, "show", G_CALLBACK (setup_menu_panel), NULL);
44b3d376 84@@ -752,6 +762,13 @@
921d10b3
MK
85 return retval;
86 }
87
88+static GtkWidget *
89+menu_new (void)
90+{
91+ return menu_new_of_type (gtk_menu_get_type ());
92+}
93+
94+
95 static void
96 icon_to_load_free (IconToLoad *icon)
97 {
44b3d376 98@@ -3314,7 +3331,7 @@
921d10b3
MK
99 }
100
101 if (!root_menu)
102- root_menu = menu_new ();
103+ root_menu = menu_new_of_type (panel_menu_get_type ());
104
105 g_object_set_data (G_OBJECT (root_menu), "menu_panel", panel);
106
6ff43b9e 107diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.c gnome-panel-2.6.0/gnome-panel/panel-config-global.c
108--- aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.c 2004-01-18 15:35:47.000000000 +0100
109+++ gnome-panel-2.6.0/gnome-panel/panel-config-global.c 2004-03-27 00:29:00.523061488 +0100
921d10b3
MK
110@@ -45,6 +45,7 @@
111 guint drawer_auto_close : 1;
112 guint confirm_panel_remove : 1;
113 guint highlight_when_over : 1;
114+ guint menu_stripe : 1;
115 } GlobalConfig;
116
117 static GlobalConfig global_config = { 0, };
118@@ -94,6 +95,13 @@
119
120 return global_config.confirm_panel_remove;
121 }
122+gboolean
123+panel_global_config_get_menu_stripe (void)
124+{
125+ g_assert (global_config_initialised == TRUE);
126+
127+ return global_config.menu_stripe;
128+}
129
130 static void
131 panel_global_config_set_entry (GConfEntry *entry)
44b3d376 132@@ -151,6 +159,11 @@
133 else if (strcmp (key, "highlight_launchers_on_mouseover") == 0)
921d10b3
MK
134 global_config.highlight_when_over =
135 gconf_value_get_bool (value);
44b3d376 136+
137+ else if (strcmp (key, "show_menu_stripe") == 0)
138+ global_config.menu_stripe =
139+ gconf_value_get_bool (value);
140+
141 }
921d10b3 142
44b3d376 143 static void
6ff43b9e 144diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.h gnome-panel-2.6.0/gnome-panel/panel-config-global.h
145--- aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.h 2004-01-18 15:32:28.000000000 +0100
146+++ gnome-panel-2.6.0/gnome-panel/panel-config-global.h 2004-03-27 00:29:00.523061488 +0100
921d10b3
MK
147@@ -37,6 +37,7 @@
148 gboolean panel_global_config_get_drawer_auto_close (void);
149 gboolean panel_global_config_get_tooltips_enabled (void);
150 gboolean panel_global_config_get_confirm_panel_remove (void);
151+gboolean panel_global_config_get_menu_stripe (void);
152
153 G_END_DECLS
154
6ff43b9e 155diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in
156--- aa/gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in 2004-01-18 16:10:23.000000000 +0100
157+++ gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in 2004-03-27 00:29:00.588051608 +0100
921d10b3
MK
158@@ -93,6 +93,18 @@
159 </schema>
160
161 <schema>
162+ <key>/schemas/apps/panel/global/show_menu_stripe</key>
163+ <applyto>/apps/panel/global/show_menu_stripe</applyto>
164+ <owner>panel</owner>
165+ <type>bool</type>
166+ <default>true</default>
167+ <locale name="C">
168+ <short></short>
169+ <long></long>
170+ </locale>
171+ </schema>
172+
173+ <schema>
174 <key>/schemas/apps/panel/global/enable_key_bindings</key>
175 <applyto>/apps/panel/global/enable_key_bindings</applyto>
176 <owner>panel</owner>
6ff43b9e 177diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-menu.c gnome-panel-2.6.0/gnome-panel/panel-menu.c
178--- aa/gnome-panel-2.6.0/gnome-panel/panel-menu.c 1970-01-01 01:00:00.000000000 +0100
179+++ gnome-panel-2.6.0/gnome-panel/panel-menu.c 2004-03-27 00:49:47.929426896 +0100
180@@ -0,0 +1,1082 @@
921d10b3
MK
181+/*
182+ * To set this up insert something like this in your ~/.gtkrc-2.0
183+ *
184+ * Copyright (C) 2002 Ximian, Inc.
185+ * Copyright (C) 2001 Havoc Pennington
186+ * Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
44b3d376 187