/* * Copyright 2012 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.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.tizenopensource.org/license * * 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. * */ #include "browser-macro.edc" /* define of buttons & icons */ collections { group { name: "elm/icon/browser_control_bar_multi_window/default"; min: 56 56; images.image: "icon/I01_title_icon_multiview.png" COMP; images.image: "icon/I01_title_icon_multiview_press.png" COMP; parts { part { name: "base"; scale: 1; description { state: "default" 0.0; min: 56 56; max: 56 56; fixed: 1 1; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon/I01_title_icon_multiview.png"; } description { state: "pressed" 0.0; min: 56 56; max: 56 56; fixed: 1 1; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon/I01_title_icon_multiview_press.png"; } } part { name: "elm.text"; type: TEXT; mouse_events: 0; scale: 1; description { state: "default" 0.0; visible: 0; rel1 { relative: 0.0 0.0; to: "base"; } rel2 { relative: 1.0 1.0; to: "base"; } align: 0.4 0.5; color: 57 57 57 255; text { font: "SLP:style=Medium"; size: 25; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "1" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "1"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "2" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "2"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "3" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "3"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "4" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "4"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "5" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "5"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "6" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "6"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "7" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "7"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "8" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "8"; min: 0 0; align: 0.5 0.4; max: 1 0; } } description { state: "9" 0.0; inherit: "default" 0.0; visible: 1; text { font: "SLP:style=Medium"; size: 25; text: "9"; min: 0 0; align: 0.5 0.4; max: 1 0; } } } programs { program { name: "hide,multi_window_text"; signal: "hide,multi_window_text,signal"; action: STATE_SET "default" 0.0; target: "elm.text"; } program { name: "show,multi_window_1"; signal: "show,multi_window_1,signal"; action: STATE_SET "1" 0.0; target: "elm.text"; } program { name: "show,multi_window_2"; signal: "show,multi_window_2,signal"; action: STATE_SET "2" 0.0; target: "elm.text"; } program { name: "show,multi_window_3"; signal: "show,multi_window_3,signal"; action: STATE_SET "3" 0.0; target: "elm.text"; } program { name: "show,multi_window_4"; signal: "show,multi_window_4,signal"; action: STATE_SET "4" 0.0; target: "elm.text"; } program { name: "show,multi_window_5"; signal: "show,multi_window_5,signal"; action: STATE_SET "5" 0.0; target: "elm.text"; } program { name: "show,multi_window_6"; signal: "show,multi_window_6,signal"; action: STATE_SET "6" 0.0; target: "elm.text"; } program { name: "show,multi_window_7"; signal: "show,multi_window_7,signal"; action: STATE_SET "7" 0.0; target: "elm.text"; } program { name: "show,multi_window_8"; signal: "show,multi_window_8,signal"; action: STATE_SET "8" 0.0; target: "elm.text"; } program { name: "show,multi_window_9"; signal: "show,multi_window_9,signal"; action: STATE_SET "9" 0.0; target: "elm.text"; } program { name: "multi_window,pressed"; signal: "mouse,down,1"; source: "base"; action: STATE_SET "pressed" 0.0; target: "base"; } program { name: "multi_window,default"; signal: "mouse,up,1"; source: "base"; action: STATE_SET "default" 0.0; target: "base"; } } } } BUTTON_WITH_BG(title_back, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", "icon/I01_btn_back.png", "icon/I01_btn_back.png", 6, 6, 6, 6, 124, 74, 56, 56); BUTTON_WITH_BG(bookmark_controlbar_back, "icon/I01_Back_btn_normal.png", "icon/I01_Back_btn_press.png", "icon/I01_btn_back.png", "icon/I01_btn_back.png", 7, 7, 7, 7, 112, 82, 56, 56); BUTTON_WITH_BG(browser_view_controlbar_back, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", "icon/I01_btn_back.png", "icon/I01_btn_back.png", 6, 6, 6, 6, 112, 82, 56, 56); BUTTON_WITH_BG(most_visited_sites_setting, "icon/I01_picker_btn_normal.png", "icon/I01_picker_btn_press.png", "icon/I01_icon_setting.png", "icon/I01_icon_setting.png", 6, 6, 6, 6, 144, 60, 42, 42); BUTTON(most_visited_sites_done, "icon/I01_picker_btn_normal.png", "icon/I01_picker_btn_press.png", 6, 6, 6, 6); BUTTON_WITH_BG(find_word_prev, "icon/I01_btn_normal.png", "icon/I01_btn_press.png", "icon/I01_picker_arrow_left.png", "icon/I01_picker_arrow_left.png", 0, 0, 0, 0, 64, 64, 64, 64); BUTTON_WITH_BG(find_word_next, "icon/I01_btn_normal.png", "icon/I01_btn_press.png", "icon/I01_picker_arrow_right.png", "icon/I01_picker_arrow_right.png", 0, 0, 0, 0, 64, 64, 64, 64); FIND_BUTTON_WITH_BG(find_word_prev_but, "icon/I01_btn_normal.png", "icon/I01_btn_press.png", "icon/I01_picker_arrow_left.png", "icon/I01_btn_dim.png", 0, 0, 0, 0, 64, 64, 64, 64); FIND_BUTTON_WITH_BG(find_word_next_but, "icon/I01_btn_normal.png", "icon/I01_btn_press.png", "icon/I01_picker_arrow_right.png", "icon/I01_btn_dim.png", 0, 0, 0, 0, 64, 64, 64, 64); BUTTON_WITH_BG(reader_icon, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", "icon/I01_fit_screen.png", "icon/I01_fit_screen.png", 7, 7, 7, 7, 74, 64, 74, 64); TITLE_BUTTON(title_button, "icon/I01_title_btn_blue.png", "icon/I01_title_btn_blue_press.png", 6, 6, 6, 6); TITLE_BUTTON(cancel_button, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", 7, 7, 7, 7); BUTTON_WITH_TEXT(multi_window_cancel_button, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", 6, 6, 6, 6, 112, 82); BUTTON_WITH_BG(backward, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", "icon/I01_title_btn_icon_previous.png", "icon/I01_title_btn_icon_previous_disable.png", 7, 7, 7, 7, 78, 66, 42, 42); BUTTON_WITH_BG(forward, "icon/I01_title_btn.png", "icon/I01_title_btn_press.png", "icon/I01_title_btn_icon_next.png", "icon/I01_title_btn_icon_next_disable.png", 7, 7, 7, 7, 78, 66, 42, 42); BUTTON(ok_button, "browser-view-images/most-visited-sites/I01_button_popup_normal.png", "browser-view-images/most-visited-sites/I01_button_popup_press.png", 4, 4, 4, 4); /* ifdef ZOOM_BUTTON */ ZOOM_BUTTON(zoom_out, "browser-view-images/00_zoom_out.png", "browser-view-images/00_zoom_out_press.png", "browser-view-images/00_zoom_out_disable.png", 0, 0, 0, 0); ZOOM_BUTTON(zoom_in, "browser-view-images/00_zoom_in.png", "browser-view-images/00_zoom_in_press.png", "browser-view-images/00_zoom_in_disable.png", 0, 0, 0, 0); /* endif ZOOM_BUTTON */ #define BUTTON_STATE_ENABLED 0 #define BUTTON_STATE_DISABLED 1 group { name: "elm/button/base/browser/navigationbar_control/button"; script { public button_state = BUTTON_STATE_ENABLED; } images.image: "icon/I01_Option_header_bt.png" COMP; images.image: "icon/I01_Option_header_bt_dim.png" COMP; images.image: "icon/I01_Option_header_bt_press.png" COMP; parts { part { name: "button_image"; type: IMAGE; mouse_events: 1; scale: 1; description { state: "default" 0.0; min: 30 75; color: 0 0 0 0; rel1.offset: 7 12; rel2.offset: -9 -4; image.normal: "icon/I01_Option_header_bt.png"; image.border: 4 4 4 4; color: 255 255 255 255; } description { state: "disabled" 0.0; inherit: "default" 0.0; image.normal: "icon/I01_Option_header_bt_dim.png"; } description { state: "clicked" 0.0; inherit: "default" 0.0; image.normal: "icon/I01_Option_header_bt_press.png"; } } part { name: "padding_left_top"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; align: 0.0 0.0; rel1.relative: 0.0 0.0; rel2.relative: 0.0 0.0; min: 15 7; fixed: 1 1; visible: 0; } } part { name: "padding_right_bottom"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; align: 1.0 1.0; rel1.relative: 1.0 1.0; rel2.relative: 1.0 1.0; min: 15 7; fixed: 1 1; visible: 0; } } part { name: "icon_rect"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; visible: 1; min: 0 0; fixed: 1 0; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } align: 0.0 0.5; color: 0 0 0 0; } description { state: "visible" 0.0; visible: 1; min: 33 33; fixed: 1 0; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } align: 0.0 0.5; color: 0 0 0 0; } description { state: "icononly" 0.0; inherit: "default" 0.0; } } part { name: "padding_after_icon"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; //when only icon or no icon is there align: 0.0 0.0; rel1 { relative: 1.0 0.0; to: "icon_rect"; } rel2 { relative: 1.0 1.0; to: "icon_rect"; } fixed: 1 0; min: 0 0; color: 0 0 0 0; } description { state: "visible" 0.0; visible: 1; align: 0.0 0.0; rel1 { relative: 1.0 0.0; to: "icon_rect"; } rel2 { relative: 1.0 1.0; to: "icon_rect"; } fixed: 1 0; min: 9 0; color: 0 0 0 0; } description { state: "icononly" 0.0; inherit: "default" 0.0; } } part { name: "padding_before_text"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; //when only icon or no icon is there align: 1.0 0.5; rel1 { relative: 0.0 1.0; to_x: "elm.text"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to_x: "elm.text"; to_y: "padding_right_bottom"; } fixed: 1 0; min: 9 0; color: 0 0 0 0; } } part { name: "elm.swallow.content"; type: SWALLOW; scale: 1; clip_to: "disabler"; description { state: "default" 0.0; visible: 0; align: 0.0 0.5; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } fixed: 1 0; } description { state: "visible" 0.0; fixed: 1 0; visible: 1; min: 33 33; max: 33 33; align: 1.0 0.5; rel1 { relative: 0.0 1.0; to_x: "padding_before_text"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to_x: "padding_before_text"; to_y: "padding_right_bottom"; } aspect: 1.0 1.0; aspect_preference: VERTICAL; } description { state: "icononly" 0.0; visible: 1; min: 45 45; max: 45 45; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } align: 0.5 0.5; aspect: 1.0 1.0; aspect_preference: VERTICAL; } } part { name: "elm.text"; type: TEXT; mouse_events: 0; scale: 1; clip_to: "disabler"; description { state: "default" 0.0; visible: 0; rel1 { relative: 1.0 1.0; to_x: "padding_after_icon"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } align: 0.5 0.5; color: 255 255 255 255; text { font: "SLP:style=Medium"; size: 30; min: 0 0; align: 0.5 0.6; max: 1 0; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; } description { state: "clicked" 0.0; inherit: "default" 0.0; visible: 1; min: 0 0; color2: 0 0 0 102; } description { state: "focused" 0.0; inherit: "default" 0.0; visible: 1; min: 0 0; color: 255 255 255 255; color2: 0 0 0 102; } } part { name: "over2"; type: RECT; mouse_events: 1; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; 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; color: 0 0 0 0; } description { state: "clicked" 0.0; inherit: "default" 0.0; visible: 1; } } part { name: "disabler"; type: RECT; description { state: "default" 0.0; color: 255 255 255 255; } description { state: "disabled" 0.0; color: 255 255 255 127; } } } 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"; after: "text_clicked"; } program { name: "text_clicked"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) set_state(PART:"elm.text", "clicked", 0.0); } } program { name: "button_unpress"; action: SIGNAL_EMIT "elm,action,unpress" ""; } program { name: "button_mouseout_clicked"; signal: "mouse,up,1"; source: "over3"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (strcmp(st, "icononly")) { emit("elm,action,default,text,set", ""); set_state(PART:"elm.text", "visible", 0.0); } if(get_int(button_state) != BUTTON_STATE_DISABLED) set_state(PART:"button_image", "default", 0.0); } after: button_unpress; } program { name: "button_click2"; signal: "mouse,down,1"; source: "over3"; action: STATE_SET "clicked" 0.0; target: "over3"; } program { name: "button_unclick2"; signal: "mouse,clicked,1"; source: "over3"; action: STATE_SET "default" 0.0; target: "over3"; } program { name: "button_unclick3"; signal: "mouse,clicked,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "text_show"; signal: "elm,state,text,visible"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (!strcmp(st, "icononly")) { set_state(PART:"elm.swallow.content", "visible", 0.0); set_state(PART:"icon_rect", "visible", 0.0); set_state(PART:"padding_after_icon", "visible", 0.0); } set_state(PART:"elm.text", "visible", 0.0); } } program { name: "text_hide"; signal: "elm,state,text,hidden"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (!strcmp(st, "visible")) { set_state(PART:"elm.swallow.content", "icononly", 0.0); set_state(PART:"icon_rect", "icononly", 0.0); set_state(PART:"padding_after_icon", "icononly", 0.0); } set_state(PART:"elm.text", "default", 0.0); } } program { name: "icon_show"; signal: "elm,state,icon,visible"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) { set_state(PART:"elm.swallow.content", "visible", 0.0); set_state(PART:"icon_rect", "visible", 0.0); set_state(PART:"padding_after_icon", "visible", 0.0); } else { set_state(PART:"elm.swallow.content", "icononly", 0.0); set_state(PART:"icon_rect", "icononly", 0.0); set_state(PART:"padding_after_icon", "icononly", 0.0); } } } program { name: "icon_hide"; signal: "elm,state,icon,hidden"; source: "elm"; action: STATE_SET "default" 0.0; target: "elm.swallow.content"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "button_image"; target: "over2"; target: "disabler"; after: "disable_text"; } program { name: "disable_text"; script { set_int(button_state, BUTTON_STATE_DISABLED); set_state(PART:"elm.text", "visible", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; action: STATE_SET "default" 0.0; target: "button_image"; target: "over2"; target: "disabler"; after: "enable_text"; } program { name: "enable_text"; script { set_int(button_state, BUTTON_STATE_ENABLED); set_state(PART:"elm.text", "visible", 0.0); } } program { name: "focused"; action: STATE_SET "focused" 0.0; target: "button_image"; target: "elm.text"; } program { name: "unfocused"; action: STATE_SET "default" 0.0; target: "button_image"; after: "unfocus_text"; } program { name: "unfocus_text"; action: STATE_SET "visible" 0.0; target: "elm.text"; } } } #define BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC 100 60 #define BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC 33 30 #define NAVIBAR_TITLE_RIGHT_SEPARATOR_COLOR_INC 84 93 110 255 #define NAVIBAR_TITLE_LEFT_SEPARATOR_COLOR_INC 35 45 61 255 group { name: "elm/button/base/naviframe/back_btn/browser/default"; alias: "elm/button/base/naviframe_end_btn/browser/default"; //TODO: Remove this alias later alias: "elm/button/base/navigationbar_prev_btn/browser/default"; alias: "elm/button/base/navigationbar_backbutton/browser/default"; alias: "elm/button/base/navigationbar_end_btn/browser/default"; images { image: "browser-view-images/I01_btn_prev.png" COMP; image: "browser-view-images/I01_btn_prev_press.png" COMP; } parts { part { name: "button_image"; type: RECT; mouse_events: 1; scale: 1; description { state: "default" 0.0; min: BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC; color: 0 0 0 0; } description { state: "clicked" 0.0; inherit: "default" 0.0; } description { state: "disabled" 0.0; inherit: "default" 0.0; } } part {name: "padding_right"; type: RECT; mouse_events: 0; description { state: "default" 0.0; align: 1 0; min: 1 0; rel1 { relative: 1 0.2; } rel2 { relative: 1 0.8; } fixed: 1 0; color: NAVIBAR_TITLE_RIGHT_SEPARATOR_COLOR_INC; } } part {name: "padding_before_right"; type: RECT; mouse_events: 0; description { state: "default" 0.0; align: 1 0; min: 1 0; rel1 { relative: 0 0; to: "padding_right"; } rel2 { relative: 0 1; to: "padding_right"; } fixed: 1 0; color: NAVIBAR_TITLE_LEFT_SEPARATOR_COLOR_INC; } } part { name: "button_center_part"; mouse_events: 0; scale: 1; description { state: "default" 0.0; min: BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC; max: BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC; align: 0.5 0.5; rel2 { relative: 0 1; to_x: "padding_before_right"; } image { normal: "browser-view-images/I01_btn_prev.png"; } } description { state: "clicked" 0.0; inherit: "default" 0.0; image.normal: "browser-view-images/I01_btn_prev_press.png"; } } part { name: "over1"; type: RECT; mouse_events: 1; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "over2"; mouse_events: 1; repeat_events: 1; description { state: "default" 0.0; color: 0 0 0 0; } } 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: "over1"; action: SIGNAL_EMIT "elm,action,press" ""; after: "button_click_anim"; } program { name: "button_click_anim"; action: STATE_SET "clicked" 0.0; target: "button_image"; target: "button_center_part"; } 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"; action: STATE_SET "default" 0.0; target: "button_image"; target: "button_center_part"; } program { name: "button_unclick2"; signal: "mouse,clicked,1"; source: "over1"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "disabler"; target: "button_image"; } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; action: STATE_SET "default" 0.0; target: "disabler"; target: "button_image"; } } } }