aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/egg-editable-toolbar.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-17 03:14:37 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-17 03:14:37 +0800
commit8412f01e4161ccc40603ccdc4011714c5a3f9aa7 (patch)
tree83d764e269315c27c7df80851260f2bc8f16d9c0 /lib/egg/egg-editable-toolbar.c
parente89d190c6c6ecaaa4e367835c5fddb549325b3f2 (diff)
downloadgsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.tar
gsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.tar.gz
gsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.tar.bz2
gsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.tar.lz
gsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.tar.xz
gsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.tar.zst
gsoc2013-epiphany-8412f01e4161ccc40603ccdc4011714c5a3f9aa7.zip
Update.
2003-04-16 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-editable-toolbar.c: * lib/egg/eggtoolbar.c: * lib/egg/eggtoolitem.h: Update.
Diffstat (limited to 'lib/egg/egg-editable-toolbar.c')
-rwxr-xr-xlib/egg/egg-editable-toolbar.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index 31122be46..8e875842e 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -989,7 +989,7 @@ setup_editor (EggEditableToolbar *etoolbar,
gtk_box_pack_start (GTK_BOX (label_hbox), label, FALSE, TRUE, 0);
gtk_dialog_add_button (GTK_DIALOG (editor),
- _("Add Toolbar"), RESPONSE_ADD_TOOLBAR);
+ _("_Add a New Toolbar"), RESPONSE_ADD_TOOLBAR);
gtk_dialog_add_button (GTK_DIALOG (editor),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
@@ -1008,6 +1008,32 @@ add_to_list (EggToolbarsItem *item,
*l = g_list_append (*l, item);
}
+static gchar *
+elide_underscores (const gchar *original)
+{
+ gchar *q, *result;
+ const gchar *p;
+ gboolean last_underscore;
+
+ q = result = g_malloc (strlen (original) + 1);
+ last_underscore = FALSE;
+
+ for (p = original; *p; p++)
+ {
+ if (!last_underscore && *p == '_')
+ last_underscore = TRUE;
+ else
+ {
+ last_underscore = FALSE;
+ *q++ = *p;
+ }
+ }
+
+ *q = '\0';
+
+ return result;
+}
+
static GtkWidget *
editor_create_item (EggEditableToolbar *etoolbar,
const char *stock_id,
@@ -1018,6 +1044,7 @@ editor_create_item (EggEditableToolbar *etoolbar,
GtkWidget *vbox;
GtkWidget *icon;
GtkWidget *label;
+ gchar *label_no_mnemonic = NULL;
event_box = gtk_event_box_new ();
gtk_widget_show (event_box);
@@ -1038,8 +1065,9 @@ editor_create_item (EggEditableToolbar *etoolbar,
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_show (icon);
gtk_box_pack_start (GTK_BOX (vbox), icon, FALSE, TRUE, 0);
-
- label = gtk_label_new_with_mnemonic (label_text);
+ label_no_mnemonic = elide_underscores (label_text);
+ label = gtk_label_new (label_no_mnemonic);
+ g_free (label_no_mnemonic);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
@@ -1093,7 +1121,7 @@ update_editor_sheet (EggEditableToolbar *etoolbar)
g_return_if_fail (action != NULL);
item = editor_create_item (etoolbar, action->stock_id,
- action->label, GDK_ACTION_MOVE);
+ action->short_label, GDK_ACTION_MOVE);
g_object_set_data (G_OBJECT (item), "egg-action", action);
gtk_table_attach_defaults (GTK_TABLE (etoolbar->priv->table),
item, x, x + 1, y, y + 1);