summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-10 00:28:18 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-10 00:28:18 +0900
commit240365b3eabc540784545bbf51be5bc4ebe55cad (patch)
tree4570050fc2db5af60942273cdaf05f335bc411a0
parentb0cca8b0dfac1776f0b226b4d3958c075a7365b9 (diff)
theme options - make sure current theme is hilighted.
-rw-r--r--src/bin/options_theme.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/bin/options_theme.c b/src/bin/options_theme.c
index 81239df..eb077af 100644
--- a/src/bin/options_theme.c
+++ b/src/bin/options_theme.c
@@ -87,6 +87,7 @@ options_theme(Evas_Object *opbox, Evas_Object *term)
87 Eina_List *files; 87 Eina_List *files;
88 char buf[4096], *file; 88 char buf[4096], *file;
89 Theme *t; 89 Theme *t;
90 Config *config = termio_config_get(term);
90 91
91 options_theme_clear(); 92 options_theme_clear();
92 93
@@ -123,13 +124,30 @@ options_theme(Evas_Object *opbox, Evas_Object *term)
123 124
124 EINA_LIST_FREE(files, file) 125 EINA_LIST_FREE(files, file)
125 { 126 {
126 t = calloc(1, sizeof(Theme)); 127 const char *ext = strchr(file, '.');
127 t->name = eina_stringshare_add(file); 128
128 t->term = term; 129 if ((config) && (!file[0] != '.') &&
129 t->item = elm_genlist_item_append(o, it_class, t, NULL, 130 ((ext) && (!strcasecmp(".edj", ext))))
130 ELM_GENLIST_ITEM_NONE, 131 {
131 _cb_op_theme_sel, t); 132 t = calloc(1, sizeof(Theme));
132 themes = eina_list_append(themes, t); 133 t->name = eina_stringshare_add(file);
134 t->term = term;
135 t->item = elm_genlist_item_append(o, it_class, t, NULL,
136 ELM_GENLIST_ITEM_NONE,
137 _cb_op_theme_sel, t);
138 if (t->item)
139 {
140 themes = eina_list_append(themes, t);
141 if ((config->theme) &&
142 (!strcmp(config->theme, t->name)))
143 elm_genlist_item_selected_set(t->item, EINA_TRUE);
144 }
145 else
146 {
147 eina_stringshare_del(t->name);
148 free(t);
149 }
150 }
133 free(file); 151 free(file);
134 } 152 }
135 153