- GtkArrow *arrow = GTK_ARROW (widget);
- GtkMisc *misc = GTK_MISC (widget);
- gfloat arrow_scaling;
- gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
-
- width = widget->allocation.width - misc->xpad * 2;
- height = widget->allocation.height - misc->ypad * 2;
- extent = MIN (width, height) * arrow_scaling;
- effective_arrow_type = arrow->arrow_type;
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- xalign = misc->xalign;
- else
- {
- xalign = 1.0 - misc->xalign;
- if (arrow->arrow_type == GTK_ARROW_LEFT)
- effective_arrow_type = GTK_ARROW_RIGHT;
- else if (arrow->arrow_type == GTK_ARROW_RIGHT)
- effective_arrow_type = GTK_ARROW_LEFT;
- }
-
- x = floor (widget->allocation.x + misc->xpad
- + ((widget->allocation.width - extent) * xalign));
- y = floor (widget->allocation.y + misc->ypad
- + ((widget->allocation.height - extent) * misc->yalign));
-
- shadow_type = arrow->shadow_type;
-
- if (widget->state == GTK_STATE_ACTIVE)
- {
- if (shadow_type == GTK_SHADOW_IN)
- shadow_type = GTK_SHADOW_OUT;
- else if (shadow_type == GTK_SHADOW_OUT)
- shadow_type = GTK_SHADOW_IN;
- else if (shadow_type == GTK_SHADOW_ETCHED_IN)
- shadow_type = GTK_SHADOW_ETCHED_OUT;
- else if (shadow_type == GTK_SHADOW_ETCHED_OUT)
- shadow_type = GTK_SHADOW_ETCHED_IN;
- }
-
- gtk_paint_arrow (widget->style, widget->window,
- widget->state, shadow_type,
- &event->area, widget, "arrow",
- effective_arrow_type, TRUE,
- x, y, extent, extent);