summaryrefslogtreecommitdiff
path: root/src/bin/options_colors.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-01-15 23:49:03 +0100
committerBoris Faure <billiob@gmail.com>2018-01-15 23:49:03 +0100
commit527859f4c409a5e9c7a7ba62e4248de2a4702426 (patch)
tree5ee6e576962ecc91cea602fd21681ee14c0acbe8 /src/bin/options_colors.c
parent8c09ee5c88069d8f343913f62688aade0a038131 (diff)
options_colors: fix selected item showing on multiple rows
makes the selector barely more usableā€¦
Diffstat (limited to 'src/bin/options_colors.c')
-rw-r--r--src/bin/options_colors.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/bin/options_colors.c b/src/bin/options_colors.c
index 192c224..f3b56a8 100644
--- a/src/bin/options_colors.c
+++ b/src/bin/options_colors.c
@@ -45,6 +45,10 @@ _cb_op_color_item_sel(void *data,
45 int r = 0, g = 0, b = 0, a = 0; 45 int r = 0, g = 0, b = 0, a = 0;
46 int i, j; 46 int i, j;
47 47
48 if (ctx->curitem == it)
49 return;
50 if (ctx->curitem)
51 elm_colorselector_palette_item_selected_set(ctx->curitem, EINA_FALSE);
48 ctx->curitem = it; 52 ctx->curitem = it;
49 elm_colorselector_palette_item_color_get(it, &r, &g, &b, &a); 53 elm_colorselector_palette_item_color_get(it, &r, &g, &b, &a);
50 elm_colorselector_color_set(ctx->colorsel, r, g, b, a); 54 elm_colorselector_color_set(ctx->colorsel, r, g, b, a);
@@ -147,6 +151,7 @@ _reset_config_colors(Colors_Ctx *ctx)
147 } 151 }
148} 152}
149 153
154
150static void 155static void
151_cb_op_reset(void *data, 156_cb_op_reset(void *data,
152 Evas_Object *_obj EINA_UNUSED, 157 Evas_Object *_obj EINA_UNUSED,
@@ -292,6 +297,11 @@ options_colors(Evas_Object *opbox, Evas_Object *term, Evas_Object *bg)
292 config->colors[(j * 12) + i].b, 297 config->colors[(j * 12) + i].b,
293 config->colors[(j * 12) + i].a); 298 config->colors[(j * 12) + i].a);
294 ctx->colitem[j][i] = it; 299 ctx->colitem[j][i] = it;
300 if (i == 0 && j == 0)
301 {
302 ctx->curitem = ctx->colitem[0][0];
303 elm_colorselector_palette_item_selected_set(ctx->curitem, EINA_TRUE);
304 }
295 } 305 }
296 elm_box_pack_end(bx3, o); 306 elm_box_pack_end(bx3, o);
297 evas_object_show(o); 307 evas_object_show(o);
@@ -308,8 +318,6 @@ options_colors(Evas_Object *opbox, Evas_Object *term, Evas_Object *bg)
308 } 318 }
309 } 319 }
310 320
311 ctx->curitem = ctx->colitem[0][0];
312
313 bx2 = o = elm_box_add(opbox); 321 bx2 = o = elm_box_add(opbox);
314 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 322 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
315 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0); 323 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
@@ -330,7 +338,7 @@ options_colors(Evas_Object *opbox, Evas_Object *term, Evas_Object *bg)
330 evas_object_show(o); 338 evas_object_show(o);
331 339
332 ctx->colorsel = o = elm_colorselector_add(opbox); 340 ctx->colorsel = o = elm_colorselector_add(opbox);
333 elm_colorselector_palette_item_color_get(ctx->colitem[0][0], &r, &g, &b, &a); 341 elm_colorselector_palette_item_color_get(ctx->curitem, &r, &g, &b, &a);
334 elm_colorselector_color_set(o, r, g, b, a); 342 elm_colorselector_color_set(o, r, g, b, a);
335 elm_colorselector_mode_set(o, ELM_COLORSELECTOR_COMPONENTS); 343 elm_colorselector_mode_set(o, ELM_COLORSELECTOR_COMPONENTS);
336 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 344 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);