summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>1999-01-21 02:13:13 +0000
committerLars Hamann <lars@src.gnome.org>1999-01-21 02:13:13 +0000
commit1a58d9b3cfc2da2338de37e05990e8456ef08e2d (patch)
treeac74b9e8a114bb939cb246de435d0e203bb9aadd
parent21993dcb10451adc462fa1b42e3e46f392371c95 (diff)
downloadgdk-pixbuf-1a58d9b3cfc2da2338de37e05990e8456ef08e2d.tar.gz
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.
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-2-07
-rw-r--r--ChangeLog.pre-2-107
-rw-r--r--ChangeLog.pre-2-27
-rw-r--r--ChangeLog.pre-2-47
-rw-r--r--ChangeLog.pre-2-67
-rw-r--r--ChangeLog.pre-2-87
-rw-r--r--gtk/gtknotebook.c76
8 files changed, 108 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index da55cb54d..04696d55c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index da55cb54d..04696d55c 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,10 @@
+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
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index da55cb54d..04696d55c 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,10 @@
+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
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index da55cb54d..04696d55c 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,10 @@
+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
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index da55cb54d..04696d55c 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,10 @@
+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
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index da55cb54d..04696d55c 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,10 @@
+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
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index da55cb54d..04696d55c 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,10 @@
+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
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 75d96dd7a..b2a5a387b 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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: