hermet pushed a commit to branch master.
http://git.enlightenment.org/tools/enventor.git/commit/?id=ab8dc5f3eda2b1bfa07c04d7f0ff0c2807da0c01
commit ab8dc5f3eda2b1bfa07c04d7f0ff0c2807da0c01
Author: Hermet Park
Date: Tue Feb 9 15:32:42 2016 +0900
ui: improve editor ctxpopup.
remove a entry in the editor ctxpopup.
we don't need to display entry anymore
since the changes is simulteniously applied into the editor text.
---
data/themes/default/layout_common.edc | 19 ++---
src/lib/ctxpopup.c| 78 +++
2 files changed, 10 insertions(+), 87 deletions(-)
diff --git a/data/themes/default/layout_common.edc
b/data/themes/default/layout_common.edc
index 2355fc7..9b0bec7 100644
--- a/data/themes/default/layout_common.edc
+++ b/data/themes/default/layout_common.edc
@@ -1595,7 +1595,7 @@ group { name: "slider_layout";
type: RECT;
scale: 1;
description { state: "default" 0.0;
-min: 240 1;
+min: 215 1;
color: 56 56 56 255;
}
description { state: "odd" 0.0;
@@ -1709,26 +1709,15 @@ group { name: "slider_layout";
rel1.relative: 1.0 0.0;
rel2.relative: 1.0 1.0;
align: 0.0 0.5;
-min: 5 0;
+min: 0 0;
fixed: 1 0;
}
}
- part { name: "elm.swallow.entry";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
-rel1.to_x: "padding2";
-rel2.to_x: "elm.swallow.down";
-rel2.relative: 0 1;
-align: 1 0.5;
-max: 30 99;
- }
- }
part { name: "elm.swallow.down";
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
-min: 10 20;
+min: 20 20;
fixed: 1 1;
align: 1.0 0.5;
rel1.to: "elm.swallow.up";
@@ -1741,7 +1730,7 @@ group { name: "slider_layout";
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
-min: 10 20;
+min: 20 20;
fixed: 1 1;
align: 1.0 0.5;
rel1.relative: 1.0 0.5;
diff --git a/src/lib/ctxpopup.c b/src/lib/ctxpopup.c
index cbb27ef..93e5774 100644
--- a/src/lib/ctxpopup.c
+++ b/src/lib/ctxpopup.c
@@ -63,12 +63,8 @@ static void
slider_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
ctxpopup_data *ctxdata = data;
- Evas_Object *entry = evas_object_data_get(obj, "entry");
double val = elm_slider_value_get(obj);
char buf[128];
- if (ctxdata->integer) snprintf(buf, sizeof(buf), "%1.0f", val);
- else snprintf(buf, sizeof(buf), "%1.2f", val);
- elm_object_text_set(entry, buf);
Evas_Object *box = elm_object_content_get(ctxdata->ctxpopup);
Eina_List *box_children = elm_box_children_get(box);
@@ -108,15 +104,6 @@ slider_changed_cb(void *data, Evas_Object *obj, void
*event_info EINA_UNUSED)
ctxdata->animator = ecore_animator_add(changed_animator_cb, ctxdata);
}
-static Eina_Bool
-slider_changed_animator_cb(void *data)
-{
- ctxpopup_data *ctxdata = data;
- ctxdata->animator = NULL;
- slider_changed_cb(data, ctxdata->slider, NULL);
- return ECORE_CALLBACK_CANCEL;
-}
-
static void
btn_up_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
@@ -124,20 +111,12 @@ btn_up_cb(void *data, Evas_Object *obj, void *event_info
EINA_UNUSED)
Evas_Object *layout = (Evas_Object *)evas_object_data_get(obj, "layout");
Evas_Object *slider = elm_object_part_content_get(layout,
"elm.swallow.slider");
- Evas_Object *entry = elm_object_part_content_get(layout,
-"elm.swallow.entry");
double value = elm_slider_value_get(slider);
- char buf[128];
if (ctxdata->attr->type & ATTR_VALUE_INTEGER) value += 1;
else value += 0.01;
-
- if (ctxdata->integer) snprintf(buf, sizeof(buf), "%1.0f", value);
- else snprintf(buf, sizeof(buf), "%1.2f", value);
- elm_object_text_set(entry, buf);
-
- ctxdata->slider = slider;
- ctxdata->animator = ecore_animator_add(slider_changed_animator_cb, ctxdata);
+ elm_slider_value_set(slider, value);
+ slider_changed_cb(ctxdata, ctxdata->slider, NULL);
}
static void
@@ -147,24 +126,14 @@ btn_down_cb(void *data, Evas_Object *obj, void
*event_info EINA_UNUSED)
Evas_Object *layout = (Evas_Object *)evas_object_data_get(obj, "layout");
Evas_Object *slider = elm_object_part_content_get(layout,
"elm.swallow.slider");
- Evas_Object *entry = elm_object_part_content_get(layout,
-"elm.swallow.entry");
double value = elm_slider_value_get(slider);
- char buf[128];
if (ctxdata->attr->type &