}
}
}
+
+group { name: "elm/button/base/colorselector/left/default";
+ images {
+ image: "bt_base1.png" COMP;
+ image: "bt_base2.png" COMP;
+ image: "bt_hilight.png" COMP;
+ image: "bt_shine.png" COMP;
+ image: "bt_glow.png" COMP;
+ image: "bt_dis_base.png" COMP;
+ image: "bt_dis_hilight.png" COMP;
+ image: "sp_bt_l.png" COMP;
+ }
+ parts {
+ part { name: "button_image";
+ mouse_events: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ image {
+ normal: "bt_base2.png";
+ border: 7 7 7 7;
+ }
+ image.middle: SOLID;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "bt_base1.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "bt_dis_base.png";
+ border: 4 4 4 4;
+ }
+ }
+ }
+ part { name: "prev_image";
+ type: IMAGE;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ image.normal: "sp_bt_l.png";
+ }
+ }
+ part { name: "over1";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel2.relative: 1.0 0.5;
+ image {
+ normal: "bt_hilight.png";
+ border: 7 7 7 0;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "bt_dis_hilight.png";
+ border: 4 4 4 0;
+ }
+ }
+ }
+ part { name: "over2";
+ mouse_events: 1;
+ repeat_events: 1;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ image {
+ normal: "bt_shine.png";
+ border: 7 7 7 7;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "over3";
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 255 255 255 0;
+ image {
+ normal: "bt_glow.png";
+ border: 12 12 12 12;
+ }
+ fill.smooth : 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "disabler";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "button_click";
+ signal: "mouse,down,1";
+ source: "over2";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ after: "button_click_anim";
+ }
+ program {
+ name: "button_click_anim";
+ action: STATE_SET "clicked" 0.0;
+ target: "button_image";
+ }
+ program {
+ name: "button_unclick";
+ signal: "mouse,up,1";
+ source: "over3";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ after: "button_unclick_anim";
+ }
+ program {
+ name: "button_pressed_anim";
+ signal: "elm,anim,activate";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "button_image";
+ target: "over3";
+ after: "button_unpressed_anim";
+ }
+ program {
+ name: "button_unpressed_anim";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "button_image";
+ target: "over3";
+ }
+ program {
+ name: "button_unclick_anim";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ }
+ program {
+ name: "button_click2";
+ signal: "mouse,down,1";
+ source: "over3";
+ action: STATE_SET "clicked" 0.0;
+ target: "over3";
+ }
+ program {
+ name: "button_unclick2";
+ signal: "mouse,up,1";
+ source: "over3";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "over3";
+ }
+ program {
+ name: "button_unclick3";
+ signal: "mouse,clicked,1";
+ source: "over2";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program { name: "disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "button_image";
+ target: "over1";
+ target: "over2";
+ target: "disabler";
+ }
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ target: "over1";
+ target: "over2";
+ target: "disabler";
+ }
+ }
+}
+
+group { name: "elm/button/base/colorselector/right/default";
+ images {
+ image: "bt_base1.png" COMP;
+ image: "bt_base2.png" COMP;
+ image: "bt_hilight.png" COMP;
+ image: "bt_shine.png" COMP;
+ image: "bt_glow.png" COMP;
+ image: "bt_dis_base.png" COMP;
+ image: "bt_dis_hilight.png" COMP;
+ image: "sp_bt_r.png" COMP;
+ }
+ parts {
+ part { name: "button_image";
+ mouse_events: 1;
+ description { state: "default" 0.0;
+ min: 15 15;
+ image {
+ normal: "bt_base2.png";
+ border: 7 7 7 7;
+ }
+ image.middle: SOLID;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "bt_base1.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "bt_dis_base.png";
+ border: 4 4 4 4;
+ }
+ }
+ }
+ part { name: "prev_image";
+ type: IMAGE;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 16 16;
+ max: 16 16;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ image.normal: "sp_bt_r.png";
+ }
+ }
+ part { name: "over1";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel2.relative: 1.0 0.5;
+ image {
+ normal: "bt_hilight.png";
+ border: 7 7 7 0;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "bt_dis_hilight.png";
+ border: 4 4 4 0;
+ }
+ }
+ }
+ part { name: "over2";
+ mouse_events: 1;
+ repeat_events: 1;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ image {
+ normal: "bt_shine.png";
+ border: 7 7 7 7;
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "over3";
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 255 255 255 0;
+ image {
+ normal: "bt_glow.png";
+ border: 12 12 12 12;
+ }
+ fill.smooth : 0;
+ }
+ description { state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "disabler";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "button_click";
+ signal: "mouse,down,1";
+ source: "over2";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ after: "button_click_anim";
+ }
+ program {
+ name: "button_click_anim";
+ action: STATE_SET "clicked" 0.0;
+ target: "button_image";
+ }
+ program {
+ name: "button_unclick";
+ signal: "mouse,up,1";
+ source: "over3";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ after: "button_unclick_anim";
+ }
+ program {
+ name: "button_pressed_anim";
+ signal: "elm,anim,activate";
+ source: "elm";
+ action: STATE_SET "clicked" 0.0;
+ target: "button_image";
+ target: "over3";
+ after: "button_unpressed_anim";
+ }
+ program {
+ name: "button_unpressed_anim";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "button_image";
+ target: "over3";
+ }
+ program {
+ name: "button_unclick_anim";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ }
+ program {
+ name: "button_click2";
+ signal: "mouse,down,1";
+ source: "over3";
+ action: STATE_SET "clicked" 0.0;
+ target: "over3";
+ }
+ program {
+ name: "button_unclick2";
+ signal: "mouse,up,1";
+ source: "over3";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "over3";
+ }
+ program {
+ name: "button_unclick3";
+ signal: "mouse,clicked,1";
+ source: "over2";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program { name: "disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "button_image";
+ target: "over1";
+ target: "over2";
+ target: "disabler";
+ }
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ target: "over1";
+ target: "over2";
+ target: "disabler";
+ }
+ }
+}
}
}
-group{ name: "elm/colorselector/image/colorbar_0";
+group{ name: "elm/colorselector/image/colorbar_0/default";
images {
image: "color_picker_color.png" COMP;
}
}
}
-group { name: "elm/colorselector/image/colorbar_1";
+group { name: "elm/colorselector/image/colorbar_1/default";
images {
image: "color_picker_opacity.png" COMP;
}
}
}
-group { name: "elm/colorselector/image/colorbar_2";
+group { name: "elm/colorselector/image/colorbar_2/default";
images {
image: "color_picker_brightness.png" COMP;
}
}
}
-group { name: "elm/colorselector/image/colorbar_3";
+group { name: "elm/colorselector/image/colorbar_3/default";
images {
image: "color_picker_alpha.png" COMP;
}
}
}
-group { name: "elm/colorselector/bg_image/colorbar_3";
+group { name: "elm/colorselector/bg_image/colorbar_3/default";
images {
image: "color_picker_alpha_bg.png" COMP;
}
}
}
-group { name: "elm/colorselector/image/updown";
+group { name: "elm/colorselector/arrow/default";
images {
image: "icon_arrow_down.png" COMP;
}
}
}
}
-
-group { name: "elm/colorselector/button/left";
- images {
- image: "bt_base1.png" COMP;
- image: "bt_shine.png" COMP;
- image: "sp_bt_l.png" COMP;
- }
- parts {
- part { name: "button_image";
- mouse_events: 1;
- description { state: "default" 0.0;
- image.normal: "bt_base1.png";
- image.border: 6 6 6 6;
- image.middle: SOLID;
- }
-
- description { state: "clicked" 0.0;
- inherit: "default" 0.0;
- image.normal: "bt_shine.png";
- image.border: 6 6 6 6;
- image.middle: SOLID;
- }
- }
- part { name: "btn_over";
- type: IMAGE;
- mouse_events: 0;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2 {
- relative: 1.0 0.5;
- to: "button_image";
- }
- image {
- normal: "bt_hilight.png";
- border: 7 7 7 0;
- }
- }
- }
- part { name: "btn_over2";
- type: IMAGE;
- mouse_events: 1;
- repeat_events: 1;
- ignore_flags: ON_HOLD;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- image {
- normal: "bt_shine.png";
- border: 7 7 7 7;
- }
- }
- }
- part { name: "focus_image";
- type: IMAGE;
- description { state: "default" 0.0;
- color: 255 255 255 0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- image {
- normal: "bt_glow.png";
- border: 12 12 12 12;
- }
- fill.smooth: 0;
-
- }
- description { state: "clicked" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 255;
- }
- }
- part { name: "left_arrow";
- mouse_events: 1;
- description { state: "default" 0.0;
- min: 16 16;
- max: 16 16;
- image.normal: "sp_bt_l.png";
- }
- }
- }
-
- programs {
- program {
- name: "button_down";
- signal: "elm,state,left,button,down";
- source: "left_button";
- action: STATE_SET "clicked" 0.0;
- target: "button_image";
- target: "focus_image";
- }
- program {
- name: "button_up";
- signal: "elm,state,left,button,up";
- source: "left_button";
- action: STATE_SET "default" 0.0;
- target: "button_image";
- target: "focus_image";
- }
- }
-}
-
-group { name: "elm/colorselector/button/right";
- images {
- image: "bt_base1.png" COMP;
- image: "bt_shine.png" COMP;
- image: "sp_bt_r.png" COMP;
- }
- parts {
- part { name: "button_image";
- mouse_events: 1;
- description { state: "default" 0.0;
- image.normal: "bt_base1.png";
- image.border: 6 6 6 6;
- image.middle: SOLID;
- }
-
- description { state: "clicked" 0.0;
- inherit: "default" 0.0;
- image.normal: "bt_shine.png";
- image.border: 6 6 6 6;
- image.middle: SOLID;
- }
- }
- part { name: "btn_over";
- type: IMAGE;
- mouse_events: 0;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2 {
- relative: 1.0 0.5;
- to: "button_image";
- }
- image {
- normal: "bt_hilight.png";
- border: 7 7 7 0;
- }
- }
- }
- part { name: "btn_over2";
- type: IMAGE;
- mouse_events: 1;
- repeat_events: 1;
- ignore_flags: ON_HOLD;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- image {
- normal: "bt_shine.png";
- border: 7 7 7 7;
- }
- }
- }
- part { name: "focus_image";
- type: IMAGE;
- description { state: "default" 0.0;
- color: 255 255 255 0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- image {
- normal: "bt_glow.png";
- border: 12 12 12 12;
- }
- fill.smooth: 0;
-
- }
- description { state: "clicked" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 255 255 255 255;
- }
- }
- part { name: "right_arrow";
- mouse_events: 1;
- description { state: "default" 0.0;
- min: 16 16;
- max: 16 16;
- image.normal: "sp_bt_r.png";
- }
- }
- }
-
- programs {
- program {
- name: "button_down";
- signal: "elm,state,right,button,down";
- source: "right_button";
- action: STATE_SET "clicked" 0.0;
- target: "button_image";
- target: "focus_image";
- }
- program {
- name: "button_up";
- signal: "elm,state,right,button,up";
- source: "right_button";
- action: STATE_SET "default" 0.0;
- target: "button_image";
- target: "focus_image";
- }
- }
-}
#define LIG_STEP 256.0
#define ALP_STEP 256.0
-typedef enum _Button_State
-{
- BUTTON_RELEASED,
- L_BUTTON_PRESSED,
- R_BUTTON_PRESSED
-} Button_State;
-
typedef enum _Color_Type
{
HUE,
Evas_Object *arrow;
Evas_Object *touch_area;
Color_Type color_type;
- Button_State button_state;
};
typedef struct _Widget_Data Widget_Data;
int sr, sg, sb;
int lr, lg, lb;
double h, s, l;
- Ecore_Timer *lp_timer;
- Ecore_Timer *mv_timer;
};
static const char *widtype = NULL;
static void _draw_rects(void *data, double x);
static void _arrow_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _colorbar_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static Eina_Bool _mv_timer(void *data);
-static Eina_Bool _long_press_timer(void *data);
-static void _left_button_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _right_button_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _left_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _right_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _left_button_clicked_cb(void *data, Evas_Object * obj, void *event_info);
+static void _left_button_repeat_cb(void *data, Evas_Object * obj, void *event_info);
+static void _right_button_clicked_cb(void *data, Evas_Object * obj, void *event_info);
+static void _right_button_repeat_cb(void *data, Evas_Object * obj, void *event_info);
static void _add_colorbar(Evas_Object *obj);
static void _set_color(Evas_Object *obj, int r, int g, int b, int a);
int i = 0;
if (!wd) return;
- if (wd->lp_timer) ecore_timer_del(wd->lp_timer);
- if (wd->mv_timer) ecore_timer_del(wd->mv_timer);
for (i = 0; i < 4; i++) free(wd->cp[i]);
free(wd);
}
}
_add_colorbar(obj);
+ elm_colorselector_color_set(obj, wd->r, wd->g, wd->b, wd->a);
_sizing_eval(obj);
}
evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, 0, NULL);
}
-static Eina_Bool
-_mv_timer(void *data)
-{
- Colorselector_Data *cp = data;
- Widget_Data *wd = elm_widget_data_get(cp->parent);
- double x, y;
-
- if (!wd) return EINA_FALSE;
-
- edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
- if (cp->button_state == L_BUTTON_PRESSED)
- {
- x -= 1.0 / BASE_STEP;
- if (x < 0.0) x = 0.0;
- edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
- _draw_rects(data, x);
- evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
- return EINA_TRUE;
- }
- else if (cp->button_state == R_BUTTON_PRESSED)
- {
- x += 1.0 / BASE_STEP;
- if (x > 1.0) x = 1.0;
- edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
- _draw_rects(data, x);
- evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
- return EINA_TRUE;
- }
- wd->mv_timer = NULL;
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_long_press_timer(void *data)
-{
- Colorselector_Data *cp = data;
- Widget_Data *wd = elm_widget_data_get(cp->parent);
-
- if (wd->mv_timer) ecore_timer_del(wd->mv_timer);
- wd->mv_timer = ecore_timer_add(0.01, _mv_timer, cp);
-
- wd->lp_timer = NULL;
- return EINA_FALSE;
-}
-
static void
-_left_button_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_left_button_clicked_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
{
Colorselector_Data *cp = data;
- Widget_Data *wd = elm_widget_data_get(cp->parent);
double x, y;
edje_object_signal_emit(cp->lbt, "elm,state,left,button,down",
edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
_draw_rects(data, x);
evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
- cp->button_state = L_BUTTON_PRESSED;
- if (wd->lp_timer) ecore_timer_del(wd->lp_timer);
- wd->lp_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press_timer, cp);
}
static void
-_right_button_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_left_button_repeat_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Colorselector_Data *cp = data;
+ double x, y;
+
+ edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
+ x -= 1.0 / BASE_STEP;
+ if (x < 0.0) x = 0.0;
+ edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
+ _draw_rects(data, x);
+ evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
+
+}
+
+static void
+_right_button_clicked_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
{
Colorselector_Data *cp = data;
- Widget_Data *wd = elm_widget_data_get(cp->parent);
double x, y;
edje_object_signal_emit(cp->rbt, "elm,state,right,button,down",
edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
_draw_rects(data, x);
evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
- cp->button_state = R_BUTTON_PRESSED;
- wd->lp_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press_timer, cp);
}
static void
-_left_button_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_right_button_repeat_cb(void *data, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__)
{
Colorselector_Data *cp = data;
- Widget_Data *wd = elm_widget_data_get(cp->parent);
-
- if (wd->lp_timer)
- {
- ecore_timer_del(wd->lp_timer);
- wd->lp_timer = NULL;
- }
- if (wd->mv_timer)
- {
- ecore_timer_del(wd->mv_timer);
- wd->mv_timer = NULL;
- }
-
- cp->button_state = BUTTON_RELEASED;
- edje_object_signal_emit(cp->lbt, "elm,state,left,button,up", "left_button");
-}
-
-static void
-_right_button_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
-{
- Colorselector_Data *cp = data;
- Widget_Data *wd = elm_widget_data_get(cp->parent);
-
- if (wd->lp_timer)
- {
- ecore_timer_del(wd->lp_timer);
- wd->lp_timer = NULL;
- }
- if (wd->mv_timer)
- {
- ecore_timer_del(wd->mv_timer);
- wd->mv_timer = NULL;
- }
+ double x, y;
- cp->button_state = BUTTON_RELEASED;
- edje_object_signal_emit(cp->rbt, "elm,state,right,button,up",
- "right_button");
+ edje_object_part_drag_value_get(cp->colorbar, "elm.arrow", &x, &y);
+ x += 1.0 / BASE_STEP;
+ if (x > 1.0) x = 1.0;
+ edje_object_part_drag_value_set(cp->colorbar, "elm.arrow", x, y);
+ _draw_rects(data, x);
+ evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL);
}
static void
Widget_Data *wd;
Evas *e;
int i = 0;
+ char buf[1024];
wd = elm_widget_data_get(obj);
if (!wd) return;
/* load colorbar area */
wd->cp[i]->colorbar = edje_object_add(e);
_elm_theme_object_set(obj, wd->cp[i]->colorbar, "colorselector", "base",
- "default");
+ elm_widget_style_get(obj));
snprintf(colorbar_name, sizeof(colorbar_name), "colorbar_%d", i);
snprintf(colorbar_s, sizeof(colorbar_s), "elm.colorbar_%d", i);
edje_object_signal_callback_add(wd->cp[i]->colorbar, "drag", "*",
/* load colorbar image */
wd->cp[i]->bar = edje_object_add(e);
+ snprintf(buf, sizeof(buf), "%s/%s", colorbar_name, elm_widget_style_get(obj));
_elm_theme_object_set(obj, wd->cp[i]->bar, "colorselector", "image",
- colorbar_name);
+ buf);
edje_object_part_swallow(wd->cp[i]->colorbar, "elm.bar",
wd->cp[i]->bar);
elm_widget_sub_object_add(obj, wd->cp[i]->bar);
if (i == 3)
{
wd->cp[i]->bg_rect = edje_object_add(e);
+ snprintf(buf, sizeof(buf), "%s/%s", colorbar_name, elm_widget_style_get(obj));
_elm_theme_object_set(obj, wd->cp[i]->bg_rect, "colorselector",
- "bg_image", colorbar_name);
+ "bg_image", buf);
edje_object_part_swallow(wd->cp[i]->colorbar, "elm.bar_bg",
wd->cp[i]->bg_rect);
elm_widget_sub_object_add(obj, wd->cp[i]->bg_rect);
}
/* load arrow image, pointing the colorbar */
wd->cp[i]->arrow = edje_object_add(e);
- _elm_theme_object_set(obj, wd->cp[i]->arrow, "colorselector", "image",
- "updown");
+ _elm_theme_object_set(obj, wd->cp[i]->arrow, "colorselector", "arrow",
+ elm_widget_style_get(obj));
edje_object_part_swallow(wd->cp[i]->colorbar, "elm.arrow_icon",
wd->cp[i]->arrow);
elm_widget_sub_object_add(obj, wd->cp[i]->arrow);
evas_object_color_set(wd->cp[i]->arrow, wd->er, wd->eg, wd->eb, 255);
/* load left button */
- wd->cp[i]->lbt = edje_object_add(e);
- _elm_theme_object_set(obj, wd->cp[i]->lbt, "colorselector", "button",
- "left");
- evas_object_event_callback_add(wd->cp[i]->lbt, EVAS_CALLBACK_MOUSE_DOWN,
- _left_button_down_cb, wd->cp[i]);
- evas_object_event_callback_add(wd->cp[i]->lbt, EVAS_CALLBACK_MOUSE_UP,
- _left_button_up_cb, wd->cp[i]);
+ wd->cp[i]->lbt = elm_button_add(obj);
+ snprintf(buf, sizeof(buf), "colorselector/left/%s", elm_widget_style_get(obj));
+ elm_object_style_set(wd->cp[i]->lbt, buf);
+ elm_widget_sub_object_add(obj, wd->cp[i]->lbt);
edje_object_part_swallow(wd->cp[i]->colorbar, "elm.l_button",
wd->cp[i]->lbt);
- elm_widget_sub_object_add(obj, wd->cp[i]->lbt);
+ evas_object_smart_callback_add(wd->cp[i]->lbt, "clicked", _left_button_clicked_cb, wd->cp[i]);
+ elm_button_autorepeat_set(wd->cp[i]->lbt, EINA_TRUE);
+ elm_button_autorepeat_initial_timeout_set(wd->cp[i]->lbt, _elm_config->longpress_timeout);
+ elm_button_autorepeat_gap_timeout_set(wd->cp[i]->lbt, (1.0 / _elm_config->fps));
+ evas_object_smart_callback_add(wd->cp[i]->lbt, "repeated",_left_button_repeat_cb, wd->cp[i]);
/* load right button */
- wd->cp[i]->rbt = edje_object_add(e);
- _elm_theme_object_set(obj, wd->cp[i]->rbt, "colorselector", "button",
- "right");
- evas_object_event_callback_add(wd->cp[i]->rbt, EVAS_CALLBACK_MOUSE_DOWN,
- _right_button_down_cb, wd->cp[i]);
- evas_object_event_callback_add(wd->cp[i]->rbt, EVAS_CALLBACK_MOUSE_UP,
- _right_button_up_cb, wd->cp[i]);
+ wd->cp[i]->rbt = elm_button_add(obj);
+ snprintf(buf, sizeof(buf), "colorselector/right/%s", elm_widget_style_get(obj));
+ elm_object_style_set(wd->cp[i]->rbt, buf);
+ elm_widget_sub_object_add(obj, wd->cp[i]->rbt);
edje_object_part_swallow(wd->cp[i]->colorbar, "elm.r_button",
wd->cp[i]->rbt);
- elm_widget_sub_object_add(obj, wd->cp[i]->rbt);
+ evas_object_smart_callback_add(wd->cp[i]->rbt, "clicked", _right_button_clicked_cb, wd->cp[i]);
+ elm_button_autorepeat_set(wd->cp[i]->rbt, EINA_TRUE);
+ elm_button_autorepeat_initial_timeout_set(wd->cp[i]->rbt, _elm_config->longpress_timeout);
+ elm_button_autorepeat_gap_timeout_set(wd->cp[i]->rbt, (1.0 / _elm_config->fps));
+ evas_object_smart_callback_add(wd->cp[i]->rbt, "repeated",_right_button_repeat_cb, wd->cp[i]);
}
}