From 4e3e6b8f02d677846aec4106a9fafea61b499f89 Mon Sep 17 00:00:00 2001 From: woochan lee Date: Mon, 4 Jan 2016 14:55:04 -0800 Subject: multibuttonentry: add color classes and text classes. Summary: The following new color classes and text classes for multibuttonentry widget are added. "multibuttonentry_bg", "Multibuttonentry Background" "multibuttonentry_item_bg", "Multibuttonentry Item Background" "multibuttonentry_item_bg_selected", "Multibuttonentry Item Selected Background" "multibuttonentry_item_text", "Multibuttonentry Item Text" "multibuttonentry_item_text_pressed", "Multibuttonentry Item Pressed Text" "multibuttonentry_item_text_disabled", "Multibuttonentry Item Disabled Text" @feature Reviewers: raster, cedric, Hermet, kimcinoo, woohyun Subscribers: SanghyeonLee, eagleeye, id213sin Differential Revision: https://phab.enlightenment.org/D3494 Signed-off-by: Cedric BAIL --- data/themes/colorclasses.edc | 24 +++++++++ data/themes/edc/elm/multibuttonentry.edc | 84 +++++++++++++++++++++++++++----- 2 files changed, 96 insertions(+), 12 deletions(-) (limited to 'data') diff --git a/data/themes/colorclasses.edc b/data/themes/colorclasses.edc index a67d4450b..5d92ec1d5 100644 --- a/data/themes/colorclasses.edc +++ b/data/themes/colorclasses.edc @@ -324,6 +324,30 @@ color_classes { color: 255 255 255 255; desc: "Color of ctxpopup background"; } + color_class { name: "multibuttonentry_bg"; + color: 0 0 0 0; + desc: "Background of a multibuttonentry widget"; + } + color_class { name: "multibuttonentry_item_bg"; + color: 0 0 0 0; + desc: "Background of a multibuttonentry item object"; + } + color_class { name: "multibuttonentry_item_bg_selected"; + color: 0 0 0 0; + desc: "Background of a selected multibuttonentry item object"; + } + color_class { name: "multibuttonentry_item_text"; + color: FN_COL_DEFAULT; + desc: "Text of a multibuttonentry item"; + } + color_class { name: "multibuttonentry_item_text_pressed"; + color: FN_COL_HIGHLIGHT; + desc: "Text of a pressed multibuttonentry item"; + } + color_class { name: "multibuttonentry_item_text_disabled"; + color: FN_COL_DISABLE; + desc: "Text of a disabled multibuttonentry item"; + } // modules color_class { name: "module_label"; diff --git a/data/themes/edc/elm/multibuttonentry.edc b/data/themes/edc/elm/multibuttonentry.edc index 35eddcadf..0cca89713 100644 --- a/data/themes/edc/elm/multibuttonentry.edc +++ b/data/themes/edc/elm/multibuttonentry.edc @@ -7,7 +7,7 @@ group { name: "elm/multibuttonentry/base/default"; type: RECT; scale: 1; description { state: "default" 0.0; - color: 0 0 0 0; + color_class: "multibuttonentry_bg"; } } part { name: "box.swallow"; type: SWALLOW; @@ -74,7 +74,20 @@ group { name: "elm/multibuttonentry/btn/default"; tag: "tab" "\t"; } } + + script { + public disabled = 0; + } + parts { + part { name: "bg"; type: RECT; + description { state: "default" 0.0; + color_class: "multibuttonentry_item_bg"; + } + description { state: "pressed" 0.0; + color_class: "multibuttonentry_item_bg_selected"; + } + } part { name: "base"; description { state: "default" 0.0; image.normal: "button_normal.png"; @@ -84,7 +97,7 @@ group { name: "elm/multibuttonentry/btn/default"; rel2.offset: 0 1; fill.smooth: 0; } - description { state: "clicked" 0.0; + description { state: "pressed" 0.0; inherit: "default" 0.0; image.normal: "button_clicked.png"; image.border: 5 5 4 6; @@ -141,12 +154,12 @@ group { name: "elm/multibuttonentry/btn/default"; part { name: "elm.btn.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; description { state: "default" 0.0; - color_class: "multibuttonentry_label"; + color_class: "multibuttonentry_item_text"; text { style: "multibuttonentry_textblock_style"; min: 1 1; ellipsis: -1; - text_class: "multibuttonentry_label"; - } + text_class: "multibuttonentry_item_text"; + } visible: 0; rel1.offset: 5 5; rel1.to: "base"; @@ -159,12 +172,12 @@ group { name: "elm/multibuttonentry/btn/default"; part { name: "text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; description { state: "default" 0.0; - color_class: "multibuttonentry_label"; + color_class: "multibuttonentry_item_text"; text { style: "multibuttonentry_textblock_style"; text_source: "elm.btn.text"; min: 0 1; align: 0.0 0.5; - text_class: "multibuttonentry_label"; + text_class: "multibuttonentry_item_text"; } align: 0.0 0.5; rel1.offset: 5 5; @@ -174,12 +187,30 @@ group { name: "elm/multibuttonentry/btn/default"; rel2.relative: 0.0 1.0; rel2.offset: -3 -7; } + description { state: "pressed" 0.0; + inherit: "default"; + color_class: "multibuttonentry_item_text_pressed"; + text { + text_class: "multibuttonentry_item_text_pressed"; + } + } + description { state: "disabled" 0.0; + inherit: "default"; + color_class: "multibuttonentry_item_text_disabled"; + text { + text_class: "multibuttonentry_item_text_disabled"; + } + } } } programs { program { signal: "mouse,clicked,1"; source: "base"; - action: SIGNAL_EMIT "clicked" "elm"; + script { + if (get_int(disabled) == 0) { + emit("clicked", ""); + } + } } program { signal: "elm,state,default"; source: "elm"; @@ -191,15 +222,44 @@ group { name: "elm/multibuttonentry/btn/default"; action: STATE_SET "focused" 0.0; target: "glow"; } + program { + signal: "elm,state,enabled"; source: "elm"; + script { + set_state(PART:"text", "default", 0.0); + set_int(disabled , 0); + } + } + program { + signal: "elm,state,disabled"; source: "elm"; + script { + new st[31]; + new Float: vl; + get_state(PART:"glow", st, 30, vl); + if (!strcmp(st, "focused")) + set_state(PART:"glow", "default", 0.0); + set_state(PART:"text", "disabled", 0.0); + set_int(disabled , 1); + } + } program { signal: "mouse,down,1"; source: "base"; - action: STATE_SET "clicked" 0.0; - target: "base"; + script { + if (get_int(disabled) == 0) { + set_state(PART:"base", "pressed", 0.0); + set_state(PART:"bg", "pressed", 0.0); + set_state(PART:"text", "pressed", 0.0); + } + } } program { signal: "mouse,up,1"; source: "base"; - action: STATE_SET "default" 0.0; - target: "base"; + script { + if (get_int(disabled) == 0) { + set_state(PART:"base", "default", 0.0); + set_state(PART:"bg", "default", 0.0); + set_state(PART:"text", "default", 0.0); + } + } } program { signal: "mouse,clicked,1"; source: "del"; -- cgit v1.2.1