summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>1998-11-26 18:47:58 +0000
committerLars Hamann <lars@src.gnome.org>1998-11-26 18:47:58 +0000
commit4ab10dc891a84331551f00bb7ba24f5319c4a8c6 (patch)
tree758b0b9ea86cb2acb6bb51af8cfa10c62a511ccf /gtk/gtknotebook.c
parentc7ac3835fa2d5542bff316c3a02da626a754d213 (diff)
downloadgdk-pixbuf-4ab10dc891a84331551f00bb7ba24f5319c4a8c6.tar.gz
define GtkCTreeNode as boxed type use GTK_CTREE_NODE_TYPE instead of
Thu Nov 26 19:11:46 1998 Lars Hamann <lars@gtk.org> * gtk/gtk-boxed.defs (GtkCTreeNode): define GtkCTreeNode as boxed type * gtk/gtkctree.c (gtk_ctree_class_init): use GTK_CTREE_NODE_TYPE instead of GTK_TYPE_POINTER in signal definitions. (patch from James Henstridge <james@daa.com.au>) Thu Nov 26 18:48:44 1998 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c (set_cell_contents) * gtk/gtkctree.c (set_cell_contents): call column_auto_resize only if auto.resize == TRUE * gtk/gtknotebook.c (gtk_notebook_set_shape) (gtk_notebook_expose): don't draw tab, if show_tabs == FALSE (bug reports from Alexis Mikhailov / Dave Cole) (gtk_notebook_focus_changed) (gtk_notebook_draw_focus): draw only the focus rectangle, not the hole tab.
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c77
1 files changed, 55 insertions, 22 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index a04965459..dc2099e4e 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -911,10 +911,13 @@ gtk_notebook_expose (GtkWidget *widget,
notebook = GTK_NOTEBOOK (widget);
gtk_notebook_paint (widget, &event->area);
- if (notebook->cur_page &&
- gtk_widget_intersect (notebook->cur_page->tab_label,
- &event->area, &child_area))
- gtk_widget_draw_focus (widget);
+ if (notebook->show_tabs)
+ {
+ if (notebook->cur_page &&
+ gtk_widget_intersect (notebook->cur_page->tab_label,
+ &event->area, &child_area))
+ gtk_widget_draw_focus (widget);
+ }
child_event = *event;
if (notebook->cur_page &&
@@ -1309,12 +1312,12 @@ gtk_notebook_draw_focus (GtkWidget *widget)
page = notebook->focus_tab->data;
- area.x = widget->allocation.x;
- area.y = widget->allocation.y;
- area.width = widget->allocation.width;
- area.height = widget->allocation.height;
+ area.x = page->tab_label->allocation.x - 1;
+ area.y = page->tab_label->allocation.y - 1;
+ area.width = page->tab_label->allocation.width + 2;
+ area.height = page->tab_label->allocation.height + 2;
- gtk_notebook_draw_tab(GTK_NOTEBOOK(widget), page, &area);
+ gtk_notebook_draw_tab (GTK_NOTEBOOK (widget), page, &area);
}
}
@@ -1798,7 +1801,34 @@ gtk_notebook_focus_changed (GtkNotebook *notebook,
g_return_if_fail (notebook != NULL);
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- gtk_notebook_expose_tabs(notebook);
+ if (GTK_WIDGET_DRAWABLE (notebook) && notebook->show_tabs)
+ {
+ GdkRectangle area;
+
+ if (notebook->focus_tab)
+ {
+ GtkNotebookPage *page;
+
+ page = notebook->focus_tab->data;
+
+ area.x = page->tab_label->allocation.x - 1;
+ area.y = page->tab_label->allocation.y - 1;
+ area.width = page->tab_label->allocation.width + 2;
+ area.height = page->tab_label->allocation.height + 2;
+
+ gtk_notebook_draw_tab (notebook, page, &area);
+ }
+
+ if (old_page)
+ {
+ area.x = old_page->tab_label->allocation.x - 1;
+ area.y = old_page->tab_label->allocation.y - 1;
+ area.width = old_page->tab_label->allocation.width + 2;
+ area.height = old_page->tab_label->allocation.height + 2;
+
+ gtk_notebook_draw_tab (notebook, old_page, &area);
+ }
+ }
}
static gint
@@ -2231,8 +2261,7 @@ gtk_notebook_draw_tab (GtkNotebook *notebook,
page_area.width, page_area.height,
gap_side);
if ((GTK_WIDGET_HAS_FOCUS (widget)) &&
- notebook->focus_tab && (notebook->focus_tab->data == page) &&
- (page))
+ notebook->focus_tab && (notebook->focus_tab->data == page))
{
gtk_paint_focus (widget->style, widget->window,
area, widget, "tab",
@@ -2417,20 +2446,24 @@ gtk_notebook_set_shape (GtkNotebook *notebook)
}
/* draw the shapes of all the children */
- children = notebook->children;
- while (children)
+ if (notebook->show_tabs)
{
- page = children->data;
- if (GTK_WIDGET_MAPPED (page->tab_label))
+ children = notebook->children;
+ while (children)
{
- x = page->allocation.x;
- y = page->allocation.y;
- width = page->allocation.width;
- height = page->allocation.height;
- gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
+ page = children->data;
+ if (GTK_WIDGET_MAPPED (page->tab_label))
+ {
+ x = page->allocation.x;
+ y = page->allocation.y;
+ width = page->allocation.width;
+ height = page->allocation.height;
+ gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
+ }
+ children = children->next;
}
- children = children->next;
}
+
/* set the mask */
gdk_window_shape_combine_mask(widget->window, pm, 0, 0);
gdk_pixmap_unref(pm);