- cairo_pattern_t *gradient;
- cairo_text_extents_t extents;
- int rad = (int) MIN (item->width / 2, item->height / 2);
- int cx = item->x + item->width / 2;
- int cy = item->y + item->height / 2;
- double spot_angle = M_PI / 4.0;
- double spot_rad = rad / 2.0;
- char string[2];
-
- cairo_save (cr);
-
- gradient = cairo_pattern_create_radial (cx - spot_rad * cos (spot_angle),
- cy - spot_rad * sin (spot_angle),
- 0.0,
- cx - spot_rad * cos (spot_angle),
- cy - spot_rad * sin (spot_angle),
- rad + spot_rad);
- cairo_pattern_add_color_stop_rgb (gradient, 0.0, 1.0, 1.0, 1.0);
- cairo_pattern_add_color_stop_rgb (gradient, 1.0, 0.33, 0.33, 0.33);
-
- cairo_set_source (cr, gradient);
-
- cairo_arc (cr,
- cx, cy,
- rad, 0, 2 * M_PI);
-
- cairo_fill (cr);
-
- cairo_select_font_face (cr, "mono",
- CAIRO_FONT_SLANT_NORMAL,
- CAIRO_FONT_WEIGHT_BOLD);
- cairo_set_font_size (cr, 1.8 * rad);
-
- string[0] = item->letter;
- string[1] = '\0';
- cairo_text_extents (cr, string, &extents);
- cairo_move_to (cr,
- cx - extents.width / 2 - extents.x_bearing,
- cy - extents.height / 2 - extents.y_bearing);
-
- cairo_set_source_rgb (cr, 0.2, 0.3, 0.8);
- cairo_show_text (cr, string);
-
-
- cairo_restore (cr);