From 4a5c6b78909d4950585a4c5dc7d7a808d1e3f807 Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Wed, 2 Dec 2009 11:09:01 -0500 Subject: Use stock icon for configuration --- src/config.svg | 1080 ------------------------------------------------------- src/keyboard.py | 28 +- 2 files changed, 5 insertions(+), 1103 deletions(-) delete mode 100644 src/config.svg diff --git a/src/config.svg b/src/config.svg deleted file mode 100644 index 1df3bf3..0000000 --- a/src/config.svg +++ /dev/null @@ -1,1080 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - keyboard - settings - properties - set - - - - - Jakub Steiner - - - 2006-10-06 - www.gnome.org - - - - - - - - - - - - - - - - - - - diff --git a/src/keyboard.py b/src/keyboard.py index 4d56d7d..47c8ccd 100644 --- a/src/keyboard.py +++ b/src/keyboard.py @@ -53,30 +53,12 @@ class CaribouKeyboard(gtk.Frame): if isinstance(key, str): if key == "cf": # configuration key - # FIXME scale based on size of other buttons - scaleFactor = 0.5 - # FIXME catch "RuntimeError: unknown librsvg error" for file not found - # FIXME use broken image when file not found - svg = rsvg.Handle("config.svg") - surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, - int(round(svg.props.width * scaleFactor)), - int(round(svg.props.height * scaleFactor))) - cr = cairo.Context(surface) - cr.scale(scaleFactor, scaleFactor) - svg.render_cairo(cr) - cfg = gtk.Image() - data = surface.get_data() - pixbuf = gtk.gdk.pixbuf_new_from_data(data, - gtk.gdk.COLORSPACE_RGB, - True, - 8, - int(round(svg.props.width * scaleFactor)), - int(round(svg.props.height * scaleFactor)), - int(round(svg.props.width * scaleFactor * 4))) - cfg.set_from_pixbuf(pixbuf) button = gtk.Button() - button.set_image(cfg) - button.set_name("configuration") + image = gtk.image_new_from_pixbuf( + button.render_icon(gtk.STOCK_PREFERENCES, + gtk.ICON_SIZE_BUTTON)) + button.set_image(image) + button.set_name ("configuration") switch_buttons.append(button) else: # single utf-8 character key -- cgit v1.2.1