summaryrefslogtreecommitdiff
path: root/gtk/gtkaspectframe.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>1998-11-06 22:05:02 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-11-06 22:05:02 +0000
commite2a521922085c8010028e227f61bba59ea6b8242 (patch)
tree2500d6aa6f63aab4b58c17546532ecce8fdcca37 /gtk/gtkaspectframe.c
parent3c0df19a588bd96f328bda975db8eb9fa7f79e81 (diff)
downloadgtk+-e2a521922085c8010028e227f61bba59ea6b8242.tar.gz
Merge from themes-2. See the ChangeLog for a somewhat detailed
history of the evolution of the changes involved. Most of this is actually minor painting tweaks.
Diffstat (limited to 'gtk/gtkaspectframe.c')
-rw-r--r--gtk/gtkaspectframe.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c
index fe6c76a0f8..2472e8b2aa 100644
--- a/gtk/gtkaspectframe.c
+++ b/gtk/gtkaspectframe.c
@@ -135,11 +135,7 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
aspect_frame->obey_child = obey_child;
if (GTK_WIDGET_DRAWABLE(widget))
- gdk_window_clear_area (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ gtk_widget_queue_clear (widget);
gtk_widget_queue_resize (widget);
}
@@ -152,7 +148,7 @@ gtk_aspect_frame_paint (GtkWidget *widget,
GtkFrame *frame;
gint height_extra;
gint label_area_width;
- gint x, y;
+ gint x, y, x2, y2;
GtkAllocation *allocation;
g_return_if_fail (widget != NULL);
@@ -170,32 +166,40 @@ gtk_aspect_frame_paint (GtkWidget *widget,
x = GTK_CONTAINER (frame)->border_width;
y = GTK_CONTAINER (frame)->border_width;
- gtk_draw_shadow (widget->style, widget->window,
- GTK_STATE_NORMAL, frame->shadow_type,
- allocation->x + x,
- allocation->y + y + height_extra / 2,
- allocation->width - x * 2,
- allocation->height - y * 2 - height_extra / 2);
-
if (frame->label)
{
label_area_width = (allocation->width +
GTK_CONTAINER (frame)->border_width * 2 -
widget->style->klass->xthickness * 2);
- x = ((label_area_width - frame->label_width) * frame->label_xalign +
- GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
- y = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
-
- gdk_window_clear_area (widget->window,
- allocation->x + x + 2,
- allocation->y + GTK_CONTAINER (frame)->border_width,
- frame->label_width - 4, frame->label_height);
- gtk_draw_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
- allocation->x + x + 3,
- allocation->y + y,
- frame->label);
+ x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
+ GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
+ y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
+
+ gtk_paint_shadow_gap (widget->style, widget->window,
+ GTK_STATE_NORMAL, frame->shadow_type,
+ area, widget, "frame",
+ allocation->x + x,
+ allocation->y + y + height_extra / 2,
+ allocation->width - x * 2,
+ allocation->height - y * 2 - height_extra / 2,
+ GTK_POS_TOP,
+ x2 + 2 - x, frame->label_width - 4);
+
+ gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+ area, widget, "frame",
+ allocation->x + x2 + 3,
+ allocation->y + y2,
+ frame->label);
}
+ else
+ gtk_paint_shadow (widget->style, widget->window,
+ GTK_STATE_NORMAL, frame->shadow_type,
+ area, widget, "frame",
+ allocation->x + x,
+ allocation->y + y + height_extra / 2,
+ allocation->width - x * 2,
+ allocation->height - y * 2 - height_extra / 2);
}
}