Postings tagged with Graphics
Application Theming Tricks
From time to time applications need custom theming rules. Especially when the project has professional UI designers involved. So how to achieve this with GTK+?
Trivial Theming
Most easy and very wrong:
if (gdk_color_parse ("pink", &color))
gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &color);
This will break and look childish as soon as your users use a custom color scheme.
Better:
static void
style_set_cb (GtkWidget *widget,
GtkStyle *old_style)
{
GtkStyle *style = gtk_widget_get_style (widget);
if (gtk_style_lookup_color (style, "SecondaryTextColor", &color))
...
Blur Effect with cairo
Wondered how to apply convolution filters, like for instance gaussian blur in cairo. Doesn't seem to be possible yet. Well, unless you remember that cairo uses pixman as backend for its image surface. Result of my hacks below:
The code is in the blur_image_surface() function of blur-effect.c. Now the question is how to make a nice cairo ...
Canvas Review
As announced by Murray already I am working for Openismus now. First task I got assigned was providing patches for some binding glitches in GooCanvas. Seems I complained too much about GooCanvas' code during that task. So Murray asked me to review GooCanvas, HippoCanvas and libccc to figure out which canvas would fit best for diagrams and reports in Glom.
As we have that nice canvas overview on the GNOME Wiki already, I added additional information to that wiki page. Thank you Emmanuele for updating the clutter records, btw. ...