From 2d1b0b839f90ba4879265543a47a526dbd2a068a Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 24 Jun 2013 22:12:40 +0900 Subject: [PATCH] [naviframe & button] Support variable size of title text button style Change-Id: I7bf13ba93036bd8e30c459c7981fbc53ddd354aa --- themes/inc/tizen-dark-inc.edc | 15 ++++++++--- themes/inc/tizen-light-inc.edc | 11 ++++++-- themes/widgets/button.edc | 59 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 68 insertions(+), 17 deletions(-) diff --git a/themes/inc/tizen-dark-inc.edc b/themes/inc/tizen-dark-inc.edc index edf5123..097d45c 100755 --- a/themes/inc/tizen-dark-inc.edc +++ b/themes/inc/tizen-dark-inc.edc @@ -36,8 +36,8 @@ #define NAVIFRAME_TAB_TITLE_H2_INC 126 #define NAVIFRAME_TOOLBAR_HEIGHT_INC 98 #define NAVIFRAME_LANDSCAPE_TOOLBAR_HEIGHT_INC 85 -#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 124 96 -#define NAVIFRAME_LANDSCAPE_TITLE_FUNC_BTN_SIZE_INC 124 91 +#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 183 96 +#define NAVIFRAME_LANDSCAPE_TITLE_FUNC_BTN_SIZE_INC 183 91 #define NAVIFRAME_PREV_FUNC_BTN_SIZE_INC 85 98 #define NAVIFRAME_LANDSCAPE_PREV_FUNC_BTN_SIZE_INC 85 85 #define NAVIFRAME_TITLE_TAB_H_INC 75 @@ -545,8 +545,15 @@ #define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_ICON_BG_MIN_MAX_INC 115 91 #define BUTTON_NAVIFRAME_TITLE_ICON_IMAGE_MIN_MAX_INC 63 63 -#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_MAX_INC 124 96 -#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_MAX_INC 124 91 +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_INC 0 96 +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_MAX_INC 183 96 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_INC 0 91 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MAX_INC 183 91 +#define BUTTON_NAVIFRAME_TITLE_TEXT_LEFT_PADDING_INC 16 +#define BUTTON_NAVIFRAME_TITLE_TEXT_TEXTBLOCK_MIN_INC 0 96 +#define BUTTON_NAVIFRAME_TITLE_TEXT_TEXTBLOCK_MAX_INC 151 96 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_TEXTBLOCK_MIN_INC 0 91 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_TEXTBLOCK_MAX_INC 151 91 #define BUTTON_NAVIFRAME_TITLE_TEXT_BG_PRESSED_BORDER_INC 8 8 8 8 #define BUTTON_NAVIFRAME_TITLE_TEXT_FONT_SIZE_INC 32 #define BUTTON_NAVIFRAME_TITLE_TEXT_MIN_FONT_SIZE_INC 32 diff --git a/themes/inc/tizen-light-inc.edc b/themes/inc/tizen-light-inc.edc index 3690d9e..ad3feb1 100755 --- a/themes/inc/tizen-light-inc.edc +++ b/themes/inc/tizen-light-inc.edc @@ -575,8 +575,15 @@ #define BUTTON_NAVIFRAME_TITLE_ICON_TOP_PADDING_INC 0 34 #define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_ICON_TOP_PADDING_INC 0 17 -#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_MAX_INC 124 96 -#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_MAX_INC 124 91 +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_INC 124 96 +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_MAX_INC 124 96 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_INC 124 91 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MAX_INC 124 91 +#define BUTTON_NAVIFRAME_TITLE_TEXT_LEFT_PADDING_INC 16 +#define BUTTON_NAVIFRAME_TITLE_TEXT_TEXTBLOCK_MIN_INC 0 96 +#define BUTTON_NAVIFRAME_TITLE_TEXT_TEXTBLOCK_MAX_INC 151 96 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_TEXTBLOCK_MIN_INC 0 91 +#define BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_TEXTBLOCK_MAX_INC 151 91 #define BUTTON_NAVIFRAME_TITLE_TEXT_BG_PRESSED_BORDER_INC 8 8 8 8 #define BUTTON_NAVIFRAME_TITLE_TEXT_FONT_SIZE_INC 38 #define BUTTON_NAVIFRAME_TITLE_TEXT_MIN_FONT_SIZE_INC 32 diff --git a/themes/widgets/button.edc b/themes/widgets/button.edc index 1273b88..f75366e 100644 --- a/themes/widgets/button.edc +++ b/themes/widgets/button.edc @@ -6045,12 +6045,12 @@ BUTTON_SCROLL_JUMPTO("jumpto_left", "00_icon_jump_left.png") type: RECT; scale: 1; description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_MAX_INC; + min: BUTTON_NAVIFRAME_TITLE_TEXT_BG_MIN_INC; + max: BUTTON_NAVIFRAME_TITLE_TEXT_BG_MAX_INC; } description { state: "landscape" 0.0; - min: BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_MAX_INC; + min: BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MIN_INC; + max: BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_MAX_INC; } } part { name: "button_image"; @@ -6071,20 +6071,53 @@ BUTTON_SCROLL_JUMPTO("jumpto_left", "00_icon_jump_left.png") } } } + part { name: "left_padding"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: BUTTON_NAVIFRAME_TITLE_TEXT_LEFT_PADDING_INC 0; + max: BUTTON_NAVIFRAME_TITLE_TEXT_LEFT_PADDING_INC -1; + align: 0.0 0.5; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "button_bg"; } + rel2 { relative: 0.0 1.0; to: "button_bg"; } + } + } + part { name: "right_padding"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: BUTTON_NAVIFRAME_TITLE_TEXT_LEFT_PADDING_INC 0; + max: BUTTON_NAVIFRAME_TITLE_TEXT_LEFT_PADDING_INC -1; + align: 1.0 0.5; + fixed: 1 0; + rel1 { relative: 1.0 0.0; to: "button_bg"; } + rel2 { relative: 1.0 1.0; to: "button_bg"; } + } + } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; clip_to: "button_bg"; description { state: "default" 0.0; - rel1.to: "button_bg"; - rel2.to: "button_bg"; + min: BUTTON_NAVIFRAME_TITLE_TEXT_TEXTBLOCK_MIN_INC; + max: BUTTON_NAVIFRAME_TITLE_TEXT_TEXTBLOCK_MAX_INC; + rel1 { relative: 1.0 0.0; to: "left_padding"; } + rel2 { relative: 0.0 1.0; to: "right_padding"; } text { style: "btn_naviframe_title_text"; size: BUTTON_NAVIFRAME_TITLE_TEXT_FONT_SIZE_INC; - min: 0 1; + min: 1 0; } } + description { state: "landscape" 0.0; + inherit: "default" 0.0; + min: BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_TEXTBLOCK_MIN_INC; + max: BUTTON_NAVIFRAME_LANDSCAPE_TITLE_TEXT_TEXTBLOCK_MAX_INC; + } } part { name: "over2"; type: RECT; @@ -6152,14 +6185,18 @@ BUTTON_SCROLL_JUMPTO("jumpto_left", "00_icon_jump_left.png") program { name: "change_to_landscape"; signal: "elm,state,landscape"; source: "elm"; - action: STATE_SET "landscape" 0.0; - target: "button_bg"; + script { + set_state(PART:"button_bg", "landscape", 0.0); + set_state(PART:"elm.text", "landscape", 0.0); + } } program { name: "change_to_portrait"; signal: "elm,state,portrait"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_bg"; + script { + set_state(PART:"button_bg", "default", 0.0); + set_state(PART:"elm.text", "default", 0.0); + } } program { name: "landscape_mode"; source: "elm"; -- 2.7.4