Commit 1a58d9b3 authored by Lars Hamann's avatar Lars Hamann Committed by Lars Hamann
Browse files

few cleanups. (gtk_notebook_key_press): call select page function for

Thu Jan 21 02:47:36 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
	(gtk_notebook_key_press): call select page function for
	GDK_DOWN key in case of tab_pos == TOP. Changed other
	positions accordingly.
parent 21993dcb
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
Thu Jan 21 02:47:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_focus): few cleanups.
(gtk_notebook_key_press): call select page function for
GDK_DOWN key in case of tab_pos == TOP. Changed other
positions accordingly.
Wed Jan 20 19:57:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin): Start off with the
......
......@@ -1249,16 +1249,56 @@ gtk_notebook_key_press (GtkWidget *widget,
switch (event->keyval)
{
case GDK_Up:
direction = GTK_DIR_UP;
switch (notebook->tab_pos)
{
case GTK_POS_BOTTOM:
gtk_notebook_page_select (GTK_NOTEBOOK (widget));
return TRUE;
case GTK_POS_TOP:
return FALSE;
default:
direction = GTK_DIR_UP;
break;
}
break;
case GDK_Left:
direction = GTK_DIR_LEFT;
switch (notebook->tab_pos)
{
case GTK_POS_RIGHT:
gtk_notebook_page_select (GTK_NOTEBOOK (widget));
return TRUE;
case GTK_POS_LEFT:
return FALSE;
default:
direction = GTK_DIR_LEFT;
break;
}
break;
case GDK_Down:
direction = GTK_DIR_DOWN;
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
gtk_notebook_page_select (GTK_NOTEBOOK (widget));
return TRUE;
case GTK_POS_BOTTOM:
return FALSE;
default:
direction = GTK_DIR_DOWN;
break;
}
break;
case GDK_Right:
direction = GTK_DIR_RIGHT;
switch (notebook->tab_pos)
{
case GTK_POS_LEFT:
gtk_notebook_page_select (GTK_NOTEBOOK (widget));
return TRUE;
case GTK_POS_RIGHT:
return FALSE;
default:
direction = GTK_DIR_RIGHT;
break;
}
break;
case GDK_Tab:
case GDK_ISO_Left_Tab:
......@@ -1534,7 +1574,6 @@ gtk_notebook_focus (GtkContainer *container,
GtkDirectionType direction)
{
GtkNotebook *notebook;
GtkWidget *focus_child;
GtkNotebookPage *page = NULL;
GtkNotebookPage *old_page = NULL;
......@@ -1543,13 +1582,12 @@ gtk_notebook_focus (GtkContainer *container,
notebook = GTK_NOTEBOOK (container);
if (!GTK_WIDGET_DRAWABLE (notebook) || !GTK_WIDGET_IS_SENSITIVE (container) ||
!notebook->children || !notebook->cur_page)
if (!GTK_WIDGET_DRAWABLE (notebook) ||
!GTK_WIDGET_IS_SENSITIVE (container) ||
!notebook->children ||
!notebook->cur_page)
return FALSE;
focus_child = container->focus_child;
gtk_container_set_focus_child (container, NULL);
if (!notebook->show_tabs)
{
if (GTK_WIDGET_DRAWABLE (notebook->cur_page->child) &&
......@@ -1563,7 +1601,7 @@ gtk_notebook_focus (GtkContainer *container,
}
else if (GTK_WIDGET_CAN_FOCUS (notebook->cur_page->child))
{
if (!focus_child)
if (!container->focus_child)
{
gtk_widget_grab_focus (notebook->cur_page->child);
return TRUE;
......@@ -1576,24 +1614,28 @@ gtk_notebook_focus (GtkContainer *container,
if (notebook->focus_tab)
old_page = notebook->focus_tab->data;
if (focus_child && old_page && focus_child == old_page->child &&
notebook->child_has_focus)
if (container->focus_child && old_page &&
container->focus_child == old_page->child && notebook->child_has_focus)
{
if (GTK_WIDGET_DRAWABLE (old_page->child))
if (GTK_WIDGET_DRAWABLE (container->focus_child))
{
if (GTK_IS_CONTAINER (old_page->child) &&
!GTK_WIDGET_HAS_FOCUS (old_page->child))
if (GTK_IS_CONTAINER (container->focus_child) &&
!GTK_WIDGET_HAS_FOCUS (container->focus_child))
{
if (gtk_container_focus (GTK_CONTAINER (old_page->child),
if (gtk_container_focus (GTK_CONTAINER (container->focus_child),
direction))
return TRUE;
}
gtk_widget_grab_focus (GTK_WIDGET(notebook));
return TRUE;
}
notebook->focus_tab = NULL;
return FALSE;
}
if (!GTK_WIDGET_HAS_FOCUS (container))
notebook->focus_tab = NULL;
switch (direction)
{
case GTK_DIR_TAB_FORWARD:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment