summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-01-21 21:09:03 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-01-21 21:09:03 +0000
commita0fa647a640aef8d6aa308a70c1b1888cbf15b03 (patch)
treec1a94cf8f0cd58019abe91c2f39c6350d96bbcce
parent6878910ad47cd711e40259e399409da19008cd96 (diff)
downloadgdk-pixbuf-a0fa647a640aef8d6aa308a70c1b1888cbf15b03.tar.gz
[ Tried to commit wrong file last time ]
Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtktreeitem.c: Add a paint routine, fix up bugs in drawing where if the expose area was contained completely in the right side of the tree the background wasn't redraw, etc.
-rw-r--r--ChangeLog13
-rw-r--r--ChangeLog.pre-2-013
-rw-r--r--ChangeLog.pre-2-1013
-rw-r--r--ChangeLog.pre-2-213
-rw-r--r--ChangeLog.pre-2-413
-rw-r--r--ChangeLog.pre-2-613
-rw-r--r--ChangeLog.pre-2-813
-rw-r--r--gtk/gtktreeitem.c95
8 files changed, 154 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index a57339555..521055bb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index a57339555..521055bb6 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index a57339555..521055bb6 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index a57339555..521055bb6 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index a57339555..521055bb6 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index a57339555..521055bb6 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index a57339555..521055bb6 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,16 @@
+Thu Jan 21 16:03:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
+
+ * gtk/gtktreeitem.c: Add a paint routine, fix up bugs
+ in drawing where if the expose area was contained
+ completely in the right side of the tree the background
+ wasn't redraw, etc.
+
+ * gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
+ in clipping draw regions while propagating them
+ upwards.
+
Thu Jan 21 12:20:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_dialog_new):
diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c
index 1d6d44c2b..4ac5c362f 100644
--- a/gtk/gtktreeitem.c
+++ b/gtk/gtktreeitem.c
@@ -59,6 +59,8 @@ static void gtk_tree_item_size_allocate (GtkWidget *widget,
static void gtk_tree_item_draw (GtkWidget *widget,
GdkRectangle *area);
static void gtk_tree_item_draw_focus (GtkWidget *widget);
+static void gtk_tree_item_paint (GtkWidget *widget,
+ GdkRectangle *area);
static gint gtk_tree_item_button_press (GtkWidget *widget,
GdkEventButton *event);
static gint gtk_tree_item_expose (GtkWidget *widget,
@@ -625,8 +627,8 @@ gtk_tree_item_draw_lines (GtkWidget *widget)
}
static void
-gtk_tree_item_draw (GtkWidget *widget,
- GdkRectangle *area)
+gtk_tree_item_paint (GtkWidget *widget,
+ GdkRectangle *area)
{
GtkBin *bin;
GdkRectangle child_area, item_area;
@@ -641,6 +643,25 @@ gtk_tree_item_draw (GtkWidget *widget,
bin = GTK_BIN (widget);
tree_item = GTK_TREE_ITEM(widget);
+ if (widget->state == GTK_STATE_NORMAL)
+ {
+ gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+ gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+ }
+ else
+ {
+ if (!GTK_WIDGET_IS_SENSITIVE (widget))
+ gtk_paint_flat_box(widget->style, widget->window,
+ widget->state, GTK_STATE_INSENSITIVE,
+ area, widget, "treeitem",
+ 0, 0, -1, -1);
+ else
+ gtk_paint_flat_box(widget->style, widget->window,
+ widget->state, GTK_SHADOW_ETCHED_OUT,
+ area, widget, "treeitem",
+ 0, 0, -1, -1);
+ }
+
/* draw left size of tree item */
item_area.x = 0;
item_area.y = 0;
@@ -648,43 +669,17 @@ gtk_tree_item_draw (GtkWidget *widget,
GTK_TREE (widget->parent)->current_indent + 2);
item_area.height = widget->allocation.height;
+
if (gdk_rectangle_intersect(&item_area, area, &child_area))
{
- if (widget->state == GTK_STATE_NORMAL)
- {
- gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
- gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
- }
- else
- {
- if (!GTK_WIDGET_IS_SENSITIVE (widget))
- gtk_paint_flat_box(widget->style, widget->window,
- widget->state, GTK_STATE_INSENSITIVE,
- area, widget, "treeitem",
- 0, 0, -1, -1);
- else
- gtk_paint_flat_box(widget->style, widget->window,
- widget->state, GTK_SHADOW_ETCHED_OUT,
- area, widget, "treeitem",
- 0, 0, -1, -1);
- }
-
- gtk_tree_item_draw_lines(widget);
+ gtk_tree_item_draw_lines(widget);
+
if (tree_item->pixmaps_box &&
GTK_WIDGET_VISIBLE(tree_item->pixmaps_box) &&
gtk_widget_intersect (tree_item->pixmaps_box, area, &child_area))
gtk_widget_draw (tree_item->pixmaps_box, &child_area);
}
-
- /* draw right side */
- if (gtk_widget_intersect (bin->child, area, &child_area))
- {
- if (bin->child &&
- GTK_WIDGET_VISIBLE(bin->child) &&
- gtk_widget_intersect (bin->child, area, &child_area))
- gtk_widget_draw (bin->child, &child_area);
- }
if (GTK_WIDGET_HAS_FOCUS (widget))
gtk_paint_focus (widget->style, widget->window,
@@ -697,6 +692,30 @@ gtk_tree_item_draw (GtkWidget *widget,
}
static void
+gtk_tree_item_draw (GtkWidget *widget,
+ GdkRectangle *area)
+{
+ GtkBin *bin;
+ GdkRectangle child_area;
+
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_TREE_ITEM (widget));
+ g_return_if_fail (area != NULL);
+
+ if (GTK_WIDGET_DRAWABLE (widget))
+ {
+ bin = GTK_BIN (widget);
+
+ gtk_tree_item_paint (widget, area);
+
+ if (bin->child &&
+ gtk_widget_intersect (bin->child, area, &child_area))
+ gtk_widget_draw (bin->child, &child_area);
+
+ }
+}
+
+static void
gtk_tree_item_draw_focus (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
@@ -726,12 +745,24 @@ static gint
gtk_tree_item_expose (GtkWidget *widget,
GdkEventExpose *event)
{
+ GdkEventExpose child_event;
+ GtkBin *bin;
+
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
- gtk_tree_item_draw(widget, &event->area);
+ {
+ bin = GTK_BIN (widget);
+
+ gtk_tree_item_paint (widget, &event->area);
+
+ child_event = *event;
+ if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) &&
+ gtk_widget_intersect (bin->child, &event->area, &child_event.area))
+ gtk_widget_event (bin->child, (GdkEvent*) &child_event);
+ }
return FALSE;
}