diff options
author | Jonathan Blandford <jrb@redhat.com> | 2000-02-23 22:55:27 +0000 |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2000-02-23 22:55:27 +0000 |
commit | 6654a22891abb31fab2a68e9b67d2c3e46f79d69 (patch) | |
tree | 9e8dcccc44a36cc11ba0886aaf81437e07e343cf /gtk/gtkhpaned.c | |
parent | 2444c80ff76ee2d04fc66fcdf1ba09885912b5fe (diff) | |
download | gdk-pixbuf-6654a22891abb31fab2a68e9b67d2c3e46f79d69.tar.gz |
add a 'paned' mode to the function to let it draw the seven dots, instead
2000-02-23 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_handle): add a 'paned' mode to
the function to let it draw the seven dots, instead of the old,
much maligned, method.
(draw_dot): New function to draw a dot.
* gtk/gtkhpaned.c (gtk_hpaned_size_allocate): changed allocation
to draw the handle inside the border width as opposed to outside.
Use paint function instead of gdk_draw_point.
* gtk/gtkvpaned.c (gtk_vpaned_size_allocate): changed allocation
to draw the handle inside the border width as opposed to outside.
Use paint function instead of gdk_draw_point.
* gtk/gtkfilesel.c (gtk_file_selection_update_history_menu):
Change indenting to be more GTK like.
Diffstat (limited to 'gtk/gtkhpaned.c')
-rw-r--r-- | gtk/gtkhpaned.c | 86 |
1 files changed, 15 insertions, 71 deletions
diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c index b757907f6..8f9cd035a 100644 --- a/gtk/gtkhpaned.c +++ b/gtk/gtkhpaned.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * @@ -181,9 +180,9 @@ gtk_hpaned_size_allocate (GtkWidget *widget, /* Move the handle before the children so we don't get extra expose events */ paned->handle_xpos = paned->child1_size + border_width; - paned->handle_ypos = 0; + paned->handle_ypos = border_width; paned->handle_width = paned->handle_size; - paned->handle_height = widget->allocation.height; + paned->handle_height = widget->allocation.height - 2 * border_width; if (GTK_WIDGET_REALIZED (widget)) { @@ -253,74 +252,19 @@ gtk_hpaned_draw (GtkWidget *widget, if (gdk_rectangle_intersect (&handle_area, area, &child_area)) { - if (widget->allocation.height > 2) - { - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 - 1); - } - if (widget->allocation.height > 11) - { - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2 + 5); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 + 4); - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2 - 5); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 - 6); - } - if (widget->allocation.height > 20) - { - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2 - 10); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 - 11); - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2 + 10); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 + 9); - } - if (widget->allocation.height > 30) - { - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2 - 15); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 - 16); - gdk_draw_point (paned->handle, - widget->style->fg_gc[GTK_STATE_NORMAL], - paned->handle_size/2, - paned->handle_height/2 + 15); - gdk_draw_point (paned->handle, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - paned->handle_size/2 - 1, - paned->handle_height/2 + 14); - } + child_area.x -= paned->handle_xpos; + child_area.y -= paned->handle_ypos; + + gtk_paint_handle (widget->style, + paned->handle, + GTK_STATE_NORMAL, + GTK_SHADOW_NONE, + &child_area, + widget, + "paned", + 0, 0, -1, -1, + GTK_ORIENTATION_VERTICAL); + } /* Redraw the children */ |