summaryrefslogtreecommitdiff
path: root/src/bin/options_colors.c
diff options
context:
space:
mode:
authorWonguk Jeong <wonguk.jeong@samsung.com>2014-08-25 19:49:43 +0200
committerWonguk Jeong <wonguk.jeong@samsung.com>2014-08-25 19:51:14 +0200
commita25b27e232b3a68104bd20b4ac420b511ddcc05f (patch)
treeb39ec91c4b2611044f6cbf0a21fcac4286fdbbb1 /src/bin/options_colors.c
parent8b2a3aa8381895fc9512e807e6d55ae9704629a2 (diff)
options: color picker added
Fixes T1032
Diffstat (limited to 'src/bin/options_colors.c')
-rw-r--r--src/bin/options_colors.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/options_colors.c b/src/bin/options_colors.c
index d8030f6..2de27c1 100644
--- a/src/bin/options_colors.c
+++ b/src/bin/options_colors.c
@@ -25,6 +25,7 @@ static const char *mapping_names[] =
25 25
26static Elm_Object_Item *colitem[4][11] = { { NULL } }; 26static Elm_Object_Item *colitem[4][11] = { { NULL } };
27static Evas_Object *colorsel = NULL; 27static Evas_Object *colorsel = NULL;
28static Evas_Object *colorpicker = NULL;
28static Elm_Object_Item *curitem = NULL; 29static Elm_Object_Item *curitem = NULL;
29static Evas_Object *colpal[4] = { NULL }; 30static Evas_Object *colpal[4] = { NULL };
30static Evas_Object *label = NULL, *reset = NULL; 31static Evas_Object *label = NULL, *reset = NULL;
@@ -39,6 +40,7 @@ _cb_op_use_custom_chg(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA
39 40
40 state = elm_check_state_get(obj); 41 state = elm_check_state_get(obj);
41 elm_object_disabled_set(colorsel, !state); 42 elm_object_disabled_set(colorsel, !state);
43 elm_object_disabled_set(colorpicker, !state);
42 for (i = 0; i < 4; i++) elm_object_disabled_set(colpal[i], !state); 44 for (i = 0; i < 4; i++) elm_object_disabled_set(colpal[i], !state);
43 elm_object_disabled_set(label, !state); 45 elm_object_disabled_set(label, !state);
44 config->colors_use = state; 46 config->colors_use = state;
@@ -56,6 +58,7 @@ _cb_op_color_item_sel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
56 curitem = it; 58 curitem = it;
57 elm_colorselector_palette_item_color_get(it, &r, &g, &b, &a); 59 elm_colorselector_palette_item_color_get(it, &r, &g, &b, &a);
58 elm_colorselector_color_set(colorsel, r, g, b, a); 60 elm_colorselector_color_set(colorsel, r, g, b, a);
61 elm_colorselector_color_set(colorpicker, r, g, b, a);
59 for (j = 0; j < 4; j++) 62 for (j = 0; j < 4; j++)
60 { 63 {
61 for (i = 0; i < 11; i++) 64 for (i = 0; i < 11; i++)
@@ -76,6 +79,10 @@ _cb_op_color_chg(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUS
76 79
77 elm_colorselector_palette_item_color_get(curitem, &rr, &gg, &bb, &aa); 80 elm_colorselector_palette_item_color_get(curitem, &rr, &gg, &bb, &aa);
78 elm_colorselector_color_get(obj, &r, &g, &b, &a); 81 elm_colorselector_color_get(obj, &r, &g, &b, &a);
82 if (obj == colorsel)
83 elm_colorselector_color_set(colorpicker, r, g, b, a);
84 else
85 elm_colorselector_color_set(colorsel, r, g, b, a);
79 if ((r != rr) || (g != gg) || (b != bb) || (a != aa)) 86 if ((r != rr) || (g != gg) || (b != bb) || (a != aa))
80 { 87 {
81 if (curitem) 88 if (curitem)
@@ -133,6 +140,7 @@ _cb_op_reset(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event E
133 elm_object_disabled_set(reset, EINA_TRUE); 140 elm_object_disabled_set(reset, EINA_TRUE);
134 elm_colorselector_palette_item_color_get(curitem, &r, &g, &b, &a); 141 elm_colorselector_palette_item_color_get(curitem, &r, &g, &b, &a);
135 elm_colorselector_color_set(colorsel, r, g, b, a); 142 elm_colorselector_color_set(colorsel, r, g, b, a);
143 elm_colorselector_color_set(colorpicker, r, g, b, a);
136 termio_config_update(term); 144 termio_config_update(term);
137 config_save(config, NULL); 145 config_save(config, NULL);
138} 146}
@@ -250,6 +258,15 @@ options_colors(Evas_Object *opbox, Evas_Object *term)
250 evas_object_show(o); 258 evas_object_show(o);
251 evas_object_smart_callback_add(o, "changed", _cb_op_color_chg, term); 259 evas_object_smart_callback_add(o, "changed", _cb_op_color_chg, term);
252 260
261 colorpicker = o = elm_colorselector_add(opbox);
262 elm_colorselector_color_set(o, r, g, b, a);
263 elm_colorselector_mode_set(o, ELM_COLORSELECTOR_PICKER);
264 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
265 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
266 elm_box_pack_end(bx2, o);
267 evas_object_show(o);
268 evas_object_smart_callback_add(o, "changed", _cb_op_color_chg, term);
269
253 bx4 = o = elm_box_add(opbox); 270 bx4 = o = elm_box_add(opbox);
254 elm_box_horizontal_set(o, EINA_TRUE); 271 elm_box_horizontal_set(o, EINA_TRUE);
255 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 272 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);