diff options
author | Youngbok Shin <youngb.shin@samsung.com> | 2016-01-04 09:31:29 +0900 |
---|---|---|
committer | Jaehwan Kim <jae.hwan.kim@samsung.com> | 2016-01-04 10:43:35 +0900 |
commit | d1867909117123f74ac6a3561296a7bd57e5c22f (patch) | |
tree | c0ccb31cb886460275ffe0c3533dc385c6d24e99 /data | |
parent | 4f0723d91eb2fffed4412965a531c070f3a07d64 (diff) | |
download | elementary-d1867909117123f74ac6a3561296a7bd57e5c22f.tar.gz |
toolbar: Send a signal when shrink mode is changed.
Summary:
It is useful for changing item's state according to shrink mode.
@feature
Test Plan:
It includes a use case for the patch in toolbar default theme.
Run "elementary_test -to toolbar2".
Reviewers: jaehwan, woohyun, cedric, raster
Subscribers: eagleeye
Differential Revision: https://phab.enlightenment.org/D3481
Diffstat (limited to 'data')
-rw-r--r-- | data/themes/edc/elm/toolbar.edc | 90 |
1 files changed, 84 insertions, 6 deletions
diff --git a/data/themes/edc/elm/toolbar.edc b/data/themes/edc/elm/toolbar.edc index d932ff24b..f6cb53364 100644 --- a/data/themes/edc/elm/toolbar.edc +++ b/data/themes/edc/elm/toolbar.edc @@ -379,6 +379,8 @@ group { name: "elm/toolbar/item/default"; #define DISABLE 4 script { public btmode; + public vertical = 0; + public scroll = 0; public eval_mode(m) { new m1 = m & MASK; new d = m & DISABLE; @@ -432,6 +434,44 @@ group { name: "elm/toolbar/item/default"; } } } + + public enable_scroll() { + set_int(scroll, 1); + + if (get_int(vertical)) + set_state(PART:"base", "vert_scroll", 0.0); + else + set_state(PART:"base", "scroll", 0.0); + } + + public disable_scroll() { + set_int(scroll, 0); + + if (get_int(vertical)) + set_state(PART:"base", "vert", 0.0); + else + set_state(PART:"base", "default", 0.0); + } + + public enable_vertical() { + set_int(vertical, 1); + + if (get_int(scroll)) + set_state(PART:"base", "vert_scroll", 0.0); + else + set_state(PART:"base", "vert", 0.0); + set_state(PART:"bend_clip", "vert", 0.0); + } + + public disable_vertical() { + set_int(vertical, 0); + + if (get_int(scroll)) + set_state(PART:"base", "scroll", 0.0); + else + set_state(PART:"base", "default", 0.0); + set_state(PART:"bend_clip", "default", 0.0); + } } parts { part { name: "base"; type: SPACER; @@ -441,6 +481,14 @@ group { name: "elm/toolbar/item/default"; rel1.offset: -1 0; rel2.offset: 0 -1; } + description { state: "scroll" 0.0; + inherit: "default" 0.0; + min: 80 0; + } + description { state: "vert_scroll" 0.0; + inherit: "vert" 0.0; + min: 0 80; + } } part { name: "shadow1"; mouse_events: 0; description { state: "default" 0.0; @@ -810,15 +858,45 @@ group { name: "elm/toolbar/item/default"; programs { program { signal: "elm,orient,horizontal"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - target: "bend_clip"; + script { + disable_vertical(); + } } program { signal: "elm,orient,vertical"; source: "elm"; - action: STATE_SET "vert" 0.0; - target: "base"; - target: "bend_clip"; + script { + enable_vertical(); + } + } + program { + signal: "elm,state,shrink,scroll"; source: "elm"; + script { + enable_scroll(); + } + } + program { + signal: "elm,state,shrink,none"; source: "elm"; + script { + disable_scroll() + } + } + program { + signal: "elm,state,shrink,hide"; source: "elm"; + script { + disable_scroll() + } + } + program { + signal: "elm,state,shrink,menu"; source: "elm"; + script { + disable_scroll() + } + } + program { + signal: "elm,state,shrink,expand"; source: "elm"; + script { + disable_scroll() + } } program { name: "st0"; |