diff options
author | YeongJong Lee <yj34.lee@samsung.com> | 2018-02-26 21:22:08 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2018-02-26 21:22:26 +0900 |
commit | 403c014bd25e399b4d4fa6c17f9a2f1583250070 (patch) | |
tree | a8b20665a01c77d923c3bebe5067efcd249d4920 | |
parent | 160b6d202f9a978271df8f530aca8530aa5d20b0 (diff) | |
download | efl-403c014bd25e399b4d4fa6c17f9a2f1583250070.tar.gz |
efl.ui.progressbar: change signal name for icon/text
Summary: see also 73f8b3b78f0ff92ddfc1c16426bf7c176f10293a
Test Plan:
1. elementary_test -to progressbar
and elementary_test -to efl.ui.progressbar
2. check that icon and text are visible
Reviewers: cedric, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5818
-rw-r--r-- | data/elementary/themes/edc/efl/progress.edc | 1392 | ||||
-rw-r--r-- | src/Makefile_Elementary.am | 1 | ||||
-rw-r--r-- | src/bin/elementary/test_ui_progressbar.c | 7 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar.c | 119 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar.eo | 2 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar_legacy.eo | 3 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar_legacy_part.eo | 8 |
7 files changed, 1485 insertions, 47 deletions
diff --git a/data/elementary/themes/edc/efl/progress.edc b/data/elementary/themes/edc/efl/progress.edc index 2cb11b29db..049724207b 100644 --- a/data/elementary/themes/edc/efl/progress.edc +++ b/data/elementary/themes/edc/efl/progress.edc @@ -1,20 +1,1402 @@ group { "efl/progressbar/horizontal"; - inherit: "elm/progressbar/horizontal/default"; + images.image: "inset_bar_horiz_base.png" COMP; + images.image: "inset_bar_horiz_light.png" COMP; + images.image: "inset_bar_horiz_inside_base.png" COMP; + images.image: "inset_bar_horiz_inside_light.png" COMP; + images.image: "inset_bar_horiz_glow_base.png" COMP; + images.image: "inset_bar_horiz_glow_light.png" COMP; + images.image: "inset_bar_horiz_glow_inv_base.png" COMP; + images.image: "inset_bar_horiz_glow_inv_light.png" COMP; + images.image: "inset_bar_horiz_glow_mid_base.png" COMP; + images.image: "inset_bar_horiz_glow_mid_light.png" COMP; +#define ICON 1 +#define LABEL 2 +#define DISABLE 4 + script { + public slmode; + public eval_mode(m) { + new ic = m & ICON; + new l = m & LABEL; + new d = m & DISABLE; + if (l) { + if (!d) { + set_state(PART:"elm.text", "visible", 0.0); + } else { + set_state(PART:"elm.text", "disabled_visible", 0.0); + } + } else { + set_state(PART:"elm.text", "default", 0.0); + } + if (ic) { + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"sizer.content", "visible", 0.0); + } else { + set_state(PART:"elm.swallow.content", "default", 0.0); + set_state(PART:"sizer.content", "default", 0.0); + } + if (!d) { + set_state(PART:"dis_clip", "default", 0.0); + } else { + set_state(PART:"dis_clip", "disabled", 0.0); + } + } + } + parts { + part { name: "dis_clip"; type: RECT; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + part { name: "pulse_clip"; type: RECT; + description { state: "default" 0.0; + rel1.relative: -2.0 -2.0; + rel2.relative: 3.0 3.0; + visible: 0; + } + description { state: "pulse" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "fract_clip"; type: RECT; + description { state: "default" 0.0; + rel1.relative: -2.0 -2.0; + rel2.relative: 3.0 3.0; + } + description { state: "pulse" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.swallow.content"; type: SWALLOW; + clip_to: "dis_clip"; + required; + description { state: "default" 0.0; + visible: 0; + align: 0.0 0.5; + fixed: 1 0; + rel1.offset: 0 2; + rel2.offset: -1 -3; + rel2.relative: 0.0 1.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; aspect_preference: VERTICAL; + rel1.offset: 2 2; + rel2.offset: 2 -3; + } + } + part { name: "sizer.content"; type: TEXT; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + text { font: FN; size: 10; + min: 0 0; + text_class: "progressbar_text"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + text { + min: 1 1; + ellipsis: -1; + text: "M"; + } + } + } + part { name: "elm.text"; type: TEXT; mouse_events: 0; + effect: SHADOW BOTTOM; + scale: 1; + required; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.5; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: -1 2; + rel2.to_x: "elm.swallow.content"; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -3; + color: FN_COL_DEFAULT; + color_class: "progressbar_text"; + text { font: FN; size: 10; + text_class: "progressbar"; + min: 0 0; + align: 0.0 0.5; + } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 0; + visible: 1; + rel1.offset: 2 2; + rel2.offset: 2 -3; + text.min: 1 1; + text.ellipsis: -1; + } + description { state: "disabled_visible" 0.0; + inherit: "visible" 0.0; + color_class: "progressbar_text_disabled"; + color: FN_COL_DISABLE_LIGHTER_SHADOW; + } + } + part { name: "bg-hi"; + description { state: "default" 0.0; + rel1.to: "bg"; + rel1.offset: 0 1; + rel2.to: "bg"; + rel2.offset: -1 0; + image.normal: "inset_bar_horiz_light.png"; + image.border: 32 32 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "bg"; + scale: 1; + description { state: "default" 0.0; + min: 16 16; + max: -1 16; + rel1.to_x: "elm.text"; + rel1.relative: 1.0 0.0; + rel1.offset: 3 3; + rel2.offset: -4 -4; + image.normal: "inset_bar_horiz_base.png"; + image.border: 32 32 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "ins0"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + rel1.to: "bg"; + rel2.to: "bg"; + rel2.relative: 0.0 1.0; + min: 5 16; + align: 0.0 0.5; + } + } + part { name: "ins1"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + rel1.to: "bg"; + rel1.relative: 1.0 0.0; + rel2.to: "bg"; + min: 5 16; + align: 1.0 0.5; + } + } + part { name: "inside-hi"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "inside"; + rel1.offset: 0 1; + rel2.to: "inside"; + rel2.offset: -1 0; + image.normal: "inset_bar_horiz_inside_light.png"; + image.border: 8 8 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "inside"; + scale: 1; + description { state: "default" 0.0; + min: 4 4; + rel1.to: "ins0"; + rel1.relative: 1.0 (6/16); + rel2.to: "ins1"; + rel2.relative: 0.0 (10/16); + image.normal: "inset_bar_horiz_inside_base.png"; + image.border: 8 8 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "elm.swallow.bar"; type: SWALLOW; mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "inside"; + rel2.to: "inside"; + } + } + part { name: "elm.cur.progressbar"; mouse_events: 0; type: SPACER; + scale: 1; + dragable.confine: "inside"; + dragable.x: 1 1 1; + dragable.y: 0 0 0; + description { state: "default" 0.0; + fixed: 1 1; + min: 8 4; + max: 8 4; + rel1.to: "inside"; + rel2.to: "inside"; + } + } + part { name: "barend"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + min: 14 16; + rel1.to_x: "elm.cur.progressbar"; + rel1.relative: 1.0 0.0; + rel2.to_x: "elm.cur.progressbar"; + rel2.relative: 1.0 1.0; + align: 0.0 0.5; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + } + } + part { name: "bar"; + clip_to: "fract_clip"; + scale: 1; + description { state: "default" 0.0; + rel1.to_x: "ins0"; + rel1.to_y: "bg"; + rel1.relative: (12/16) -0.25; + rel2.to_x: "barend"; + rel2.to_y: "bg"; + rel2.relative: 1.0 1.25; + image.normal: "inset_bar_horiz_glow_base.png"; + image.border: 0 72 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.to_x: "barend"; + rel1.relative: 0.0 -0.25; + rel2.to_x: "ins1"; + rel2.relative: (4/16) 1.25; + image.normal: "inset_bar_horiz_glow_inv_base.png"; + image.border: 72 0 0 0; + } + } + part { name: "insidep0"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + min: 20 16; + rel1.to_x: "inside"; + rel1.relative: 0.0 0.0; + rel2.to_x: "inside"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + } + } + part { name: "insidep1"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + min: 20 16; + rel1.to_x: "inside"; + rel1.relative: 1.0 0.0; + rel2.to_x: "inside"; + rel2.relative: 1.0 1.0; + align: 0.0 0.5; + } + } + part { name: "pulse"; + clip_to: "pulse_clip"; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 64 24; + max: 64 24; + rel1.to_x: "insidep0"; + rel1.to_y: "bar"; + rel1.relative: 0.0 0.0; + rel2.to_x: "insidep1"; + rel2.to_y: "bar"; + rel2.relative: 1.0 1.0; + image.normal: "inset_bar_horiz_glow_mid_base.png"; + align: 0.0 0.5; + } + description { state: "end" 0.0; + inherit: "default" 0.0; + align: 1.0 0.5; + } + } + part { name: "elm.text.status"; type: TEXT; mouse_events: 0; + scale: 1; + effect: GLOW; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "inside"; + rel2.to: "inside"; + color_class: "progress_status"; + align: 1.0 0.5; + text { font: FN; size: 10; + min: 0 1; + text_class: "progress_status"; + align: 1.0 0.5; + } + color: FN_COL_HIGHLIGHT_CLICKED; + visible: 1; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "pulse2"; + clip_to: "pulse_clip"; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 36 14; + max: 36 14; + rel1.to: "pulse"; + rel2.to: "pulse"; + image.normal: "inset_bar_horiz_glow_mid_light.png"; + color: 255 255 255 0; + } + description { state: "glow" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "light"; + clip_to: "fract_clip"; + scale: 1; + description { state: "default" 0.0; + max: 36 11; + rel1.to_x: "bar"; + rel1.to_y: "bar"; + rel1.relative: 0.0 (26/96); + rel2.to_x: "barend"; + rel2.to_y: "bar"; + rel2.relative: 0.2 ((26+44)/96); + align: 1.0 0.0; + image.normal: "inset_bar_horiz_glow_light.png"; + image.border: 0 20 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + color: 255 255 255 0; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.to_x: "barend"; + rel1.to_y: "bar"; + rel1.relative: 0.8 (26/96); + rel2.to_x: "bar"; + rel2.to_y: "bar"; + rel2.relative: 1.0 ((26+44)/96); + align: 0.0 0.0; + image.normal: "inset_bar_horiz_glow_inv_light.png"; + image.border: 20 0 0 0; + } + } + } + programs { + program { name: "inverted-on"; + signal: "elm,state,inverted,on"; source: "elm"; + action: STATE_SET "inv" 0.0; + target: "bar"; + target: "barend"; + target: "light"; + } + program { name: "inverted-off"; + signal: "elm,state,inverted,off"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "bar"; + target: "barend"; + target: "light"; + } + program { name: "drag-set"; + signal: "drag,set"; source: "elm.cur.progressbar"; + script { + new a, Float:dx, Float:dy, Float:vl, st[20]; + + get_drag(PART:"elm.cur.progressbar", dx, dy); + get_state(PART:"bar", st, 19, vl); + if (!strcmp(st, "inv")) { + a = round(((1.0 - dx) * 255) / 0.2); + custom_state(PART:"light", "inv", 0.0); + } else { + a = round((dx * 255) / 0.2); + custom_state(PART:"light", "default", 0.0); + } + if (a > 255) { a = 255; } + set_state_val(PART:"light", STATE_COLOR, 255, 255, 255, a); + set_state(PART:"light", "custom", 0.0); + } + } + program { name: "pulse-mode0"; + signal: "elm,state,pulse"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.text.status"; + after: "pulse-mode1"; + } + program { name: "pulse-mode1"; + signal: "elm,state,pulse,start"; source: "elm"; + action: STATE_SET "pulse" 0.0; + target: "fract_clip"; + } + program { name: "pulse-start"; + signal: "elm,state,pulse,start"; source: "elm"; + action: STATE_SET "pulse" 0.0; + target: "pulse_clip"; + target: "fract_clip"; + after: "pulse0"; + after: "pulse0.1"; + } + program { name: "pulse0.1"; + action: STATE_SET "glow" 0.0; + transition: ACCELERATE 0.4; + target: "pulse2"; + after: "pulse0.2"; + } + program { name: "pulse0.2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.4; + target: "pulse2"; + } + program { name: "pulse0"; + action: STATE_SET "end" 0.0; + transition: SINUSOIDAL 0.8; + target: "pulse"; + after: "pulse1"; + after: "pulse0.1"; + } + program { name: "pulse1"; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 0.8; + target: "pulse"; + after: "pulse0"; + after: "pulse0.1"; + } + program { name: "fraction"; + signal: "elm,state,fraction"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.status"; + after: "pulse-stop"; + } + program { name: "elmpulse-stop"; + signal: "elm,state,pulse,stop"; source: "elm"; + action: ACTION_STOP; + target: "pulse0"; + target: "pulse1"; + after: "pulse-stop"; + } + program { name: "pulse-stop"; + action: STATE_SET "default" 0.0; + target: "pulse_clip"; + } + program { name: "units-visible"; + signal: "elm,state,units,visible"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.status"; + } + program { name: "units-hidden"; + signal: "elm,state,units,hidden"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.text.status"; + } + program { name: "text-visible"; + signal: "elm,state,elm.text,set"; source: "elm"; + script { + new m = get_int(slmode); + m |= LABEL; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "text-hidden"; + signal: "elm,state,elm.text,unset"; source: "elm"; + script { + new m = get_int(slmode); + m &= ~LABEL; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "icon-visible"; + signal: "elm,state,content,set"; source: "elm"; + script { + new m = get_int(slmode); + m |= ICON; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "icon-hidden"; + signal: "elm,state,content,unset"; source: "elm"; + script { + new m = get_int(slmode); + m &= ~ICON; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "state-disabled"; + signal: "elm,state,disabled"; source: "elm"; + script { + new m = get_int(slmode); + m |= DISABLE; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "state-enabled"; + signal: "elm,state,enabled"; source: "elm"; + script { + new m = get_int(slmode); + m &= ~DISABLE; set_int(slmode, m); + eval_mode(m); + } + } + } +#undef ICON +#undef LABEL +#undef UNITS +#undef DISABLE } group { "efl/progressbar/vertical"; - inherit: "elm/progressbar/vertical/default"; + images.image: "inset_bar_vert_base.png" COMP; + images.image: "inset_bar_vert_light.png" COMP; + images.image: "inset_bar_vert_inside_base.png" COMP; + images.image: "inset_bar_vert_inside_light.png" COMP; + images.image: "inset_bar_vert_glow_base.png" COMP; + images.image: "inset_bar_vert_glow_light.png" COMP; + images.image: "inset_bar_vert_glow_inv_base.png" COMP; + images.image: "inset_bar_vert_glow_inv_light.png" COMP; + images.image: "inset_bar_vert_glow_mid_base.png" COMP; + images.image: "inset_bar_vert_glow_mid_light.png" COMP; +#define ICON 1 +#define LABEL 2 +#define DISABLE 4 + script { + public slmode; + public eval_mode(m) { + new ic = m & ICON; + new l = m & LABEL; + new d = m & DISABLE; + if (l) { + if (!d) { + set_state(PART:"elm.text", "visible", 0.0); + } else { + set_state(PART:"elm.text", "disabled_visible", 0.0); + } + } else { + set_state(PART:"elm.text", "default", 0.0); + } + if (ic) { + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"sizer.content", "visible", 0.0); + } else { + set_state(PART:"elm.swallow.content", "default", 0.0); + set_state(PART:"sizer.content", "default", 0.0); + } + if (!d) { + set_state(PART:"dis_clip", "default", 0.0); + } else { + set_state(PART:"dis_clip", "disabled", 0.0); + } + } + } + parts { + part { name: "dis_clip"; type: RECT; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + part { name: "pulse_clip"; type: RECT; + description { state: "default" 0.0; + rel1.relative: -2.0 -2.0; + rel2.relative: 3.0 3.0; + visible: 0; + } + description { state: "pulse" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "fract_clip"; type: RECT; + description { state: "default" 0.0; + rel1.relative: -2.0 -2.0; + rel2.relative: 3.0 3.0; + } + description { state: "pulse" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.swallow.content"; type: SWALLOW; + clip_to: "dis_clip"; + required; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 0 1; + rel1.offset: 2 0; + rel2.offset: -3 -1; + rel2.relative: 1.0 0.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; aspect_preference: HORIZONTAL; + rel1.offset: 2 2; + rel2.offset: -3 2; + } + } + part { name: "sizer.content"; type: TEXT; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + text { font: FN; size: 10; + min: 0 0; + text_class: "progressbar_text"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + text { + min: 1 1; + ellipsis: -1; + text: "M"; + } + } + } + part { name: "elm.text"; type: TEXT; mouse_events: 0; + effect: SHADOW BOTTOM; + scale: 1; + required; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.0; + rel1.to_y: "elm.swallow.content"; + rel1.relative: 0.0 1.0; + rel1.offset: 2 -1; + rel2.to_y: "elm.swallow.content"; + rel2.relative: 1.0 1.0; + rel2.offset: -3 -1; + color: FN_COL_DEFAULT; + color_class: "progressbar_text"; + text { font: FN; size: 10; + text_class: "progressbar"; + min: 0 0; + align: 0.5 0.0; + } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 0 1; + visible: 1; + rel1.offset: 2 2; + rel2.offset: -3 2; + text.min: 1 1; + text.ellipsis: -1; + } + description { state: "disabled_visible" 0.0; + inherit: "visible" 0.0; + color_class: "progressbar_text_disabled"; + color: FN_COL_DISABLE_LIGHTER_SHADOW; + } + } + part { name: "bg-hi"; + description { state: "default" 0.0; + rel1.to: "bg"; + rel1.offset: 0 1; + rel2.to: "bg"; + rel2.offset: -1 0; + image.normal: "inset_bar_vert_light.png"; + image.border: 0 0 32 32; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "bg"; + scale: 1; + description { state: "default" 0.0; + min: 16 16; + max: 16 -1; + rel1.to_y: "elm.text"; + rel1.relative: 0.0 1.0; + rel1.offset: 3 3; + rel2.offset: -4 -4; + image.normal: "inset_bar_vert_base.png"; + image.border: 0 0 32 32; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "ins0"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + rel1.to: "bg"; + rel2.to: "bg"; + rel2.relative: 1.0 0.0; + min: 16 5; + align: 0.5 0.0; + } + } + part { name: "ins1"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + rel1.to: "bg"; + rel1.relative: 0.0 1.0; + rel2.to: "bg"; + min: 16 5; + align: 0.5 1.0; + } + } + part { name: "inside-hi"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "inside"; + rel1.offset: 0 1; + rel2.to: "inside"; + rel2.offset: -1 0; + image.normal: "inset_bar_vert_inside_light.png"; + image.border: 0 0 8 8; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "inside"; + scale: 1; + description { state: "default" 0.0; + min: 4 4; + rel1.to: "ins0"; + rel1.relative: (6/16) 1.0; + rel2.to: "ins1"; + rel2.relative: (10/16) 0.0; + image.normal: "inset_bar_vert_inside_base.png"; + image.border: 0 0 8 8; + image.border_scale_by: 0.25; image.border_scale: 1; + } + } + part { name: "elm.swallow.bar"; type: SWALLOW; mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "inside"; + rel2.to: "inside"; + } + } + part { name: "elm.cur.progressbar"; mouse_events: 0; type: SPACER; + scale: 1; + dragable.confine: "inside"; + dragable.x: 0 0 0; + dragable.y: 1 1 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 4 8; + max: 4 8; + rel1.to: "inside"; + rel2.to: "inside"; + } + } + part { name: "barend"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + min: 16 14; + rel1.to_y: "elm.cur.progressbar"; + rel1.relative: 0.0 1.0; + rel2.to_y: "elm.cur.progressbar"; + rel2.relative: 1.0 1.0; + align: 0.5 0.0; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 1.0; + } + } + part { name: "bar"; + clip_to: "fract_clip"; + scale: 1; + description { state: "default" 0.0; + rel1.to_y: "ins0"; + rel1.to_x: "bg"; + rel1.relative: -0.25 (12/16); + rel2.to_y: "barend"; + rel2.to_x: "bg"; + rel2.relative: 1.25 1.0; + image.normal: "inset_bar_vert_glow_base.png"; + image.border: 0 0 0 72; + image.border_scale_by: 0.25; image.border_scale: 1; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.to_y: "barend"; + rel1.relative: -0.25 0.0; + rel2.to_y: "ins1"; + rel2.relative: 1.25 (4/16); + image.normal: "inset_bar_vert_glow_inv_base.png"; + image.border: 0 0 72 0; + } + } + part { name: "insidep0"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + min: 16 20; + rel1.to_y: "inside"; + rel1.relative: 0.0 0.0; + rel2.to_y: "inside"; + rel2.relative: 1.0 0.0; + align: 0.5 1.0; + } + } + part { name: "insidep1"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + min: 16 20; + rel1.to_y: "inside"; + rel1.relative: 0.0 1.0; + rel2.to_y: "inside"; + rel2.relative: 1.0 1.0; + align: 0.5 0.0; + } + } + part { name: "pulse"; + clip_to: "pulse_clip"; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 24 64; + max: 24 64; + rel1.to_y: "insidep0"; + rel1.to_x: "bar"; + rel1.relative: 0.0 0.0; + rel2.to_y: "insidep1"; + rel2.to_x: "bar"; + rel2.relative: 1.0 1.0; + image.normal: "inset_bar_vert_glow_mid_base.png"; + align: 0.5 0.0; + } + description { state: "end" 0.0; + inherit: "default" 0.0; + align: 0.5 1.0; + } + } + part { name: "statbox"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "inside"; + rel2.to: "inside"; + aspect: 1.0 1.0; aspect_preference: NONE; + } + } + part { name: "elm.text.status"; type: TEXT; mouse_events: 0; + scale: 1; + effect: GLOW; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "statbox"; + rel2.to: "statbox"; + color_class: "progress_status"; + align: 1.0 0.5; + text { font: FN; size: 10; + min: 0 1; + text_class: "progress_status"; + align: 1.0 0.5; + } + color: FN_COL_HIGHLIGHT_CLICKED; + visible: 1; + map.on: 1; + map.smooth: 0; + map.rotation.center: "statbox"; + map.rotation.z: 90; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "pulse2"; + clip_to: "pulse_clip"; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 14 36; + max: 14 36; + rel1.to: "pulse"; + rel2.to: "pulse"; + image.normal: "inset_bar_vert_glow_mid_light.png"; + color: 255 255 255 0; + } + description { state: "glow" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "light"; + clip_to: "fract_clip"; + scale: 1; + description { state: "default" 0.0; + max: 11 36; + rel1.to_y: "bar"; + rel1.to_x: "bar"; + rel1.relative: (26/96) 0.0; + rel2.to_y: "barend"; + rel2.to_x: "bar"; + rel2.relative: ((26+44)/96) 0.2; + align: 0.0 1.0; + image.normal: "inset_bar_vert_glow_light.png"; + image.border: 0 0 0 20; + image.border_scale_by: 0.25; image.border_scale: 1; + color: 255 255 255 0; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.to_y: "barend"; + rel1.to_x: "bar"; + rel1.relative: (26/96) 0.8; + rel2.to_y: "bar"; + rel2.to_x: "bar"; + rel2.relative: ((26+44)/96) 1.0; + align: 0.0 0.0; + image.normal: "inset_bar_vert_glow_inv_light.png"; + image.border: 0 0 20 0; + } + } + } + programs { + program { name: "inverted-on"; + signal: "elm,state,inverted,on"; source: "elm"; + action: STATE_SET "inv" 0.0; + target: "bar"; + target: "barend"; + target: "light"; + } + program { name: "inverted-off"; + signal: "elm,state,inverted,off"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "bar"; + target: "barend"; + target: "light"; + } + program { name: "drag-set"; + signal: "drag,set"; source: "elm.cur.progressbar"; + script { + new a, Float:dx, Float:dy, Float:vl, st[20]; + + get_drag(PART:"elm.cur.progressbar", dx, dy); + get_state(PART:"bar", st, 19, vl); + if (!strcmp(st, "inv")) { + a = round(((1.0 - dy) * 255) / 0.2); + custom_state(PART:"light", "inv", 0.0); + } else { + a = round((dy * 255) / 0.2); + custom_state(PART:"light", "default", 0.0); + } + if (a > 255) { a = 255; } + set_state_val(PART:"light", STATE_COLOR, 255, 255, 255, a); + set_state(PART:"light", "custom", 0.0); + } + } + program { name: "pulse-mode0"; + signal: "elm,state,pulse"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.text.status"; + after: "pulse-mode1"; + } + program { name: "pulse-mode1"; + signal: "elm,state,pulse,start"; source: "elm"; + action: STATE_SET "pulse" 0.0; + target: "fract_clip"; + } + program { name: "pulse-start"; + signal: "elm,state,pulse,start"; source: "elm"; + action: STATE_SET "pulse" 0.0; + target: "pulse_clip"; + target: "fract_clip"; + after: "pulse0"; + after: "pulse0.1"; + } + program { name: "pulse0.1"; + action: STATE_SET "glow" 0.0; + transition: ACCELERATE 0.4; + target: "pulse2"; + after: "pulse0.2"; + } + program { name: "pulse0.2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.4; + target: "pulse2"; + } + program { name: "pulse0"; + action: STATE_SET "end" 0.0; + transition: SINUSOIDAL 0.8; + target: "pulse"; + after: "pulse1"; + after: "pulse0.1"; + } + program { name: "pulse1"; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 0.8; + target: "pulse"; + after: "pulse0"; + after: "pulse0.1"; + } + program { name: "fraction"; + signal: "elm,state,fraction"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.status"; + after: "pulse-stop"; + } + program { name: "elmpulsestop"; + signal: "elm,state,pulse,stop"; source: "elm"; + action: ACTION_STOP; + target: "pulse0"; + target: "pulse1"; + after: "pulse-stop"; + } + program { name: "pulse-stop"; + action: STATE_SET "default" 0.0; + target: "pulse_clip"; + } + program { name: "unit-visible"; + signal: "elm,state,units,visible"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.status"; + } + program { name: "unit-hidden"; + signal: "elm,state,units,hidden"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.text.status"; + } + program { name: "text-visible"; + signal: "elm,state,elm.text,set"; source: "elm"; + script { + new m = get_int(slmode); + m |= LABEL; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "text-hidden"; + signal: "elm,state,elm.text,unset"; source: "elm"; + script { + new m = get_int(slmode); + m &= ~LABEL; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "icon-visible"; + signal: "elm,state,content,set"; source: "elm"; + script { + new m = get_int(slmode); + m |= ICON; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "icon-hidden"; + signal: "elm,state,content,unset"; source: "elm"; + script { + new m = get_int(slmode); + m &= ~ICON; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "elmdisabled"; + signal: "elm,state,disabled"; source: "elm"; + script { + new m = get_int(slmode); + m |= DISABLE; set_int(slmode, m); + eval_mode(m); + } + } + program { name: "elmenabled"; + signal: "elm,state,enabled"; source: "elm"; + script { + new m = get_int(slmode); + m &= ~DISABLE; set_int(slmode, m); + eval_mode(m); + } + } + } +#undef ICON +#undef LABEL +#undef UNITS +#undef DISABLE } group { "efl/progressbar/horizontal:wheel"; - inherit: "elm/progressbar/horizontal/wheel"; alias: "efl/progressbar/vertical:wheel"; + images.image: "knob_round_busy.png" COMP; + images.image: "glow_round_corners.png" COMP; + parts { + part { name: "elm.swallow.bar" ; type: SWALLOW; mouse_events: 0; + description { state: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; + } + } + part { name: "elm.swallow.content"; type: SWALLOW; + description { state: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; + } + } + part { name: "busy_clip"; type: RECT; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + description { state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "knob"; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + image.normal: "knob_round_busy.png"; + min: 40 40; + max: 40 40; + } + } + part { name: "knob_spinner"; mouse_events: 0; + clip_to: "busy_clip"; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "knob"; + rel2.to: "knob"; + image.normal: "glow_round_corners.png"; + map.on: 1; + map.smooth: 1; + map.rotation.center: "knob"; + } + description { state: "spin" 0.0; + inherit: "default" 0.0; + map.rotation.z: 360; + } + } + } + programs { + program { name: "spin"; + signal: "elm,state,pulse,start"; source: "elm"; + action: STATE_SET "spin" 0.0; + transition: LINEAR 1.0; + target: "knob_spinner"; + after: "spin2"; + } + program { name: "spin2"; + action: STATE_SET "default" 0.0; + target: "knob_spinner"; + after: "spin"; + } + program { + signal: "elm,state,pulse,start"; source: "elm"; + action: STATE_SET "active" 0.0; + transition: SINUSOIDAL 0.25; + target: "busy_clip"; + } + program { + signal: "elm,state,pulse,stop"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 1.0; + target: "busy_clip"; + after: "spin3"; + } + program { name: "spin3"; + action: ACTION_STOP; + target: "spin"; + target: "spin2"; + after: "spin4"; + } + program { name: "spin4"; + action: STATE_SET "default" 0.0; + target: "knob_spinner"; + } + } } group { "efl/progressbar/horizontal:double"; - inherit: "elm/progressbar/horizontal/double"; + inherit: "efl/progressbar/horizontal"; + images { + image: "inset_bar_horiz_glow_base_double.png" COMP; + image: "inset_bar_horiz_glow_inv_base_double.png" COMP; + } + parts { + part { name: "elm.cur.progressbar1"; mouse_events: 0; type: SPACER; + insert_after: "inside"; + scale: 1; + dragable.confine: "inside"; + dragable.x: 1 1 1; + dragable.y: 0 0 0; + description { state: "default" 0.0; + fixed: 1 1; + min: 8 4; + max: 8 4; + rel1.to: "inside"; + rel2.to: "inside"; + } + } + part { name: "barend1"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + min: 14 16; + rel1.to_x: "elm.cur.progressbar1"; + rel1.relative: 1.0 0.0; + rel2.to_x: "elm.cur.progressbar1"; + rel2.relative: 1.0 1.0; + align: 0.0 0.5; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + } + } + part { name: "bar1"; + insert_after: "barend"; + clip_to: "fract_clip"; + scale: 1; + description { state: "default" 0.0; + rel1.to_x: "ins0"; + rel1.to_y: "bg"; + rel1.relative: (12/16) -0.25; + rel2.to_x: "barend1"; + rel2.to_y: "bg"; + rel2.relative: 1.0 1.25; + image.normal: "inset_bar_horiz_glow_base_double.png"; + image.border: 0 72 0 0; + image.border_scale_by: 0.25; image.border_scale: 1; + color: 51 153 255 128; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.to_x: "barend"; + rel1.relative: 0.0 -0.25; + rel2.to_x: "ins1"; + rel2.relative: (4/16) 1.25; + image.normal: "inset_bar_horiz_glow_inv_base_double.png"; + image.border: 72 0 0 0; + } + } + } + programs { + program { name: "inverted-on"; + signal: "elm,state,inverted,on"; source: "elm"; + action: STATE_SET "inv" 0.0; + target: "bar"; + target: "bar1"; + target: "barend"; + target: "barend1"; + target: "light"; + } + program + { name: "inverted-off"; + signal: "elm,state,inverted,off"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "bar"; + target: "bar1"; + target: "barend"; + target: "barend1"; + target: "light"; + } + } } group { "efl/progressbar/vertical:double"; - inherit: "elm/progressbar/vertical/double"; + inherit: "efl/progressbar/vertical"; + images { + image: "inset_bar_vert_glow_base_double.png" COMP; + image: "inset_bar_vert_glow_inv_base_double.png" COMP; + } + parts { + part { name: "elm.cur.progressbar1"; mouse_events: 0; type: SPACER; + insert_after: "inside"; + scale: 1; + dragable.confine: "inside"; + dragable.x: 0 0 0; + dragable.y: 1 1 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 4 8; + max: 4 8; + rel1.to: "inside"; + rel2.to: "inside"; + } + } + part { name: "barend1"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + min: 16 14; + rel1.to_y: "elm.cur.progressbar1"; + rel1.relative: 0.0 1.0; + rel2.to_y: "elm.cur.progressbar1"; + rel2.relative: 1.0 1.0; + align: 0.5 0.0; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + align: 0.5 1.0; + } + } + part { name: "bar1"; + insert_after: "barend"; + clip_to: "fract_clip"; + scale: 1; + description { state: "default" 0.0; + rel1.to_y: "ins0"; + rel1.to_x: "bg"; + rel1.relative: -0.25 (12/16); + rel2.to_y: "barend1"; + rel2.to_x: "bg"; + rel2.relative: 1.25 1.0; + image.normal: "inset_bar_vert_glow_base_double.png"; + image.border: 0 0 0 72; + image.border_scale_by: 0.25; image.border_scale: 1; + color: 51 153 255 128; + } + description { state: "inv" 0.0; + inherit: "default" 0.0; + rel1.to_y: "barend1"; + rel1.relative: -0.25 0.0; + rel2.to_y: "ins1"; + rel2.relative: 1.25 (4/16); + image.normal: "inset_bar_vert_glow_inv_base_double.png"; + image.border: 0 0 72 0; + } + } + } + programs { + program { name: "inverted-on"; + signal: "elm,state,inverted,on"; source: "elm"; + action: STATE_SET "inv" 0.0; + target: "bar"; + target: "barend"; + target: "light"; + target: "bar1"; + target: "barend1"; + } + program { name: "inverted-off"; + signal: "elm,state,inverted,off"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "bar"; + target: "barend"; + target: "light"; + target: "bar1"; + target: "barend1"; + } + } } diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 27cab7b3ae..a2e82a5f71 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -109,6 +109,7 @@ elm_public_eolian_files += \ lib/elementary/efl_ui_button_legacy_part.eo \ lib/elementary/efl_ui_radio_legacy_part.eo \ lib/elementary/efl_ui_check_legacy_part.eo \ + lib/elementary/efl_ui_progressbar_legacy_part.eo \ lib/elementary/elm_spinner.eo \ lib/elementary/elm_multibuttonentry_item.eo \ lib/elementary/elm_interface_scrollable.eo \ diff --git a/src/bin/elementary/test_ui_progressbar.c b/src/bin/elementary/test_ui_progressbar.c index e1391421b1..0af6c6aaad 100644 --- a/src/bin/elementary/test_ui_progressbar.c +++ b/src/bin/elementary/test_ui_progressbar.c @@ -113,6 +113,7 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf { Eo *win, *bx, *btbx; pbdata *pd; + char buf[PATH_MAX]; pd = (pbdata *)calloc(1, sizeof(pbdata)); @@ -135,6 +136,12 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(250, 20)) ); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); + efl_add(EFL_UI_IMAGE_CLASS, pd->pb1, + efl_file_set(efl_added, buf, NULL), + efl_content_set(pd->pb1, efl_added) + ); + pd->pb2 = efl_add(EFL_UI_PROGRESSBAR_CLASS, bx, efl_pack(bx, efl_added), efl_text_set(efl_added, "10-100"), diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 40a6a66a1b..64c0f22643 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -169,41 +169,6 @@ _efl_ui_progressbar_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Progressbar_Data *_pd evas_object_size_hint_max_set(obj, -1, -1); } -/* FIXME: replicated from elm_layout just because progressbar's icon - * spot is elm.swallow.content, not elm.swallow.icon. Fix that - * whenever we can changed the theme API */ -static void -_icon_signal_emit(Evas_Object *obj) -{ - char buf[64]; - - if (!elm_widget_resize_object_get(obj)) return; - snprintf(buf, sizeof(buf), "elm,state,icon,%s", - elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); - - elm_layout_signal_emit(obj, buf, "elm"); -} - -EOLIAN static Eina_Bool -_efl_ui_progressbar_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj) -{ - if (!efl_ui_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj)) - return EINA_FALSE; - - _icon_signal_emit(obj); - return EINA_TRUE; -} - -static Eina_Bool -_efl_ui_progressbar_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj) -{ - if (!efl_ui_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj)) - return EINA_FALSE; - - _icon_signal_emit(obj); - return EINA_TRUE; -} - //TODO: efl_ui_slider also use this. static const char * _theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy) @@ -307,11 +272,6 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data * _units_set(obj); _val_set(obj); - /* FIXME: replicated from elm_layout just because progressbar's - * icon spot is elm.swallow.content, not elm.swallow.icon. Fix that - * whenever we can changed the theme API */ - _icon_signal_emit(obj); - edje_object_message_signal_process(wd->resize_obj); elm_layout_sizing_eval(obj); @@ -745,6 +705,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_progressbar) #include "efl_ui_progressbar.eo.c" #include "efl_ui_progressbar_legacy.eo.h" +#include "efl_ui_progressbar_legacy_part.eo.h" #define MY_CLASS_NAME_LEGACY "elm_progressbar" @@ -762,6 +723,84 @@ _efl_ui_progressbar_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) return obj; } +/* FIXME: replicated from elm_layout just because progressbar's icon spot + * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we + * can changed the theme API */ +static void +_icon_signal_emit(Evas_Object *obj) +{ + char buf[64]; + + if (!elm_widget_resize_object_get(obj)) return; + snprintf(buf, sizeof(buf), "elm,state,icon,%s", + elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); + + elm_layout_signal_emit(obj, buf, "elm"); + edje_object_message_signal_process(elm_layout_edje_get(obj)); + elm_layout_sizing_eval(obj); +} + +/* FIXME: replicated from elm_layout just because progressbar's icon spot + * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we + * can changed the theme API */ +EOLIAN static Efl_Ui_Theme_Apply +_efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) +{ + Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED; + + int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS)); + if (!int_ret) return EFL_UI_THEME_APPLY_FAILED; + _icon_signal_emit(obj); + + return int_ret; +} + +/* FIXME: replicated from elm_layout just because progressbar's icon spot + * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we + * can changed the theme API */ +EOLIAN static Eina_Bool +_efl_ui_progressbar_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj) +{ + Eina_Bool int_ret = EINA_FALSE; + + int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), sobj); + if (!int_ret) return EINA_FALSE; + + _icon_signal_emit(obj); + + return EINA_TRUE; +} + +/* FIXME: replicated from elm_layout just because progressbar's icon spot + * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we + * can changed the theme API */ +static Eina_Bool +_efl_ui_progressbar_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content) +{ + Eina_Bool int_ret = EINA_FALSE; + + int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), part), content); + if (!int_ret) return EINA_FALSE; + + _icon_signal_emit(obj); + + return EINA_TRUE; +} + +/* Efl.Part for legacy begin */ + +static Eina_Bool +_part_is_efl_ui_progressbar_legacy_part(const Eo *obj EINA_UNUSED, const char *part) +{ + return eina_streq(part, "elm.swallow.content"); +} + +ELM_PART_OVERRIDE_PARTIAL(efl_ui_progressbar_legacy, EFL_UI_PROGRESSBAR_LEGACY, void, _part_is_efl_ui_progressbar_legacy_part) +ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_progressbar_legacy, EFL_UI_PROGRESSBAR_LEGACY, void) +#include "efl_ui_progressbar_legacy_part.eo.c" + +/* Efl.Part for legacy end */ + EAPI Evas_Object * elm_progressbar_add(Evas_Object *parent) { diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo index c8c16f1d31..4187d9c55b 100644 --- a/src/lib/elementary/efl_ui_progressbar.eo +++ b/src/lib/elementary/efl_ui_progressbar.eo @@ -51,8 +51,6 @@ class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format, implements { Efl.Object.constructor; Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_sub_object_add; - Efl.Ui.Widget.widget_sub_object_del; Efl.Ui.Range.range_value { get; set; } Efl.Ui.Range.range_min_max {get; set; } Efl.Ui.Direction.direction { get; set; } diff --git a/src/lib/elementary/efl_ui_progressbar_legacy.eo b/src/lib/elementary/efl_ui_progressbar_legacy.eo index b6bf882c24..fab761f3bb 100644 --- a/src/lib/elementary/efl_ui_progressbar_legacy.eo +++ b/src/lib/elementary/efl_ui_progressbar_legacy.eo @@ -5,5 +5,8 @@ class Efl.Ui.Progressbar_Legacy (Efl.Ui.Progressbar, Efl.Ui.Legacy) implements { class.constructor; Efl.Object.constructor; + Efl.Ui.Widget.theme_apply; + Efl.Ui.Widget.widget_sub_object_del; + Efl.Part.part; } } diff --git a/src/lib/elementary/efl_ui_progressbar_legacy_part.eo b/src/lib/elementary/efl_ui_progressbar_legacy_part.eo new file mode 100644 index 0000000000..18a713d851 --- /dev/null +++ b/src/lib/elementary/efl_ui_progressbar_legacy_part.eo @@ -0,0 +1,8 @@ +class Efl.Ui.Progressbar_Legacy.Part (Efl.Ui.Layout.Part_Content) +{ + [[Elementary progressbar internal part class]] + data: null; + implements { + Efl.Content.content { set; } + } +} |