collapsing frames for default theme
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 4 Jan 2012 01:53:23 +0000 (01:53 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 4 Jan 2012 01:53:23 +0000 (01:53 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66827 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

data/themes/widgets/frame.edc

index 14f8209..704e5c0 100644 (file)
@@ -32,9 +32,15 @@ group { name: "elm/frame/base/default";
             }
             fill.smooth : 0;
          }
+         description { state: "collapsed" 0.0;
+            inherit: "default" 0.0;
+            rel2.to_y: "elm.text";
+            rel2.offset: 9 0;
+         }
       }
       part { name: "elm.text";
          type: TEXT;
+         mouse_events: 0;
          scale: 1;
          description { state: "default" 0.0;
             align: 0.0 0.0;
@@ -57,9 +63,20 @@ group { name: "elm/frame/base/default";
             }
          }
       }
+      part {
+         name: "clip";
+         type: RECT;
+         description {
+            state: "default" 0.0;
+            min: 1 1;
+            rel1.to: "over";
+            rel2.to: "over";
+         }
+      }
       part { name: "over";
          mouse_events:  0;
          description { state:    "default" 0.0;
+            min: 2 2;
             rel1.offset: 4 4;
             rel2.to: "elm.swallow.content";
             rel2.offset: 5 5;
@@ -70,9 +87,15 @@ group { name: "elm/frame/base/default";
             }
             fill.smooth : 0;
          }
+         description { state: "collapsed" 0.0;
+            inherit: "default" 0.0;
+            rel2.to_y: "elm.text";
+            rel2.offset: 5 0;
+         }
       }
       part { name: "elm.swallow.content";
          type: SWALLOW;
+         clip_to: "clip";
          description { state: "default" 0.0;
             align: 0.0 0.0;
             rel1 {
@@ -97,8 +120,34 @@ group { name: "elm/frame/base/default";
    programs {
       program { name: "click";
          signal:  "mouse,up,1";
-         source:  "events";
+         source:  "event";
          action:  SIGNAL_EMIT "elm,action,click" "elm";
+         after: "toggle";
+      }
+      program { name: "toggle";
+         signal:  "elm,action,collapse";
+         source: "elm";
+         script {
+            new st[31];
+            new Float:vl;
+            get_state(PART:"over", st, 30, vl);
+            if (!strcmp(st, "default"))
+              run_program(PROGRAM:"collapse");
+            else
+              run_program(PROGRAM:"expand");
+         }
+      }
+      program { name: "collapse";
+         action:  STATE_SET "collapsed" 0.0;
+         target: "over";
+         target: "base";
+         transition: LINEAR 0.1;
+      }
+      program { name: "expand";
+         action:  STATE_SET "default" 0.0;
+         target: "over";
+         target: "base";
+         transition: LINEAR 0.1;
       }
    }
 }