static void clearlooks_style_draw_arrow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, GtkArrowType arrow_type, gboolean fill, gint x, gint y, gint width, gint height) { ClearlooksColors *colors; WidgetParameters params; ArrowParameters arrow; cairo_t *cr; ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style); (void) shadow; (void) detail; (void) fill; cr = ge_gdk_drawable_to_cairo (window, area); colors = &clearlooks_style->colors; CHECK_ARGS SANITIZE_SIZE if (arrow_type == GTK_ARROW_NONE) { cairo_destroy (cr); return; } clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); arrow.type = CL_ARROW_NORMAL; arrow.direction = (ClearlooksDirection)arrow_type; if (ge_is_combo_box (widget, FALSE) && !ge_is_combo_box_entry (widget)) { arrow.type = CL_ARROW_COMBO; } /* I have no idea why, but the arrow of GtkCombo is larger than in other places. * Subtracting 3 seems to fix this. */ if (widget && widget->parent && GE_IS_COMBO (widget->parent->parent)) { if (params.ltr) x += 1; else x += 2; width -= 3; } STYLE_FUNCTION(draw_arrow) (cr, colors, ¶ms, &arrow, x, y, width, height); cairo_destroy (cr); }
gboolean ge_is_combo (GtkWidget * widget) { gboolean result = FALSE; if ((widget) && (gtk_widget_get_parent (widget))) { if (GE_IS_COMBO (gtk_widget_get_parent (widget))) result = TRUE; else result = ge_is_combo (gtk_widget_get_parent (widget)); } return result; }
static GtkWidget * ge_find_combo_widget (GtkWidget * widget) { GtkWidget *result = NULL; if (widget) { if (GE_IS_COMBO (widget)) result = widget; else result = ge_find_combo_widget(gtk_widget_get_parent (widget)); } return result; }
gboolean ge_is_combo (GtkWidget * widget) { gboolean result = FALSE; if ((widget) && (widget->parent)) { if (GE_IS_COMBO (widget->parent)) result = TRUE; else result = ge_is_combo (widget->parent); } return result; }