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)
This commit is contained in:
Owen Taylor 2001-09-26 20:33:23 +00:00 committed by Owen Taylor
parent 849e688273
commit 0269b4387d
9 changed files with 111 additions and 11 deletions

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -1,3 +1,15 @@
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)
2001-09-25 Darin Adler <darin@bentspoon.com>
* tests/.cvsignore: Ignore new test program.

View File

@ -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);
}

View File

@ -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;