diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-09-26 20:33:23 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-09-26 20:33:23 +0000 |
commit | 0269b4387d0137558ad085de97e2a73b9145028a (patch) | |
tree | e0af98f3d03a4eb0605d85a4bea2f6a1ef0ed5fd /gtk/gtknotebook.c | |
parent | 849e6882738d6f9bc57989fdc9cfbc9171dff58d (diff) | |
download | gtk+-0269b4387d0137558ad085de97e2a73b9145028a.tar.gz |
Fix problem where menmonic wasn't removed properly when setting a label
Wed Sep 26 16:15:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): Fix
problem where menmonic wasn't removed properly when
setting a label when there already is a label.
Also, handle setting the tab label back to the same
value. (#61160, #61161)
* gtk/gtkentry.c (paste_received): Patch from
Damian Ivereigh to replace selection if there is
one. (#61121)
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r-- | gtk/gtknotebook.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index a02551d5c7..53020ea79c 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2054,6 +2054,20 @@ gtk_notebook_find_child (GtkNotebook *notebook, } static void +gtk_notebook_remove_tab_label (GtkNotebook *notebook, + GtkNotebookPage *page) +{ + if (page->tab_label) + { + if (page->mnemonic_activate_signal) + gtk_signal_disconnect (page->tab_label, + page->mnemonic_activate_signal); + + gtk_widget_unparent (page->tab_label); + } +} + +static void gtk_notebook_real_remove (GtkNotebook *notebook, GList *list) { @@ -2082,15 +2096,10 @@ gtk_notebook_real_remove (GtkNotebook *notebook, if (GTK_WIDGET_VISIBLE (page->child) && GTK_WIDGET_VISIBLE (notebook)) need_resize = TRUE; - if (page->tab_label && page->mnemonic_activate_signal) - gtk_signal_disconnect (page->tab_label, - page->mnemonic_activate_signal); - gtk_widget_unparent (page->child); - if (page->tab_label) - gtk_widget_unparent (page->tab_label); - + gtk_notebook_remove_tab_label (notebook, page); + if (notebook->menu) { gtk_container_remove (GTK_CONTAINER (notebook->menu), @@ -4496,9 +4505,12 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook, * we need to set the associated label */ page = list->data; - if (page->tab_label) - gtk_widget_unparent (page->tab_label); - + + if (page->tab_label == tab_label) + return; + + gtk_notebook_remove_tab_label (notebook, page); + if (tab_label) { page->default_tab = FALSE; |