From 06a5d4719bd0daa8e5ecc912741ba30d91e8939c Mon Sep 17 00:00:00 2001 From: Sungtaek Hong Date: Tue, 10 Jan 2017 17:19:58 +0900 Subject: [PATCH] theme: add touch sound in genlist full style Change-Id: I764f6686df29739df9694fe56795a1198e9356bf Signed-off-by: Sungtaek Hong --- ElmSharp/theme/mobile/HD-inc.edc | 4 + ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc | 1 + ElmSharp/theme/mobile/widgets/genlist.edc | 208 +++++++++++++++++++++++ 3 files changed, 213 insertions(+) create mode 100644 ElmSharp/theme/mobile/widgets/genlist.edc diff --git a/ElmSharp/theme/mobile/HD-inc.edc b/ElmSharp/theme/mobile/HD-inc.edc index c3266bd..4af4422 100644 --- a/ElmSharp/theme/mobile/HD-inc.edc +++ b/ElmSharp/theme/mobile/HD-inc.edc @@ -75,3 +75,7 @@ #define RADIO_DEFAULT_SIZE_INC 50 50 #define RADIO_PAD_BEFORE_TEXT_INC 32 0 +//****************************************************************************// +// GENLIST +//****************************************************************************// +#define LIST_BOTTOMLINE_HEIGHT 2 diff --git a/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc b/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc index d9baad4..b4f11b9 100644 --- a/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc +++ b/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc @@ -85,6 +85,7 @@ collections { #include "widgets/colorselector.edc" #include "widgets/entry.edc" +#include "widgets/genlist.edc" #include "widgets/label.edc" #include "widgets/radio.edc" #include "widgets/layout.edc" diff --git a/ElmSharp/theme/mobile/widgets/genlist.edc b/ElmSharp/theme/mobile/widgets/genlist.edc new file mode 100644 index 0000000..64399f6 --- /dev/null +++ b/ElmSharp/theme/mobile/widgets/genlist.edc @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved + * + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define LIST_PROGRAM_SOUND \ + program { name: "play_sound"; \ + signal: "elm,state,clicked"; \ + source: "elm"; \ + script { \ + run_program(PROGRAM:"touch_sound"); \ + } \ + } \ + program { name: "touch_sound"; \ + action: RUN_PLUGIN "touch_sound"; \ + } + +group { "elm/genlist/item/event/default" + inherit_only: 1; + parts { + rect { "event"; nomouse; repeat; scale; + desc { "default"; + color: 0 0 0 0; + rel.to: "base"; + } + desc { "disabled"; + inherit: "default"; + hid; + } + } + } + programs { + /* Program for enabled event */ + program { "enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default"; + target: "event"; + after: "on_enabled"; + } + /* Program for disabled event */ + program { "disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled"; + target: "event"; + after: "on_disabled"; + } + program { "enable_event_pass"; + signal: "elm,event,pass,enabled"; + source: "elm"; + script { + set_mouse_events(PART:"event", 0); + } + } + program { "disable_event_pass"; + signal: "elm,event,pass,disabled"; + source:"elm"; + script { + set_mouse_events(PART:"event", 1); + } + } + program { "enable_event_repeat"; + signal: "elm,event,repeat,enabled"; + source: "elm"; + script { + set_repeat_events(PART:"event", 1); + } + } + program { "disable_event_repeat"; + signal: "elm,event,repeat,disabled"; + source:"elm"; + script { + set_repeat_events(PART:"event", 0); + } + } + } +} + +group { "elm/genlist/item/full/default"; + alias: "elm/genlist/item_compress/full/default"; + alias: "elm/genlist/tree/full/default"; + alias: "elm/genlist/tree_compress/full/default"; + inherit: "elm/genlist/item/event/default"; + + data.item: "banded_bg_area" "elm.swallow.bg"; + data.item: "contents" "elm.swallow.content"; + + parts { + spacer { "base"; scale; + desc { "default"; + } + } + + swallow { "elm.swallow.bg"; scale; + desc { "default"; + rel.to: "base"; + } + } + rect { "bg"; scale; + desc { "default"; + rel.to: "elm.swallow.bg"; + color_class: "genlist_item/full/bg"; + } + desc { "pressed"; inherit: "default"; + color_class: "genlist_item/full/bg"; + } + desc { "disabled"; inherit: "default"; + color_class: "genlist_item/full/bg"; + } + } + swallow { "elm.swallow.content"; scale; + desc { "default"; + rel1 { to: "bg"; relative: 0.0 0.0; } + rel2 { to: "bg"; relative: 1.0 1.0; } + } + } + rect { "elm.bottomline"; scale; + desc { "default"; + vis; + min: 0 LIST_BOTTOMLINE_HEIGHT; + max: -1 LIST_BOTTOMLINE_HEIGHT; + align: 0.5 0.0; + fixed: 0 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + color_class: "genlist_item/full/bottomline"; + } + desc { "hidden"; inherit: "default"; + hid; + } + } + rect { "event"; + after: "elm.bottomline"; + desc { "default"; + rel.to: "base"; + } + desc { "disabled"; + inherit: "default"; + hid; + } + } + } + programs { + LIST_PROGRAM_SOUND + program { + signal: "elm,state,elm.swallow.bg,visible"; + source: "elm"; + action: STATE_SET "hidden"; + target: "elm.bottomline"; + } + program { + signal: "elm,state,elm.swallow.bg,hidden"; + source: "elm"; + action: STATE_SET "default"; + target: "elm.bottomline"; + } + program { "default"; + signal: "elm,state,default"; + source: "elm"; + action: STATE_SET "default"; + target: "bg"; + target: "elm.bottomline"; + target: "event"; + } + program { "pressed"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "pressed"; + target: "bg"; + } + program { "unpressed"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default"; + target: "bg"; + } + program { "on_enabled"; + action: STATE_SET "default"; + target: "bg"; + } + program { "on_disabled"; + action: STATE_SET "disabled"; + target: "bg"; + } + } +} -- 2.7.4