diff --git a/ChangeLog b/ChangeLog index 38b84931cb..4607887e74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 38b84931cb..4607887e74 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 38b84931cb..4607887e74 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 38b84931cb..4607887e74 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 38b84931cb..4607887e74 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 38b84931cb..4607887e74 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 38b84931cb..4607887e74 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Wed Sep 26 16:15:25 2001 Owen Taylor + + * 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) + 2001-09-25 Darin Adler * tests/.cvsignore: Ignore new test program. diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 0554f001f4..d95f27c677 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -3127,8 +3127,12 @@ paste_received (GtkClipboard *clipboard, if (text) { - gint pos = entry->current_pos; + gint pos, start, end; + if (gtk_editable_get_selection_bounds (editable, &start, &end)) + gtk_editable_delete_text (editable, start, end); + + pos = entry->current_pos; gtk_editable_insert_text (editable, text, -1, &pos); gtk_editable_set_position (editable, pos); } diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index a02551d5c7..53020ea79c 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2053,6 +2053,20 @@ gtk_notebook_find_child (GtkNotebook *notebook, return list; } +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;