aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-creation-dialog.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-07-25 19:07:12 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-07-25 19:07:12 +0800
commit5b9ae086e8d94b5354b96543175c1ffe0922fa3c (patch)
tree7b7c69410817ed5b39779e597bbf8716bc87cf3f /shell/e-shell-folder-creation-dialog.c
parent126807f8aa489bc2de242a05888fe4a83993d323 (diff)
downloadgsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.tar
gsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.tar.gz
gsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.tar.bz2
gsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.tar.lz
gsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.tar.xz
gsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.tar.zst
gsoc2013-evolution-5b9ae086e8d94b5354b96543175c1ffe0922fa3c.zip
Work around utter GtkOptionMenu brokenness so that we finally have a
nice-looking option menu for the folder creation dialog. svn path=/trunk/; revision=4313
Diffstat (limited to 'shell/e-shell-folder-creation-dialog.c')
-rw-r--r--shell/e-shell-folder-creation-dialog.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c
index 1fcfb779e3..e793b2ccff 100644
--- a/shell/e-shell-folder-creation-dialog.c
+++ b/shell/e-shell-folder-creation-dialog.c
@@ -292,9 +292,17 @@ add_folder_types (GtkWidget *dialog,
folder_type_option_menu = glade_xml_get_widget (gui, "folder_type_option_menu");
+ /* KLUDGE. So, GtkOptionMenu is badly broken. It calculates its size
+ in `gtk_option_menu_set_menu()' instead of using `size_request()' as
+ any sane widget would do. So, in order to avoid the "narrow
+ GtkOptionMenu" bug, we have to destroy the existing associated menu
+ and create a new one. Life sucks. */
+
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (folder_type_option_menu));
g_assert (menu != NULL);
- g_assert (GTK_IS_MENU (menu));
+ gtk_widget_destroy (menu);
+
+ menu = gtk_menu_new ();
folder_type_registry = e_shell_get_folder_type_registry (shell);
g_assert (folder_type_registry != NULL);
@@ -316,8 +324,8 @@ add_folder_types (GtkWidget *dialog,
type_name = (const char *) p->data;
menu_item = gtk_menu_item_new_with_label (type_name);
- gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
+ gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_object_set_data (GTK_OBJECT (menu_item), "folder_type", (void *) type_name);
@@ -325,7 +333,11 @@ add_folder_types (GtkWidget *dialog,
default_item = i;
}
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (folder_type_option_menu), menu);
+ gtk_widget_show (menu);
+
gtk_option_menu_set_history (GTK_OPTION_MENU (folder_type_option_menu), default_item);
+ gtk_widget_queue_resize (folder_type_option_menu);
return folder_types;
}