summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/options_elm.c72
-rw-r--r--src/bin/win.c4
2 files changed, 73 insertions, 3 deletions
diff --git a/src/bin/options_elm.c b/src/bin/options_elm.c
index f48b6f3..fa9689c 100644
--- a/src/bin/options_elm.c
+++ b/src/bin/options_elm.c
@@ -15,10 +15,37 @@ launch_elm_config(void *_data EINA_UNUSED,
15 ecore_exe_free(exe); 15 ecore_exe_free(exe);
16} 16}
17 17
18static void
19_scale_round(void *data EINA_UNUSED,
20 Evas_Object *obj,
21 void *event_info EINA_UNUSED)
22{
23 double val = elm_slider_value_get(obj);
24 double v;
25
26 v = ((double)((int)(val * 10.0))) / 10.0;
27 if (v != val) elm_slider_value_set(obj, v);
28}
29
30static void
31_scale_change(void *data EINA_UNUSED,
32 Evas_Object *obj,
33 void *event_info EINA_UNUSED)
34{
35 double scale = elm_config_scale_get();
36 double val = elm_slider_value_get(obj);
37
38 if (scale == val)
39 return;
40 elm_config_scale_set(val);
41 elm_config_all_flush();
42}
43
18void 44void
19options_elm(Evas_Object *opbox, Evas_Object *_term EINA_UNUSED) 45options_elm(Evas_Object *opbox, Evas_Object *_term EINA_UNUSED)
20{ 46{
21 Evas_Object *o, *fr, *bx, *bt, *en; 47 Evas_Object *o, *fr, *bx, *bt, *en, *lbl, *sl, *sp;
48 const char *txt;
22 49
23 fr = o = elm_frame_add(opbox); 50 fr = o = elm_frame_add(opbox);
24 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 51 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -48,4 +75,47 @@ options_elm(Evas_Object *opbox, Evas_Object *_term EINA_UNUSED)
48 elm_layout_text_set(bt, NULL, _("Launch elementary_config")); 75 elm_layout_text_set(bt, NULL, _("Launch elementary_config"));
49 elm_box_pack_end(bx, bt); 76 elm_box_pack_end(bx, bt);
50 evas_object_show(bt); 77 evas_object_show(bt);
78
79 sp = elm_separator_add(opbox);
80 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
81 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
82 elm_separator_horizontal_set(sp, EINA_TRUE);
83 elm_box_pack_end(bx, sp);
84 evas_object_show(sp);
85
86 lbl = elm_label_add(opbox);
87 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0);
88 evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, 0.5);
89 txt = eina_stringshare_printf("<hilight>%s</>",_("Scale"));
90 elm_object_text_set(lbl, txt);
91 eina_stringshare_del(txt);
92 elm_box_pack_end(bx, lbl);
93 evas_object_show(lbl);
94
95 sl = elm_slider_add(opbox);
96 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
97 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
98 elm_slider_span_size_set(sl, 120);
99 elm_slider_unit_format_set(sl, "%1.2f");
100 elm_slider_indicator_format_set(sl, "%1.2f");
101 elm_slider_min_max_set(sl, 0.25, 5.0);
102 elm_slider_value_set(sl, elm_config_scale_get());
103 elm_box_pack_end(bx, sl);
104 evas_object_show(sl);
105 evas_object_smart_callback_add(sl, "changed", _scale_round, NULL);
106 evas_object_smart_callback_add(sl, "delay,changed", _scale_change, NULL);
107
108 lbl = elm_label_add(opbox);
109 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0);
110 evas_object_size_hint_align_set(lbl, 0.0, 0.0);
111 elm_object_text_set(lbl, _("Select prefered size so that this text is readable."));
112 elm_box_pack_end(bx, lbl);
113 evas_object_show(lbl);
114
115 lbl = elm_label_add(opbox);
116 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0);
117 evas_object_size_hint_align_set(lbl, 0.0, 0.0);
118 elm_object_text_set(lbl, _("The scale configuration can also be changed through <hilight>elementary</hilight>'s configuration panel."));
119 elm_box_pack_end(bx, lbl);
120 evas_object_show(lbl);
51} 121}
diff --git a/src/bin/win.c b/src/bin/win.c
index 0ec73ae..ae330ea 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -322,14 +322,14 @@ win_scale_wizard(Evas_Object *win, Term *term)
322 lbl = elm_label_add(win); 322 lbl = elm_label_add(win);
323 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0); 323 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0);
324 evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, 0.5); 324 evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, 0.5);
325 elm_object_text_set(lbl, _("Select prefered size so that is text is readable")); 325 elm_object_text_set(lbl, _("Select prefered size so that this text is readable."));
326 elm_box_pack_end(bx, lbl); 326 elm_box_pack_end(bx, lbl);
327 evas_object_show(lbl); 327 evas_object_show(lbl);
328 328
329 lbl = elm_label_add(win); 329 lbl = elm_label_add(win);
330 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0); 330 evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, 0.0);
331 evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, 0.5); 331 evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, 0.5);
332 elm_object_text_set(lbl, _("The scale configuration can be changed in the Settings (right click on the terminal) → Toolkit, or by starting the command <keyword>elementary_config</keyword>")); 332 elm_object_text_set(lbl, _("The scale configuration can be changed in the Settings (right click on the terminal) → Toolkit, or by starting the command <keyword>elementary_config</keyword>."));
333 elm_box_pack_end(bx, lbl); 333 elm_box_pack_end(bx, lbl);
334 evas_object_show(lbl); 334 evas_object_show(lbl);
335 335