Add illustration to gtk_render_handle docs

This commit is contained in:
Matthias Clasen 2010-11-23 23:16:22 -05:00 committed by Carlos Garnacho
parent 3ddee2561b
commit 0f98b15090
4 changed files with 33 additions and 0 deletions

View File

@ -351,6 +351,7 @@ HTML_IMAGES = \
$(srcdir)/images/frame-gap.png \
$(srcdir)/images/sliders.png \
$(srcdir)/images/focus.png \
$(srcdir)/images/handles.png \
$(srcdir)/images/extensions.png
# Extra options to supply to gtkdoc-fixref

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

View File

@ -3421,6 +3421,11 @@ gtk_render_extension (GtkStyleContext *context,
* #GtkWindow<!-- -->'s resize grip), in the rectangle
* determined by @x, @y, @width, @height.
*
* <example>
* <title>Handles rendered for the paned and grip classes</title>
* <inlinegraphic fileref="handles.png" format="PNG"/>
* </example>
*
* Since: 3.0
**/
void

View File

@ -297,6 +297,31 @@ draw_cb_frame_gap (GtkWidget *widget, cairo_t *cr)
return TRUE;
}
static gboolean
draw_cb_handles (GtkWidget *widget, cairo_t *cr)
{
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
gtk_style_context_add_class (context, "paned");
gtk_render_handle (context, cr, 12, 22, 20, 10);
gtk_render_handle (context, cr, 44, 12, 10, 20);
gtk_style_context_remove_class (context, "paned");
gtk_style_context_add_class (context, "grip");
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_CORNER_BOTTOMLEFT);
gtk_render_handle (context, cr, 12, 48, 12, 12);
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_CORNER_BOTTOMRIGHT);
gtk_render_handle (context, cr, 40, 48, 12, 12);
gtk_style_context_restore (context);
return TRUE;
}
static char *what;
static gboolean
@ -324,6 +349,8 @@ draw_cb (GtkWidget *widget, cairo_t *cr)
return draw_cb_extension (widget, cr);
else if (strcmp (what, "frame-gap") == 0)
return draw_cb_frame_gap (widget, cr);
else if (strcmp (what, "handle") == 0)
return draw_cb_handles (widget, cr);
return FALSE;
}