2011/5/6 Daniel Juyung Seo <seojuyu...@gmail.com>
> Hello,
> 2 comments.
>
> 1. Mine doesn't work :(
> It just looks like a normal toggle widget. Even I applied your patch :(
>
>
haha I am sooooo stupid. The nem toggle theme is in my own theme and not in
the elm theme. :p
Apply toggle_clicks.txt in trunk/enki/data/theme/default_elementary
then make && make install
2. Use elm_object_style_set() API.
> elm_widget_xxx() APIs are for elm internal use only.
> Use elm_object_xxx() APIs from application side.
>
>
oki
> Thanks.
> Daniel Juyung Seo (SeoZ)
>
> On Fri, May 6, 2011 at 3:26 AM, Atton Jonathan <jonathan.at...@gmail.com>
> wrote:
> > hello,
> >
> > See a patch which add a new style called "demo" for the toggle widget. In
> > this style instead of using a slide we use a click. This is a demo I have
> > made for a presentation.
> >
> > I am not planning to commit it.
> >
> > --
> > Regards.
> >
> >
> ------------------------------------------------------------------------------
> > WhatsUp Gold - Download Free Network Management Software
> > The most intuitive, comprehensive, and cost-effective network
> > management toolset available today. Delivers lowest initial
> > acquisition cost and overall TCO of any competing solution.
> > http://p.sf.net/sfu/whatsupgold-sd
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
> >
>
--
Regards.
Index: detour-elm.edj
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: main.edc
===================================================================
--- main.edc (revision 59222)
+++ main.edc (working copy)
@@ -7499,5 +7499,461 @@
}
}
}
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+ group {
+ name: "elm/toggle/base/demo";
+ script {
+ public bt_txt_visible;
+ public bt_icon_visible;
+ public bt_pressed;
+ }
+ parts {
+ part {
+ name: "base";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 32 32;
+ rel1 {
+ offset: 3 4;
+ }
+ rel2 {
+ offset: -4 -5;
+ }
+ fill {
+ smooth: 1;
+ }
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "button_clip";
+ type: RECT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ rel1 {
+ to: "base";
+ relative: 0.0 0.0;
+ offset: 3 1;
+ }
+ rel2 {
+ to: "base";
+ relative: 1.0 1.0;
+ offset: -4 -2;
+ }
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "focus";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ image.normal: "images/button_im3.png";
+ image.border: 7 7 7 7;
+ color: 255 255 255 0;
+ rel1.offset: 5 4;
+ rel2.offset: -6 -5;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "mouse_hover";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ image.normal: "images/button_im3.png";
+ image.border: 7 7 7 7;
+ color: 255 255 255 0;
+ rel1.offset: 5 4;
+ rel2.offset: -6 -5;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 200;
+ }
+ }
+ part {
+ name: "enabled_button";
+ type: IMAGE;
+ mouse_events: 1;
+ clip_to: "button_clip";
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ image.normal: "images/button_im1.png";
+ image.border: 7 7 7 7;
+ rel1 {
+ to: "button_clip";
+ }
+ rel2 {
+ to: "button_clip";
+ }
+ fill {
+ smooth: 1;
+ }
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "shadow";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "button_clip";
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ color: 255 255 255 0;
+ image.normal: "images/button_im4.png";
+ image.border: 6 6 13 0;
+ rel1 {
+ to: "button_clip";
+ }
+ rel2 {
+ to: "button_clip";
+ }
+ fill {
+ smooth: 1;
+ }
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "disabled_button";
+ type: IMAGE;
+ mouse_events: 1;
+ clip_to: "button_clip";
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ color: 255 255 255 0;
+ image.normal: "images/button_im2.png";
+ image.border: 11 11 10 10;
+ visible: 0;
+ rel1 {
+ to: "button_clip";
+ }
+ rel2 {
+ to: "button_clip";
+ }
+ fill {
+ smooth: 1;
+ }
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 224;
+ visible: 1;
+ }
+ }
+ part {
+ name: "elm.swallow.content";
+ mouse_events: 0;
+ type: SWALLOW;
+ description { /* whether or not there is an icon?? */
+ state: "default" 0.0;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ visible: 0;
+ rel1 {
+ to: "base";
+ relative: 0.0 0.0;
+ offset: 9 6;
+ }
+ rel2 {
+ to: "base";
+ relative: 0.0 1.0;
+ offset: 3 -7;
+ }
+ }
+ description { /* icon only */
+ state: "icononly" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ fixed: 0 0;
+ aspect_preference: VERTICAL;
+ align: 0.5 0.5;
+ rel1 {
+ offset: 0 6;
+ }
+ rel2 {
+ to: "base";
+ relative: 1.0 1.0;
+ offset: 0 -7;
+ }
+ }
+ description { /* text + icon */
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ rel2 {
+ to: "base";
+ relative: 0.0 1.0;
+ offset: 4 -7;
+ }
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ effect: SHADOW;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ color: 60 60 60 255;
+ color3: 255 255 255 128;
+ rel1 {
+ to_x: "elm.swallow.content";
+ to_y: "base";
+ relative: 1.0 0.0;
+ offset: 0 6;
+ }
+ rel2 {
+ to: "base";
+ relative: 1.0 1.0;
+ offset: -8 -4;
+ }
+ text {
+ text: "";
+ font: "DejaVuSans-Bold";
+ size: 11;
+ min: 0 0;
+ align: 0.5 0.5;
+ }
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ text.min: 1 1;
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ inherit: "visible" 0.0;
+ color: 60 60 60 229;
+ color3: 170 168 169 64;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ inherit: "visible" 0.0;
+ color: 96 96 96 255;
+ color3: 170 168 169 128;
+ }
+ }
+ part {
+ name: "shadow_overlay";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "button_clip";
+ description {
+ state: "default" 0.0;
+ min: 24 24;
+ color: 255 255 255 0;
+ image.normal: "images/button_im5.png";
+ image.border: 6 6 6 13;
+ rel1 {
+ to: "button_clip";
+ }
+ rel2 {
+ to: "button_clip";
+ }
+ fill {
+ smooth: 1;
+ }
+ }
+ description {
+ state: "clicked" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+
+ program {
+ name: "focused";
+ signal: "elm,action,focus";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ transition: DECELERATE 0.5;
+ target: "focus";
+ }
+ program {
+ name: "unfocused";
+ signal: "elm,action,unfocus";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.5;
+ target: "focus";
+ }
+ program {
+ name: "mouse_in";
+ signal: "mouse,in";
+ source: "enabled_button";
+ action: STATE_SET "visible" 0.0;
+ transition: SINUSOIDAL 0.2;
+ target: "mouse_hover";
+ }
+ program {
+ name: "mouse_out";
+ signal: "mouse,out";
+ source: "enabled_button";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 0.2;
+ target: "mouse_hover";
+ }
+ program {
+ name: "button_clicked";
+ signal: "mouse,down,1";
+ source: "enabled_button";
+ script {
+ if (get_int(bt_pressed) == 0)
+ {
+ set_state(PART:"enabled_button", "clicked", 0.0);
+ set_state(PART:"shadow", "clicked", 0.0);
+ set_state(PART:"shadow_overlay", "clicked", 0.0);
+ set_state(PART:"elm.text", "clicked", 0.0);
+ set_int(bt_pressed, 1);
+ emit("elm,action,toggle,on", "");
+ }
+ else
+ {
+ set_state(PART:"enabled_button", "default", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"shadow_overlay", "default", 0.0);
+
+ if (get_int(bt_txt_visible) == 1)
+ set_state(PART:"elm.text", "visible", 0.0);
+ else
+ set_state(PART:"elm.text", "default", 0.0);
+
+ set_int(bt_pressed, 0);
+ emit("elm,action,toggle,off", "");
+ }
+ }
+ }
+ program {
+ name: "button_action";
+ signal: "mouse,clicked,1";
+ source: "enabled_button";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program { name: "text_show";
+ signal: "elm,state,text,visible";
+ source: "elm";
+ script {
+ set_int(bt_txt_visible, 1);
+ if (get_int(bt_icon_visible) == 1)
+ set_state(PART:"elm.swallow.content", "visible", 0.0);
+ set_state(PART:"elm.text", "visible", 0.0);
+ }
+ }
+ program { name: "text_hide";
+ signal: "elm,state,text,hidden";
+ source: "elm";
+ script {
+ set_int(bt_txt_visible, 0);
+ if (get_int(bt_icon_visible) == 1)
+ set_state(PART:"elm.swallow.content", "icononly", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ }
+ }
+ program { name: "icon_show";
+ signal: "elm,state,icon,visible";
+ source: "elm";
+ script {
+ set_int(bt_icon_visible, 1);
+ if(get_int(bt_txt_visible) == 1)
+ set_state(PART:"elm.swallow.content", "visible", 0.0);
+ else
+ set_state(PART:"elm.swallow.content", "icononly", 0.0);
+ }
+ }
+ program { name: "icon_hide";
+ signal: "elm,state,icon,hidden";
+ source: "elm";
+ script {
+ set_int(bt_icon_visible, 0);
+ set_state(PART:"elm.swallow.content", "default", 0.0);
+ }
+ }
+ program {
+ name: "enabled_button";
+ signal: "elm,state,enabled";
+ source: "elm";
+ script {
+ if(get_int(bt_txt_visible) == 1)
+ set_state(PART:"elm.text", "visible", 0.0);
+ else
+ set_state(PART:"elm.text", "default", 0.0);
+
+ set_state(PART:"base", "default", 0.0);
+ set_state(PART:"enabled_button", "default", 0.0);
+ set_state(PART:"disabled_button", "default", 0.0);
+ set_state(PART:"shadow", "default", 0.0);
+ set_state(PART:"shadow_overlay", "default", 0.0);
+ }
+ }
+ program {
+ name: "disabled_button";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "base";
+ target: "enabled_button";
+ target: "disabled_button";
+ target: "shadow";
+ target: "shadow_overlay";
+ target: "elm.text";
+ }
+ }
+ }
+
}
-
Index: src/lib/Elementary.h.in
===================================================================
--- src/lib/Elementary.h.in (revision 59220)
+++ src/lib/Elementary.h.in (working copy)
@@ -2327,6 +2327,7 @@
EAPI void elm_map_user_agent_set(Evas_Object *obj, const
char *user_agent) EINA_ARG_NONNULL(1, 2);
EAPI const char *elm_map_user_agent_get(const Evas_Object *obj)
EINA_ARG_NONNULL(1);
EAPI Elm_Map_Route *elm_map_route_add(Evas_Object *obj,
Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat,
double tlon, double tlat) EINA_ARG_NONNULL(1);
+ EAPI Elm_Map_Route *elm_map_route_from_gpx_file_add(Evas_Object
*obj, const char *file) EINA_ARG_NONNULL(1);
EAPI void elm_map_route_remove(Elm_Map_Route *route)
EINA_ARG_NONNULL(1);
EAPI void elm_map_route_color_set(Elm_Map_Route *route,
int r, int g , int b, int a) EINA_ARG_NONNULL(1);
EAPI void elm_map_route_color_get(const Elm_Map_Route
*route, int *r, int *g , int *b, int *a) EINA_ARG_NONNULL(1);
Index: src/bin/test_toggle.c
===================================================================
--- src/bin/test_toggle.c (revision 59220)
+++ src/bin/test_toggle.c (working copy)
@@ -81,7 +81,33 @@
elm_box_pack_end(bx, tg);
evas_object_show(tg);
evas_object_show(ic);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+
+ tg = elm_toggle_add(win);
+ elm_toggle_label_set(tg, "Slide");
+ elm_toggle_icon_set(tg, ic);
+ elm_box_pack_end(bx, tg);
+ evas_object_show(tg);
+ evas_object_show(ic);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+
+ tg = elm_toggle_add(win);
+ elm_toggle_label_set(tg, "Click");
+ elm_object_style_set(tg, "demo");
+ elm_toggle_icon_set(tg, ic);
+ elm_box_pack_end(bx, tg);
+ evas_object_show(tg);
+ evas_object_show(ic);
+
evas_object_show(win);
}
#endif
Index: data/themes/default.edc
===================================================================
--- data/themes/default.edc (revision 59220)
+++ data/themes/default.edc (working copy)
@@ -3053,7 +3053,453 @@
}
}
+
///////////////////////////////////////////////////////////////////////////////
+ group { name: "elm/toggle/base/demo";
+ images {
+ image: "shelf_inset.png" COMP;
+ image: "bt_basew.png" COMP;
+ image: "bt_bases.png" COMP;
+ image: "bt_hilightw.png" COMP;
+ image: "tog_base_on.png" COMP;
+ image: "tog_base_off.png" COMP;
+ image: "tog_dis_base_on.png" COMP;
+ image: "tog_dis_base_off.png" COMP;
+ }
+ script {
+ public is_rtl;
+ }
+ parts {
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.relative: 1.0 0.0;
+ rel1.offset: -4 3;
+ rel2.offset: -4 -4;
+ align: 1.0 0.5;
+ min: 96 16;
+ max: 96 16;
+ aspect: 4.0 4.0;
+ aspect_preference: VERTICAL;
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "clipper";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ color: 255 255 255 255;
+ }
+ }
+ part { name: "button";
+ type: RECT;
+ scale: 1;
+ clip_to: "clipper";
+ mouse_events: 1;
+ dragable {
+ x: 1 1 0;
+ y: 0 0 0;
+ confine: "bg";
+ }
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ min: 16 16;
+ max: 16 16;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "button_events";
+ type: RECT;
+ dragable {
+ events: "button";
+ }
+ description { state: "default" 0.0;
+ rel1.to_x: "bg";
+ rel1.offset: 0 0;
+ rel1.relative: 0.0 0.0;
+ rel2.to_x: "bg";
+ rel2.offset: -1 -1;
+ rel2.relative: 1.0 1.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "onrect";
+ type: IMAGE;
+ scale: 1;
+ clip_to: "clipper";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "button";
+ rel1.relative: -5.0 0.0;
+ rel2.to: "button";
+ rel2.relative: 0.5 1.0;
+ image.normal: "tog_base_on.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "tog_dis_base_on.png";
+ }
+ }
+ part { name: "offrect";
+ type: IMAGE;
+ scale: 1;
+ clip_to: "clipper";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to: "button";
+ rel1.relative: 0.5 0.0;
+ rel2.to: "button";
+ rel2.relative: 6.0 1.0;
+ image.normal: "tog_base_off.png";
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "tog_dis_base_off.png";
+ }
+ }
+ part { name: "elm.offtext";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to_x: "button";
+ rel1.relative: 1.0 0.0;
+ rel2.to_x: "offrect";
+ color: 0 0 0 255;
+ text {
+ font: "Sans,Edje-Vera";
+ size: 10;
+ min: 0 1;
+ align: 0.5 0.5;
+ text: "OFF";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 128 128 128 128;
+ }
+ }
+ part { name: "elm.ontext";
+ type: TEXT;
+ effect: SOFT_SHADOW;
+ mouse_events: 0;
+ scale: 1;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to_x: "onrect";
+ rel1.offset: 1 1;
+ rel2.to_x: "button";
+ rel2.offset: 0 0;
+ rel2.relative: 0.0 1.0;
+ color: 224 224 224 255;
+ color3: 0 0 0 64;
+ text {
+ font: "Sans,Edje-Vera";
+ size: 10;
+ min: 0 1;
+ align: 0.5 0.5;
+ text: "ON";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 128 128 128 128;
+ color3: 0 0 0 24;
+ }
+ }
+ part { name: "conf_over";
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.offset: -1 -1;
+ rel1.to: "bg";
+ rel2.offset: 0 0;
+ rel2.to: "bg";
+ image {
+ normal: "shelf_inset.png";
+ border: 7 7 7 7;
+ middle: 0;
+ }
+ fill.smooth : 0;
+ }
+ }
+ part { name: "button0";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.to: "button2";
+ rel1.offset: -4 -4;
+ rel2.to: "button2";
+ rel2.offset: 3 3;
+ image {
+ normal: "bt_bases.png";
+ border: 11 11 11 11;
+ }
+ image.middle: SOLID;
+ color: 255 255 255 128;
+ }
+ }
+ part { name: "button2";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.to: "button";
+ rel1.offset: -2 -2;
+ rel2.to: "button";
+ rel2.offset: 1 1;
+ image {
+ normal: "bt_basew.png";
+ border: 7 7 7 7;
+ }
+ image.middle: SOLID;
+ }
+ }
+ part { name: "button3";
+ mouse_events: 0;
+ clip_to: "clipper";
+ description { state: "default" 0.0;
+ rel1.to: "button2";
+ rel2.to: "button2";
+ rel2.relative: 1.0 0.5;
+ image {
+ normal: "bt_hilightw.png";
+ border: 4 4 4 0;
+ }
+ }
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ visible: 0;
+ align: 0.0 0.5;
+ rel1.offset: 4 4;
+ rel2.relative: 0.0 1.0;
+ rel2.offset: 3 -5;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ aspect: 1.0 1.0;
+ rel2.offset: 4 -5;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 128 128 128 128;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "default" 0.0;
+ color: 128 128 128 128;
+ visible: 1;
+ aspect: 1.0 1.0;
+ }
+ }
+ part { name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ rel1.to_x: "elm.swallow.content";
+ rel1.relative: 1.0 0.0;
+ rel1.offset: 0 4;
+ rel2.to_x: "bg";
+ rel2.relative: 0.0 1.0;
+ rel2.offset: -5 -5;
+ color: 0 0 0 255;
+ text {
+ font: "Sans,Edje-Vera";
+ size: 10;
+ min: 0 0;
+ align: 0.0 0.5;
+ }
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ text.min: 1 1;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 128 128 128 128;
+ }
+ description { state: "disabled_visible" 0.0;
+ inherit: "default" 0.0;
+ color: 128 128 128 128;
+ visible: 1;
+ text.min: 1 1;
+ }
+ }
+ 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: "drag_end";
+ signal: "mouse,up,1";
+ source: "button";
+ script {
+ new Float:dx, Float:dy;
+ get_drag(PART:"button", dx, dy);
+ if (dx > 0.5)
+ {
+ set_drag(PART:"button", 1.0, 0.0);
+ }
+ else
+ {
+ set_drag(PART:"button", 0.0, 0.0);
+ }
+ if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
+ (get_int(is_rtl) == 0) && (dx > 0.5)) {
+ emit("elm,action,toggle,on", "");
+ }
+ else {
+ emit("elm,action,toggle,off", "");
+ }
+
+ }
+ }
+ program { name: "toggle_on";
+ signal: "elm,state,toggle,on";
+ source: "elm";
+ script {
+ new Float:drag;
+ if (get_int(is_rtl) == 0) {
+ drag = 100.0;
+ }
+ else {
+ drag = 0.0;
+ }
+ set_drag(PART:"button", drag, 0.0);
+ }
+ }
+ program { name: "toggle_off";
+ signal: "elm,state,toggle,off";
+ source: "elm";
+ script {
+ new Float:drag;
+ if (get_int(is_rtl) == 0) {
+ drag = 0.0;
+ }
+ else {
+ drag = 100.0;
+ }
+ set_drag(PART:"button", drag, 0.0);
+ }
+ }
+ program { name: "text_show";
+ signal: "elm,state,text,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.text";
+ }
+ program { name: "text_hide";
+ signal: "elm,state,text,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text";
+ }
+ program { name: "icon_show";
+ signal: "elm,state,icon,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.content";
+ }
+ 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: "elm.offtext";
+ target: "elm.ontext";
+ target: "onrect";
+ target: "offrect";
+ target: "disabler";
+ after: "disable_text";
+ }
+ program { name: "disable_text";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"elm.text", st, 30, vl);
+ if (!strcmp(st, "visible"))
+ set_state(PART:"elm.text", "disabled_visible", 0.0);
+ else
+ set_state(PART:"elm.text", "disabled", 0.0);
+
+ get_state(PART:"elm.swallow.content", st, 30, vl);
+ if (!strcmp(st, "visible"))
+ set_state(PART:"elm.swallow.content", "disabled_visible",
0.0);
+ else
+ set_state(PART:"elm.swallow.content", "disabled", 0.0);
+ }
+ }
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "disabler";
+ target: "onrect";
+ target: "offrect";
+ after: "enable_text";
+ }
+ program { name: "enable_text";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"elm.text", st, 30, vl);
+ if (!strcmp(st, "disabled_visible"))
+ set_state(PART:"elm.text", "visible", 0.0);
+ else
+ set_state(PART:"elm.text", "default", 0.0);
+
+ get_state(PART:"elm.swallow.content", st, 30, vl);
+ if (!strcmp(st, "visible"))
+ set_state(PART:"elm.swallow.content", "visible", 0.0);
+ else
+ set_state(PART:"elm.swallow.content", "default", 0.0);
+ }
+ }
+ program { name: "to_rtl";
+ signal: "edje,state,rtl";
+ source: "edje";
+ script {
+ set_int(is_rtl, 1);
+ }
+ }
+ program { name: "to_ltr";
+ signal: "edje,state,ltr";
+ source: "edje";
+ script {
+ set_int(is_rtl, 0);
+ }
+ }
+ }
+ }
+///////////////////////////////////////////////////////////////////////////////
group { name: "elm/toggle/base/default";
images {
image: "shelf_inset.png" COMP;
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel