[gnome-color-manager] trivial: actually show the optional image in the calibration wizard
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: actually show the optional image in the calibration wizard
- Date: Wed, 1 Jun 2011 15:40:50 +0000 (UTC)
commit fd282c1bc1d6e2f5c607c348dc56e171c8173c96
Author: Richard Hughes <richard hughsie com>
Date: Wed Jun 1 15:07:28 2011 +0100
trivial: actually show the optional image in the calibration wizard
src/gcm-calibrate-main.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/gcm-calibrate-main.c b/src/gcm-calibrate-main.c
index 2c562c3..04bb78d 100644
--- a/src/gcm-calibrate-main.c
+++ b/src/gcm-calibrate-main.c
@@ -1701,10 +1701,22 @@ gcm_calib_image_changed_cb (GcmCalibrate *calibrate,
const gchar *filename,
GcmCalibratePriv *calib)
{
+ gchar *path;
+ GdkPixbuf *pixbuf;
+ GError *error;
+
if (filename != NULL) {
- gtk_image_set_from_file (GTK_IMAGE (calib->action_image),
- filename);
- gtk_widget_show (calib->action_image);
+ path = g_build_filename (GCM_DATA, "icons", filename, NULL);
+ pixbuf = gdk_pixbuf_new_from_file_at_size (path, 200, 400, &error);
+ if (pixbuf == NULL) {
+ g_warning ("failed to load image: %s", error->message);
+ g_error_free (error);
+ gtk_widget_hide (calib->action_image);
+ } else {
+ gtk_image_set_from_pixbuf (GTK_IMAGE (calib->action_image), pixbuf);
+ gtk_widget_show (calib->action_image);
+ }
+ g_free (path);
} else {
gtk_widget_hide (calib->action_image);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]