rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=28fd5de900972e1e6cf2f404a882b8d325f75ace
commit 28fd5de900972e1e6cf2f404a882b8d325f75ace Author: Vitalii Vorobiov <[email protected]> Date: Fri Jun 24 11:58:51 2016 +0300 combobox_style: use eflete hover for combobox --- data/themes/default/widgets/combobox.edc | 343 +++++++------------------------ 1 file changed, 77 insertions(+), 266 deletions(-) diff --git a/data/themes/default/widgets/combobox.edc b/data/themes/default/widgets/combobox.edc index ffe46e5..6e3e685 100644 --- a/data/themes/default/widgets/combobox.edc +++ b/data/themes/default/widgets/combobox.edc @@ -207,172 +207,139 @@ group { name: "elm/button/base/combobox_vertical/default"; /* TODO: remove scripts, remake hover */ group { name: "elm/hover/base/combobox_vertical/default"; data.item: "dismiss" "on"; - // max_size limits the maximum size of expanded hoversel - // when it's scrollable. - //data.item: "max_size" "60"; script { - public visible = 0; - public right = 0; public on_dismiss = 0; - public topshow2() { - if (get_int(right) == 0) - run_program(PROGRAM:"topshow_default"); - else - run_program(PROGRAM:"topshow_right"); - set_int(visible, 1); - set_int(on_dismiss, 0); - } - public bottomshow2() { - if (get_int(right) == 0) - run_program(PROGRAM:"bottomshow_default"); - else - run_program(PROGRAM:"bottomshow_right"); - set_int(visible, 1); - set_int(on_dismiss, 0); - } } parts { part { name: "elm.swallow.offset"; type: SWALLOW; description { state: "default" 0.0; align: 0.0 0.0; - fixed: 1 1; rel1.relative: 0.0 0.0; rel2.relative: 0.0 0.0; + fixed: 1 1; } } part { name: "elm.swallow.size"; type: SWALLOW; description { state: "default" 0.0; align: 0.0 0.0; - fixed: 1 1; rel1.to: "elm.swallow.offset"; rel1.relative: 1.0 1.0; rel2.to: "elm.swallow.offset"; rel2.relative: 1.0 1.0; + fixed: 1 1; } } - part { name: "button_image"; - mouse_events: 1; - type: RECT; + part { name: "base"; type: RECT; mouse_events: 1; description { state: "default" 0.0; - rel1.to_x: "limit0"; - rel1.to_y: "elm.swallow.slot.top"; - rel2.to_x: "limit1"; - rel2.to_y: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - color: 52 53 55 255; - } - description { state: "bottom" 0.0; - rel1.to_x: "limit0"; - rel1.to_y: "elm.swallow.slot.middle"; - rel1.relative: 0.0 1.0; - rel2.to_x: "limit1"; - rel2.to_y: "elm.swallow.slot.bottom"; - color: 52 53 55 255; + color: 0 0 0 64; } } - part { name: "limit0"; type: SPACER; + part { name: "box"; type: RECT; mouse_events: 0; description { state: "default" 0.0; - rel1.to_x: "elm.swallow.slot.top"; - rel1.offset: 1 0; - rel2.to_x: "elm.swallow.slot.middle"; - rel2.offset: 0 0; - rel2.relative: 0.0 1.0; - align: 0.0 0.5; - min: 1 1; - max: 1 99999; - } - description { state: "bottom" 0.0; - inherit: "default" 0.0; - rel1.to_x: "elm.swallow.slot.bottom"; + color: 0 0 0 0; + rel1.to: "elm.swallow.size"; + rel1.offset: -2 -2; + rel2.to: "elm.swallow.size"; + rel2.offset: 1 1; } } - part { name: "limit1"; type: SPACER; + part { name: "elm.swallow.slot.left"; type: SWALLOW; description { state: "default" 0.0; - rel1.to_x: "elm.swallow.slot.middle"; - rel1.offset: -1 0; - rel1.relative: 1.0 0.0; - rel2.to_x: "elm.swallow.slot.top"; - rel2.offset: -2 0; align: 1.0 0.5; - min: 1 1; - max: 1 99999; - } - description { state: "bottom" 0.0; - inherit: "default" 0.0; - rel2.to_x: "elm.swallow.slot.bottom"; - } - } - part { name: "base"; type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 0; + rel1.to: "elm.swallow.slot.middle"; + rel1.relative: 0.0 0.0; + rel1.offset: -1 0; + rel2.to: "elm.swallow.slot.middle"; + rel2.relative: 0.0 1.0; + rel2.offset: -1 -1; + fixed: 1 0; } } - part { name: "topclip"; type: RECT; + part { name: "elm.swallow.slot.top-left"; type: SWALLOW; description { state: "default" 0.0; - rel2.to_y: "button_image"; + align: 1.0 1.0; + rel1.to: "elm.swallow.slot.middle"; + rel1.relative: 0.0 0.0; + rel1.offset: 0 0; + rel2.to: "elm.swallow.slot.middle"; + rel2.relative: 0.0 0.0; + rel2.offset: -1 -1; + fixed: 1 1; } } part { name: "elm.swallow.slot.top"; type: SWALLOW; - clip_to: "topclip"; description { state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 1; + align: 0.5 1.0; rel1.to: "elm.swallow.slot.middle"; rel1.relative: 0.0 0.0; rel1.offset: 0 -1; rel2.to: "elm.swallow.slot.middle"; rel2.relative: 1.0 0.0; + rel2.offset: -1 -1; + fixed: 0 1; } - description { state: "visible" 0.0; - inherit: "default" 0.0; + } + part { name: "elm.swallow.slot.top-right"; type: SWALLOW; + description { state: "default" 0.0; align: 0.0 1.0; + rel1.to: "elm.swallow.slot.middle"; + rel1.relative: 1.0 0.0; + rel1.offset: 0 0; + rel2.to: "elm.swallow.slot.middle"; + rel2.relative: 1.0 0.0; + rel2.offset: -1 -1; + fixed: 1 1; } - description { state: "right" 0.0; - inherit: "default" 0.0; - align: 1.0 0.0; - } - description { state: "right_visible" 0.0; - inherit: "default" 0.0; - align: 1.0 1.0; + } + part { name: "elm.swallow.slot.right"; type: SWALLOW; + description { state: "default" 0.0; + align: 0.0 0.5; + rel1.to: "elm.swallow.slot.middle"; + rel1.relative: 1.0 0.0; + rel1.offset: 0 0; + rel2.to: "elm.swallow.slot.middle"; + rel2.relative: 1.0 1.0; + rel2.offset: 0 -1; + fixed: 1 0; } } - part { name: "bottomclip"; type: RECT; + part { name: "elm.swallow.slot.bottom-right"; type: SWALLOW; description { state: "default" 0.0; - rel1.to_y: "button_image"; - rel1.offset: 0 3; + align: 0.0 0.0; + rel1.to: "elm.swallow.slot.middle"; + rel1.relative: 1.0 1.0; + rel1.offset: 0 0; + rel2.to: "elm.swallow.slot.middle"; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -1; + fixed: 1 1; } } part { name: "elm.swallow.slot.bottom"; type: SWALLOW; - clip_to: "bottomclip"; description { state: "default" 0.0; - align: 0.0 1.0; - fixed: 0 1; + align: 0.5 0.0; rel1.to: "elm.swallow.slot.middle"; rel1.relative: 0.0 1.0; rel1.offset: 0 0; rel2.to: "elm.swallow.slot.middle"; rel2.relative: 1.0 1.0; + rel2.offset: -1 0; + fixed: 0 1; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - align: 0.0 0.0; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - align: 1.0 1.0; - } - description { state: "right_visible" 0.0; - inherit: "default" 0.0; + } + part { name: "elm.swallow.slot.bottom-left"; type: SWALLOW; + description { state: "default" 0.0; align: 1.0 0.0; + rel1.to: "elm.swallow.slot.middle"; + rel1.relative: 0.0 1.0; + rel1.offset: 0 0; + rel2.to: "elm.swallow.slot.middle"; + rel2.relative: 0.0 1.0; + rel2.offset: -1 0; + fixed: 1 1; } } - part { name: "elm.swallow.slot.middle"; - type: SWALLOW; + part { name: "elm.swallow.slot.middle"; type: SWALLOW; description { state: "default" 0.0; rel1.to: "elm.swallow.size"; rel2.to: "elm.swallow.size"; @@ -389,22 +356,8 @@ group { name: "elm/hover/base/combobox_vertical/default"; } } } - program { name: "show"; - signal: "elm,action,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } program { name: "hide"; signal: "elm,action,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "base"; - after: "hidefinished"; - } - program { name: "hide_no_animate"; - signal: "elm,action,hide,no_animate"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; after: "hidefinished"; } program { name: "hidefinished"; @@ -413,115 +366,6 @@ group { name: "elm/hover/base/combobox_vertical/default"; emit("elm,action,hide,finished", "elm"); } } - program { name: "topshow"; - signal: "elm,action,slot,top,show"; source: "elm"; - script { - set_state(PART:"limit0", "default", 0.0); - set_state(PART:"limit1", "default", 0.0); - set_state(PART:"button_image", "default", 0.0); - topshow2(); - } - } - program { name: "topshow_default"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.slot.top"; - transition: DECELERATE 0.5; - } - program { name: "topshow_right"; - action: STATE_SET "right_visible" 0.0; - target: "elm.swallow.slot.top"; - transition: DECELERATE 0.5; - } - program { name: "tophide"; - signal: "elm,action,slot,top,hide"; - source: "elm"; - script { - if (get_int(right) == 0) - run_program(PROGRAM:"tophide_default"); - else - run_program(PROGRAM:"tophide_right"); - set_int(visible, 0); - } - } - program { name: "tophide_default"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.slot.top"; - transition: DECELERATE 0.5; - } - program { name: "tophide_right"; - action: STATE_SET "right" 0.0; - target: "elm.swallow.slot.top"; - transition: DECELERATE 0.5; - } - program { name: "bottomshow"; - signal: "elm,action,slot,bottom,show"; source: "elm"; - script { - set_state(PART:"limit0", "bottom", 0.0); - set_state(PART:"limit1", "bottom", 0.0); - set_state(PART:"button_image", "bottom", 0.0); - bottomshow2(); - } - } - program { name: "bottomshow_default"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.slot.bottom"; - transition: DECELERATE 0.5; - } - program { name: "bottomshow_right"; - action: STATE_SET "right_visible" 0.0; - target: "elm.swallow.slot.bottom"; - transition: DECELERATE 0.5; - } - program { name: "bottomhide"; - signal: "elm,action,slot,bottom,hide"; source: "elm"; - script { - if (get_int(right) == 0) { - run_program(PROGRAM:"bottomhide_default"); - } - else { - run_program(PROGRAM:"bottomhide_right"); - } - set_int(visible, 0); - } - } - program { name: "bottomhide_default"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.slot.bottom"; - transition: DECELERATE 0.5; - } - program { name: "bottomhide_right"; - action: STATE_SET "right" 0.0; - target: "elm.swallow.slot.bottom"; - transition: DECELERATE 0.5; - } - program { name: "align_right"; - signal: "elm,state,align,right"; source: "elm"; - script { - set_int(right, 1); - if (get_int(visible) == 0) { - set_state(PART:"elm.swallow.slot.top", "right", 0.0); - set_state(PART:"elm.swallow.slot.bottom", "right", 0.0); - } - else { - set_state(PART:"elm.swallow.slot.top", "right_visible", 0.0); - set_state(PART:"elm.swallow.slot.bottom", "right_visible", 0.0); - } - } - } - program { name: "align_default"; - signal: "elm,state,align,default"; source: "elm"; - script { - set_int(right, 0); - if (get_int(visible) == 0) { - set_state(PART:"elm.swallow.slot.top", "default", 0.0); - set_state(PART:"elm.swallow.slot.bottom", "default", 0.0); - } - else { - set_state(PART:"elm.swallow.slot.top", "visible", 0.0); - set_state(PART:"elm.swallow.slot.bottom", "visible", 0.0); - } - } - } } } @@ -1212,6 +1056,7 @@ group { name: "elm/scroller/entry_single/combobox_vertical/default"; alias: "elm/scroller/entry_single/combobox_horizontal/default"; parts { part { name: "elm.swallow.content"; + repeat_events: 1; type: SWALLOW; description { state: "default" 0.0; rel1.offset: 1 0; @@ -1224,31 +1069,14 @@ group { name: "elm/scroller/entry_single/combobox_vertical/default"; group { name: "elm/entry/base-single/combobox_vertical/default"; parts { - part { name: "elm.guide"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.to: "elm.text"; - rel2.to: "elm.text"; - text.style: "eflete_text_guide_style"; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } part { name: "elm.text"; type: TEXTBLOCK; clip_to: "disabler"; mouse_events: 1; + repeat_events: 1; scale: 1; - entry_mode: EDITABLE; cursor_mode: BEFORE; multiline: 0; - source: "elm/entry/selection/default"; - source4: "elm/entry/cursor/default"; - source5: "elm/entry/anchor/default"; description { state: "default" 0.0; min: 0 19; text { @@ -1260,6 +1088,7 @@ group { name: "elm/entry/base-single/combobox_vertical/default"; } part { name: "disabler"; type: RECT; + repeat_events: 1; description { state: "default" 0.0; } description { state: "active" 0.0; @@ -1280,23 +1109,5 @@ group { name: "elm/entry/base-single/combobox_vertical/default"; action: STATE_SET "default" 0.0; target: "disabler"; } - program { name: "gdisable"; - signal: "elm,guide,disabled"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "elm.guide"; - } - program { name: "genable"; - signal: "elm,guide,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.guide"; - } - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } } } --
