/* * efl-theme-tizen * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ group { name: "elm/panes/vertical/default"; images { image: "00_splite_handler_bg_v.png" COMP; image: "00_splite_handler_bg_press.png" COMP; image: "00_splite_handler_v.png" COMP; } parts { part { name: "whole"; type: RECT; description { state: "default" 0.0; visible: 0; rel1.to_x: "pad_left"; rel2.to_x: "pad_right"; } } part { name: "pad_left"; type: RECT; scale: 1; description { state: "default" 0.0; rel2.relative:0.0 1.0; min: PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC 0; fixed: 1 0; align: 1.0 0.5; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } part { name: "pad_right"; type: RECT; scale: 1; description { state: "default" 0.0; rel1.relative: 1.0 0.0; min: PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC 0; fixed: 1 0; align: 0.0 0.5; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } //2 contents part { name: "whole_left"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1 { to_x: "pad_left"; relative: 1.0 0.0; } rel2 { to_x: "bar_bg"; relative: 0.0 1.0; } } description { state: "hide" 0.0; inherit: "default" 0.0; color: 255 255 255 0; } } part { name: "elm.swallow.left"; type: SWALLOW; clip_to: "whole_left"; description { state: "default" 0.0; align: 0.0 0.5; rel1.to: "whole_left"; rel2.to: "whole_left"; } description { state: "hide" 0.0; inherit: "default" 0.0; rel1.relative: -1.0 0.0; rel2.relative: 0.0 1.0; } } part { name: "whole_right"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1 { to_x: "bar_bg"; relative: 1.0 0.0; } rel2 { to_x: "pad_right"; relative: 0.0 1.0; } } } part { name: "elm.swallow.right"; type: SWALLOW; clip_to: "whole_right"; description { state: "default" 0.0; align: 1.0 0.5; rel1.to: "whole_right"; rel2.to: "whole_right"; } } //BAR part { name: "elm.bar"; type: RECT; dragable { confine: "whole"; x: 1 1 1; y: 0 0 0; } scale: 1; description { state: "default" 0.0; min: PANES_STYLE_DEFAULT_MOVABLE_SIZE_INC 999999; fixed: 0 1; align: 1.0 0.5; rel1.relative: 0.0 0.5; rel2.relative: 1.0 0.5; color: 0 0 0 0; } description { state: "default" 0.1; inherit: "default" 0.0; min: 0 999999; } description { state: "disabled" 0.0; inherit: "default" 0.0; min: PANES_STYLE_DEFAULT_FIXED_SIZE_INC 999999; } description { state: "disabled" 0.1; inherit: "default" 0.1; } } part { name: "pad_bar_left"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; min: PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC 0; align: 0.0 0.5; rel1.to_x: "elm.bar"; rel2 { relative: 0.0 1.0; to_x: "elm.bar"; } fixed: 1 0; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } part { name: "pad_bar_right"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; min: PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC 0; align: 1.0 0.5; rel1 { relative: 1.0 0.0; to_x: "elm.bar"; } rel2.to_x: "elm.bar"; fixed: 1 0; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } part { name: "bar_bg"; type: IMAGE; mouse_events: 0; description { state: "default" 0.0; rel1 { relative: 1.0 0.0; to_x: "pad_bar_left"; } rel2 { relative: 0.0 1.0; to_x: "pad_bar_right"; } fixed: 1 0; image { normal: "00_splite_handler_bg_v.png"; border: 2 2 0 0; border_scale: 1; } } description { state: "clicked" 0.0; inherit: "default" 0.0; image.normal: "00_splite_handler_bg_press.png"; } } part { name:"bar_handler"; mouse_events: 0; description { state:"default" 0.0; rel1 { to_x: "bar_bg"; relative: 0.0 0.5; } rel2 { to_x: "bar_bg"; relative: 1.0 0.5; } fixed: 0 1; min: 0 PANES_STYLE_DEFAULT_MIDDLE_SIZE_INC; image.normal: "00_splite_handler_v.png"; } description { state:"clicked" 0.0; inherit: "default" 0.0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 0; } } part { name: "over2"; type: RECT; mouse_events: 1; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; rel1.to: "elm.bar"; rel2.to: "elm.bar"; color: 0 0 0 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 0; } } part { name: "over3"; type: RECT; mouse_events: 1; repeat_events: 1; description { state: "default" 0.0; rel1.to: "elm.bar"; rel2.to: "elm.bar"; color: 0 0 0 0; } description { state: "clicked" 0.0; inherit: "default" 0.0; } } part { name:"bar_disabled"; type: RECT; description { state:"default" 0.0; rel1.to_x: "elm.bar"; rel2.to_x: "elm.bar"; color: 0 0 0 0; visible: 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } script { public state_pair = 1; //0:both contents are not set, 1:both contents are set public frame_num, whole_drag; public drag_effect(val) { new Float:time, Float:cur_drag, Float:drag; new num; num = get_int(frame_num); drag = get_float(whole_drag); num += 1; time = 0.06 * num; // decide speed cur_drag = drag - drag * sin(time * 90, DEGREES); set_int(frame_num, num); if (time < 1.0 && cur_drag > 0.0) { set_drag(PART:"elm.bar", cur_drag, 0.0); timer(0.02, "drag_effect", val); } else { set_drag(PART:"elm.bar", 0.0, 0.0); run_program(PROGRAM:"left_content_reset"); } } } programs { program { name: "load"; signal: "load"; source: ""; script { set_int(state_pair, 1); } } program { name: "drag_effect_start"; signal: "left,hide,effect"; source: ""; script { new Float:x, Float:y; get_drag(PART:"elm.bar", x, y); set_float(whole_drag, x); set_int(frame_num, 0); timer(0.02, "drag_effect", 0); } after: "left_content_hide"; } program { name: "left_content_hide"; action: STATE_SET "hide" 0.0; transition: DECELERATE 0.4; target: "elm.swallow.left"; target: "whole_left"; } program { name: "left_content_reset"; action: STATE_SET "default" 0.0; target: "elm.swallow.left"; target: "whole_left"; after: "effect_finished"; } program { name: "effect_finished"; action: SIGNAL_EMIT "left,hide,effect,finished" ""; } program { name: "panes_pair"; signal: "elm,panes,pair"; source: ""; script { new st[31]; new Float:vl; set_int(state_pair, 1); get_state(PART:"elm.bar", st, 30, vl); set_state(PART:"elm.bar", st, 0.0); set_state(PART:"pad_left", "default", 0.0); set_state(PART:"pad_right", "default", 0.0); set_state(PART:"pad_bar_left", "default", 0.0); set_state(PART:"pad_bar_right", "default", 0.0); } } program { name: "panes_unpair"; signal: "elm,panes,unpair"; source: ""; script { new st[31]; new Float:vl; set_int(state_pair, 0); get_state(PART:"elm.bar", st, 30, vl); set_state(PART:"elm.bar", st, 0.1); set_state(PART:"pad_left", "hidden", 0.0); set_state(PART:"pad_right", "hidden", 0.0); set_state(PART:"pad_bar_left", "hidden", 0.0); set_state(PART:"pad_bar_right", "hidden", 0.0); } } 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"; script { set_state(PART:"bar_bg", "clicked", 0.0); } } program { name: "button_unclick"; signal: "mouse,up,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,unpress" ""; after: "button_unclick_anim"; } program { name: "button_unclick_anim"; script { set_state(PART:"bar_bg", "default", 0.0); } } 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,up,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "button_down_double"; signal: "mouse,down,1,double"; source: "over3"; action: SIGNAL_EMIT "elm,action,click,double" ""; } //fix the pane program { name: "panes_fixed"; signal: "elm.panes.fixed"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "bar_disabled"; target: "bar_handler"; after: "after_fixed"; } program { name: "after_fixed"; script { if (get_int(state_pair)) set_state(PART:"elm.bar", "disabled", 0.0); else set_state(PART:"elm.bar", "disabled", 0.1); } } //allow the movement by interaction program { name: "panes_unfixed"; signal: "elm.panes.unfixed"; source: "elm"; action: STATE_SET "default" 0.0; target: "bar_disabled"; target: "bar_handler"; after: "after_unfixed"; } program { name: "after_unfixed"; script { if (get_int(state_pair)) set_state(PART:"elm.bar", "default", 0.0); else set_state(PART:"elm.bar", "default", 0.1); } } } } group { name: "elm/panes/horizontal/default"; images { image: "00_splite_handler_bg_h.png" COMP; image: "00_splite_handler_bg_press.png" COMP; image: "00_splite_handler_h.png" COMP; } script { public state_pair = 1; //0:both contents are not set, 1:both contents are set } parts { part { name: "whole"; type: RECT; description { state: "default" 0.0; visible: 0; rel1.to_y: "pad_left"; rel2.to_y: "pad_right"; } } part { name: "pad_left"; type: RECT; scale: 1; description { state: "default" 0.0; rel2.relative:1.0 0.0; min: 0 PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC; fixed: 0 1; align: 0.5 1.0; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } part { name: "pad_right"; type: RECT; scale: 1; description { state: "default" 0.0; rel1.relative: 0.0 1.0; min: 0 PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC; fixed: 0 1; align: 0.5 0.0; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } //2 contents part { name: "whole_left"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1 { to_y: "pad_left"; relative: 0.0 1.0; } rel2 { to_y: "bar_bg"; relative: 1.0 0.0; } } } part { name: "elm.swallow.left"; type: SWALLOW; clip_to: "whole_left"; description { state: "default" 0.0; align: 0.5 0.0; rel1.to: "whole_left"; rel2.to: "whole_left"; } } part { name: "whole_right"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1 { to_y: "bar_bg"; relative: 0.0 1.0; } rel2 { to_y: "pad_right"; relative: 1.0 0.0; } } } part { name: "elm.swallow.right"; type: SWALLOW; clip_to: "whole_right"; description { state: "default" 0.0; align: 0.5 1.0; rel1.to: "whole_right"; rel2.to: "whole_right"; } } //BAR part { name: "elm.bar"; type: RECT; dragable { confine: "whole"; x: 0 0 0; y: 1 1 1; } scale: 1; description { state: "default" 0.0; min: 999999 PANES_STYLE_DEFAULT_MOVABLE_SIZE_INC; fixed: 1 0; align: 0.5 0.0; rel1.relative: 0.5 0.0; rel2.relative: 0.5 1.0; color: 0 0 0 0; } description { state: "default" 0.1; inherit: "default" 0.0; min: 999999 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; min: 999999 PANES_STYLE_DEFAULT_FIXED_SIZE_INC; visible: 0; } description { state: "disabled" 0.1; inherit: "default" 0.1; } } part { name: "pad_bar_left"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; min: 0 PANES_STYLE_DEFAULT_PADDING_LEFT_SIZE_INC; align: 0.5 0.0; rel1.to_y: "elm.bar"; rel2 { relative: 1.0 0.0; to_y: "elm.bar"; } fixed: 0 1; visible: 0; } description { state: "hidden" 0.0; inherit: "default" 0.0; min: 0 0; } } part { name: "pad_bar_right"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; min: 0 PANES_STYLE_DEFAULT_PADDING_RIGHT_SIZE_INC; align: 0.5 1.0; rel1 { relative: 0.0 1.0; to_y: "elm.bar"; } rel2.to_y: "elm.bar"; fixed: 0 1; visible: 0; } description { state: "visible" 0.0; inherit: "default" 0.0; min: 0 0; } } part { name: "bar_bg"; type: IMAGE; mouse_events: 0; description { state: "default" 0.0; rel1 { relative: 0.0 1.0; to_y: "pad_bar_left"; } rel2 { relative: 1.0 0.0; to_y: "pad_bar_right"; } fixed: 0 1; image { normal: "00_splite_handler_bg_h.png"; border: 0 0 2 2; border_scale: 1; } } description { state: "clicked" 0.0; inherit: "default" 0.0; image.normal: "00_splite_handler_bg_press.png"; } } part { name:"bar_handler"; mouse_events: 0; description { state:"default" 0.0; rel1 { to_y: "bar_bg"; relative: 0.5 0.0; } rel2 { to_y: "bar_bg"; relative: 0.5 1.0; } fixed: 1 0; min: PANES_STYLE_DEFAULT_MIDDLE_SIZE_INC 0; image.normal: "00_splite_handler_h.png"; } description { state:"clicked" 0.0; inherit: "default" 0.0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 0; } } part { name: "over2"; type: RECT; mouse_events: 1; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; rel1.to: "elm.bar"; rel2.to: "elm.bar"; color: 0 0 0 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 0; } } part { name: "over3"; type: RECT; mouse_events: 1; repeat_events: 1; description { state: "default" 0.0; rel1.to: "elm.bar"; rel2.to: "elm.bar"; color: 0 0 0 0; } description { state: "clicked" 0.0; inherit: "default" 0.0; } } part { name:"bar_disabled"; type: RECT; description { state:"default" 0.0; rel1.to_y: "elm.bar"; rel2.to_y: "elm.bar"; color: 0 0 0 0; visible: 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { program { name: "load"; signal: "load"; source: ""; script { set_int(state_pair, 1); } } program { name: "panes_pair"; signal: "elm,panes,pair"; source: ""; script { new st[31]; new Float:vl; set_int(state_pair, 1); get_state(PART:"elm.bar", st, 30, vl); set_state(PART:"elm.bar", st, 0.0); set_state(PART:"pad_left", "default", 0.0); set_state(PART:"pad_right", "default", 0.0); set_state(PART:"pad_bar_left", "default", 0.0); set_state(PART:"pad_bar_right", "default", 0.0); } } program { name: "panes_unpair"; signal: "elm,panes,unpair"; source: ""; script { new st[31]; new Float:vl; set_int(state_pair, 0); get_state(PART:"elm.bar", st, 30, vl); set_state(PART:"elm.bar", st, 0.1); set_state(PART:"pad_left", "hidden", 0.0); set_state(PART:"pad_right", "hidden", 0.0); set_state(PART:"pad_bar_left", "hidden", 0.0); set_state(PART:"pad_bar_right", "hidden", 0.0); } } 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"; script { set_state(PART:"bar_bg", "clicked", 0.0); } } program { name: "button_unclick"; signal: "mouse,up,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,unpress" ""; after: "button_unclick_anim"; } program { name: "button_unclick_anim"; script { set_state(PART:"bar_bg", "default", 0.0); } } 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,up,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "button_down_double"; signal: "mouse,down,1,double"; source: "over3"; action: SIGNAL_EMIT "elm,action,click,double" ""; } //fix the pane program { name: "panes_fixed"; signal: "elm.panes.fixed"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "bar_disabled"; target: "bar_handler"; after: "after_fixed"; } program { name: "after_fixed"; script { if (get_int(state_pair)) set_state(PART:"elm.bar", "disabled", 0.0); else set_state(PART:"elm.bar", "disabled", 0.1); } } //allow the movement by interaction program { name: "panes_unfixed"; signal: "elm.panes.unfixed"; source: "elm"; action: STATE_SET "default" 0.0; target: "bar_disabled"; target: "bar_handler"; after: "after_unfixed"; } program { name: "after_unfixed"; script { if (get_int(state_pair)) set_state(PART:"elm.bar", "default", 0.0); else set_state(PART:"elm.bar", "default", 0.1); } } } }