diff options
author | Havoc Pennington <hp@redhat.com> | 2000-12-04 23:04:17 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-12-04 23:04:17 +0000 |
commit | 9365d0d7dc44e67a371590edf7b5f8744963e04c (patch) | |
tree | 72f57f594f861aafca4ddc4815b16d1969699ead /gtk/gtkvpaned.c | |
parent | d77144614bb39e62dc40cd9b8c510b4cfee04c62 (diff) | |
download | gtk+-9365d0d7dc44e67a371590edf7b5f8744963e04c.tar.gz |
fix this to be sane
2000-12-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkpaned.c (gtk_paned_expose): fix this to be sane
* gtk/gtkvpaned.c (gtk_vpaned_expose): Add an expose handler
* gtk/gtkhpaned.c (gtk_hpaned_expose): Add an expose handler
* gtk/gtknotebook.c (gtk_notebook_draw_tab): put in a temporary
hack to avoid infinite loops (queue draw instead of draw) -
Owen has more appropriate fixes in a branch he'll check in later.
* gtk/gtktextiter.c (gtk_text_iter_ends_line): handle paragraph
separator, CR, and CRLF as line ends
* gtk/gtktextbtree.c (gtk_text_btree_insert): on insertion, break
into lines using pango_find_paragraph_boundary(); other bits of
the widget are still going to be broken if the boundary isn't '\n'
though
Diffstat (limited to 'gtk/gtkvpaned.c')
-rw-r--r-- | gtk/gtkvpaned.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gtk/gtkvpaned.c b/gtk/gtkvpaned.c index 69bfed62d9..5347372fa3 100644 --- a/gtk/gtkvpaned.c +++ b/gtk/gtkvpaned.c @@ -32,6 +32,8 @@ static void gtk_vpaned_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_vpaned_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static gint gtk_vpaned_expose (GtkWidget *widget, + GdkEventExpose *expose); static void gtk_vpaned_xor_line (GtkPaned *paned); static gboolean gtk_vpaned_button_press (GtkWidget *widget, GdkEventButton *event); @@ -40,6 +42,8 @@ static gboolean gtk_vpaned_button_release (GtkWidget *widget, static gboolean gtk_vpaned_motion (GtkWidget *widget, GdkEventMotion *event); +static gpointer parent_class; + GtkType gtk_vpaned_get_type (void) { @@ -70,10 +74,13 @@ gtk_vpaned_class_init (GtkVPanedClass *class) { GtkWidgetClass *widget_class; + parent_class = gtk_type_class (GTK_TYPE_PANED); + widget_class = (GtkWidgetClass *) class; widget_class->size_request = gtk_vpaned_size_request; widget_class->size_allocate = gtk_vpaned_size_allocate; + widget_class->expose_event = gtk_vpaned_expose; widget_class->button_press_event = gtk_vpaned_button_press; widget_class->button_release_event = gtk_vpaned_button_release; widget_class->motion_notify_event = gtk_vpaned_motion; @@ -221,6 +228,50 @@ gtk_vpaned_size_allocate (GtkWidget *widget, } } +static gint +gtk_vpaned_expose (GtkWidget *widget, + GdkEventExpose *event) +{ + GtkPaned *paned; + guint16 border_width; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (GTK_IS_PANED (widget), FALSE); + + if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) + { + paned = GTK_PANED (widget); + border_width = GTK_CONTAINER (paned)->border_width; + + if (event->window == widget->window) + { + gdk_window_clear_area (widget->window, + event->area.x, event->area.y, + event->area.width, + event->area.height); + + + /* Chain up to draw children */ + GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); + } + else if (event->window == paned->handle) + { + gtk_paint_handle (widget->style, + paned->handle, + GTK_STATE_NORMAL, + GTK_SHADOW_NONE, + &event->area, + widget, + "paned", + 0, 0, -1, -1, + GTK_ORIENTATION_HORIZONTAL); + + } + } + + return FALSE; +} + static void gtk_vpaned_xor_line (GtkPaned *paned) { |