summaryrefslogtreecommitdiff
path: root/src/bin/options_font.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-06-18 07:43:44 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-18 07:43:44 +0000
commit4ea4ab4d326b33ae53740e59b7eafbd6394e1e11 (patch)
treed9ecdc89eafaac771125f0b4bb530f5dfb863f5d /src/bin/options_font.c
parenta97e4a87637125d7d7a0eef4b119c7a246282ae3 (diff)
use new item styles for genlist and make font preview wide.
SVN revision: 72366
Diffstat (limited to 'src/bin/options_font.c')
-rw-r--r--src/bin/options_font.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/bin/options_font.c b/src/bin/options_font.c
index b15a3ed..6c1f780 100644
--- a/src/bin/options_font.c
+++ b/src/bin/options_font.c
@@ -108,12 +108,11 @@ _cb_op_font_preview_eval(void *data, Evas *e, Evas_Object *obj, void *event)
108 evas_output_viewport_get(evas_object_evas_get(obj), &vx, &vy, &vw, &vh); 108 evas_output_viewport_get(evas_object_evas_get(obj), &vx, &vy, &vw, &vh);
109 if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, vx, vy, vw, vh)) 109 if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, vx, vy, vw, vh))
110 { 110 {
111// printf("text: %i %i %ix%i visible: %i in canvas for %s\n",
112// ox, oy, ow, oh, f->name);
111 o = evas_object_text_add(evas_object_evas_get(obj)); 113 o = evas_object_text_add(evas_object_evas_get(obj));
112 evas_object_color_set(o, 0, 0, 0, 255); 114 evas_object_color_set(o, 0, 0, 0, 255);
113 if (evas_object_data_get(obj, "_f")) 115 evas_object_text_text_set(o, "Abc 123 $@#");
114 evas_object_text_text_set(o, "Abc");
115 else
116 evas_object_text_text_set(o, "123");
117 if (f->bitmap) 116 if (f->bitmap)
118 { 117 {
119 snprintf(buf, sizeof(buf), "%s/fonts/%s", 118 snprintf(buf, sizeof(buf), "%s/fonts/%s",
@@ -133,8 +132,7 @@ static Evas_Object *
133_cb_op_font_content_get(void *data, Evas_Object *obj, const char *part) 132_cb_op_font_content_get(void *data, Evas_Object *obj, const char *part)
134{ 133{
135 Font *f = data; 134 Font *f = data;
136 if ((!strcmp(part, "elm.swallow.icon")) || 135 if (!strcmp(part, "elm.swallow.icon"))
137 (!strcmp(part, "elm.swallow.end")))
138 { 136 {
139 Evas_Object *o; 137 Evas_Object *o;
140 char buf[4096]; 138 char buf[4096];
@@ -147,7 +145,7 @@ _cb_op_font_content_get(void *data, Evas_Object *obj, const char *part)
147 edje_object_signal_callback_add(o, "edje,change,file", "edje", 145 edje_object_signal_callback_add(o, "edje,change,file", "edje",
148 _reload_theme, NULL); 146 _reload_theme, NULL);
149 evas_object_size_hint_min_set(o, 147 evas_object_size_hint_min_set(o,
150 40 * elm_config_scale_get(), 148 96 * elm_config_scale_get(),
151 40 * elm_config_scale_get()); 149 40 * elm_config_scale_get());
152 evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, 150 evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
153 _cb_op_font_preview_eval, f); 151 _cb_op_font_preview_eval, f);
@@ -157,8 +155,6 @@ _cb_op_font_content_get(void *data, Evas_Object *obj, const char *part)
157 _cb_op_font_preview_eval, f); 155 _cb_op_font_preview_eval, f);
158 evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, 156 evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
159 _cb_op_font_preview_del, f); 157 _cb_op_font_preview_del, f);
160 if (!strcmp(part, "elm.swallow.icon"))
161 evas_object_data_set(o, "_f", o);
162 return o; 158 return o;
163 } 159 }
164 return NULL; 160 return NULL;
@@ -244,7 +240,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
244 evas_object_show(bx); 240 evas_object_show(bx);
245 241
246 it_class = elm_genlist_item_class_new(); 242 it_class = elm_genlist_item_class_new();
247 it_class->item_style = "default"; 243 it_class->item_style = "end_icon";
248 it_class->func.text_get = _cb_op_font_text_get; 244 it_class->func.text_get = _cb_op_font_text_get;
249 it_class->func.content_get = _cb_op_font_content_get; 245 it_class->func.content_get = _cb_op_font_content_get;
250 246