]>
Commit | Line | Data |
---|---|---|
921d10b3 MK |
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 | |
7b878044 | 3 | +++ gnome-panel-2.4.1/gnome-panel/Makefile.am 2003-12-02 22:42:53.000000000 +0100 |
921d10b3 MK |
4 | @@ -98,6 +98,8 @@ |
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 \ | |
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 | |
7b878044 | 15 | +++ gnome-panel-2.4.1/gnome-panel/menu.c 2003-12-02 22:42:53.000000000 +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 @@ | |
25 | #include "panel-run-dialog.h" | |
26 | ||
27 | #undef MENU_DEBUG | |
28 | +#define MENU_SNAP_LENGTH 10 | |
29 | ||
30 | static char *gnome_folder = NULL; | |
31 | ||
32 | @@ -610,6 +612,9 @@ | |
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 || | |
42 | @@ -705,8 +710,8 @@ | |
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; | |
53 | @@ -718,8 +723,7 @@ | |
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)); | |
63 | @@ -735,12 +739,18 @@ | |
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); | |
84 | @@ -748,6 +758,13 @@ | |
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 | { | |
98 | @@ -3316,7 +3333,7 @@ | |
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 | ||
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 | |
7b878044 | 109 | +++ gnome-panel-2.4.1/gnome-panel/panel-config-global.c 2003-12-02 22:42:53.000000000 +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) | |
132 | @@ -152,6 +160,9 @@ | |
133 | global_config.highlight_when_over = | |
134 | gconf_value_get_bool (value); | |
135 | ||
136 | + else if (strcmp (key, "show_menu_stripe") == 0) | |
137 | + global_config.menu_stripe = | |
138 | + gconf_value_get_bool (value); | |
139 | #if 0 | |
140 | else | |
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 | |
7b878044 | 144 | +++ gnome-panel-2.4.1/gnome-panel/panel-config-global.h 2003-12-02 22:42:53.000000000 +0100 |
921d10b3 MK |
145 | @@ -37,6 +37,7 @@ |
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); | |
150 | ||
151 | G_END_DECLS | |
152 | ||
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 | |
7b878044 | 155 | +++ gnome-panel-2.4.1/gnome-panel/panel-global.schemas.in 2003-12-02 22:42:53.000000000 +0100 |
921d10b3 MK |
156 | @@ -93,6 +93,18 @@ |
157 | </schema> | |
158 | ||
159 | <schema> | |
160 | + <key>/schemas/apps/panel/global/show_menu_stripe</key> | |
161 | + <applyto>/apps/panel/global/show_menu_stripe</applyto> | |
162 | + <owner>panel</owner> | |
163 | + <type>bool</type> | |
164 | + <default>true</default> | |
165 | + <locale name="C"> | |
166 | + <short></short> | |
167 | + <long></long> | |
168 | + </locale> | |
169 | + </schema> | |
170 | + | |
171 | + <schema> | |
172 | <key>/schemas/apps/panel/global/enable_key_bindings</key> | |
173 | <applyto>/apps/panel/global/enable_key_bindings</applyto> | |
174 | <owner>panel</owner> | |
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 | |
7b878044 MK |
177 | +++ gnome-panel-2.4.1/gnome-panel/panel-menu.c 2003-12-03 01:30:49.228495360 +0100 |
178 | @@ -0,0 +1,773 @@ | |
921d10b3 MK |
179 | +/* |
180 | + * To set this up insert something like this in your ~/.gtkrc-2.0 | |
181 | + * | |
7b878044 | 182 |