From 9617109822e582ed948195be00dbdc5fd5ed9e34 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Mon, 21 Jun 2010 14:05:28 +0300 Subject: Do not add items that don't have a icon to the touchselector examples The newly added hildon stock items don't have a corresponding icon, so they shouldn't be added to the touchselector in these examples. --- examples/hildon-touch-selector-example.c | 8 +++++--- examples/hildon-touch-selector-normal-mode-example.c | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/hildon-touch-selector-example.c b/examples/hildon-touch-selector-example.c index 996c5fe..21104f9 100644 --- a/examples/hildon-touch-selector-example.c +++ b/examples/hildon-touch-selector-example.c @@ -66,9 +66,11 @@ create_selector () for (item = icon_list; item; item = g_slist_next (item)) { GtkTreeIter iter; gchar *label = item->data; - - gtk_list_store_append (store_icons, &iter); - gtk_list_store_set (store_icons, &iter, 0, label, -1); + if (gtk_style_lookup_icon_set (gtk_widget_get_style (selector), + label)) { + gtk_list_store_append (store_icons, &iter); + gtk_list_store_set (store_icons, &iter, 0, label, -1); + } g_free (label); } g_slist_free (icon_list); diff --git a/examples/hildon-touch-selector-normal-mode-example.c b/examples/hildon-touch-selector-normal-mode-example.c index 4dd5bae..52e56d9 100644 --- a/examples/hildon-touch-selector-normal-mode-example.c +++ b/examples/hildon-touch-selector-normal-mode-example.c @@ -78,8 +78,11 @@ create_selector () GtkTreeIter iter; gchar *label = item->data; - gtk_list_store_append (store_icons, &iter); - gtk_list_store_set (store_icons, &iter, 0, label, -1); + if (gtk_style_lookup_icon_set (gtk_widget_get_style (selector), + label)) { + gtk_list_store_append (store_icons, &iter); + gtk_list_store_set (store_icons, &iter, 0, label, -1); + } g_free (label); } g_slist_free (icon_list); -- cgit v1.2.3-18-g5258