1 group { name: "e/widgets/button"; 2 images.image: "button_normal.png" COMP; 3 images.image: "button_clicked.png" COMP; 4 images.image: "win_glow.png" COMP; 5 parts { 6 part { name: "base"; 7 description { state: "default" 0.0; 8 image.normal: "button_normal.png"; 9 image.border: 4 4 3 5; 10 image.middle: SOLID; 11 rel1.offset: -1 0; 12 rel2.offset: 0 1; 13 fill.smooth: 0; 14 } 15 description { state: "clicked" 0.0; 16 inherit: "default" 0.0; 17 image.normal: "button_clicked.png"; 18 image.border: 5 5 4 6; 19 } 20 } 21 part { name: "icon_clip"; type: RECT; 22 description { state: "default" 0.0; 23 } 24 description { state: "disabled" 0.0; 25 inherit: "default" 0.0; 26 color: 255 255 255 64; 27 } 28 } 29 part { name: "e.swallow.icon"; type: SWALLOW; mouse_events: 0; 30 clip_to: "icon_clip"; 31 description { state: "default" 0.0; 32 align: 0.0 0.5; 33 rel1.offset: 6 5; 34 rel1.to: "base"; 35 rel2.relative: 0.0 1.0; 36 rel2.offset: 6 -8; 37 rel2.to: "base"; 38 } 39 description { state: "combo" 0.0; 40 inherit: "default" 0.0; 41 aspect: 1.0 1.0; aspect_preference: VERTICAL; 42 } 43 description { state: "icon" 0.0; 44 inherit: "default" 0.0; 45 min: 17 17; 46 aspect: 1.0 1.0; aspect_preference: BOTH; 47 align: 0.5 0.5; 48 rel2.relative: 1.0 1.0; 49 rel2.offset: -7 -8; 50 } 51 } 52 part { name: "label_clip"; type: RECT; 53 description { state: "default" 0.0; 54 } 55 description { state: "disabled" 0.0; 56 inherit: "default" 0.0; 57 visible: 0; 58 } 59 } 60 part { name: "e.text.label"; type: TEXT; mouse_events: 0; 61 effect: SHADOW BOTTOM; 62 scale: 1; 63 clip_to: "label_clip"; 64 description { state: "default" 0.0; 65 rel1.offset: 6 5; 66 rel1.to_x: "base"; 67 rel1.to_y: "base"; 68 rel2.offset: -7 -7; 69 rel2.to: "base"; 70 color_class: "button_text"; 71 color3: 255 255 255 255; 72 text { font: FN; size: 10; 73 min: 1 1; 74 ellipsis: -1; 75 align: 0.5 0.5; 76 text_class: "button"; 77 } 78 } 79 description { state: "disabled" 0.0; 80 inherit: "default" 0.0; 81 color_class: "button_text_disabled"; 82 color3: 255 255 255 255; 83 } 84 description { state: "combo" 0.0; 85 inherit: "default" 0.0; 86 rel1.relative: 1.0 0.0; 87 rel1.offset: 2 5; 88 rel1.to_x: "e.swallow.icon"; 89 } 90 description { state: "icon" 0.0; 91 inherit: "default" 0.0; 92 visible: 0; 93 } 94 } 95 part { name: "label2"; type: TEXT; mouse_events: 0; 96 effect: SHADOW BOTTOM; 97 scale: 1; 98 description { state: "default" 0.0; 99 rel1.to: "e.text.label"; 100 rel2.to: "e.text.label"; 101 color_class: "button_text_disabled"; 102 color3: 255 255 255 255; 103 text { font: FN; size: 10; 104 text_source: "e.text.label"; 105 align: 0.5 0.5; 106 text_class: "button"; 107 } 108 visible: 0; 109 } 110 description { state: "disabled" 0.0; 111 inherit: "default" 0.0; 112 visible: 1; 113 } 114 } 115 part { name: "base2"; type: SPACER; 116 description { state: "default" 0.0; 117 rel1.to: "base"; 118 rel2.to: "base"; 119 } 120 description { state: "clicked" 0.0; 121 inherit: "default" 0.0; 122 rel1.offset: 1 1; 123 rel2.offset: -2 -2; 124 } 125 } 126 part { name: "glow"; mouse_events: 0; 127 description { state: "default" 0.0; 128 image.normal: "win_glow.png"; 129 image.border: 9 9 9 9; 130 image.middle: 0; 131 rel1.to: "base2"; 132 rel1.offset: -2 -3; 133 rel2.to: "base2"; 134 rel2.offset: 1 0; 135 fill.smooth: 0; 136 color: 255 255 255 0; 137 visible: 0; 138 } 139 description { state: "focused" 0.0; 140 inherit: "default" 0.0; 141 color: 255 255 255 150; 142 visible: 1; 143 } 144 } 145 part { name: "event"; type: RECT; 146 ignore_flags: ON_HOLD; 147 description { state: "default" 0.0; 148 color: 0 0 0 0; 149 } 150 description { state: "disabled" 0.0; 151 inherit: "default" 0.0; 152 visible: 0; 153 } 154 } 155 } 156 programs { 157 program { 158 signal: "mouse,down,1"; source: "event"; 159 action: STATE_SET "clicked" 0.0; 160 target: "base"; 161 target: "base2"; 162 } 163 program { 164 signal: "mouse,up,1"; source: "event"; 165 action: STATE_SET "default" 0.0; 166 target: "base"; 167 target: "base2"; 168 } 169 program { 170 signal: "mouse,clicked,1*"; source: "event"; 171 action: SIGNAL_EMIT "e,action,click" ""; 172 } 173 program { 174 signal: "e,state,text"; source: "e"; 175 action: STATE_SET "default" 0.0; 176 target: "e.swallow.icon"; 177 target: "e.text.label"; 178 } 179 program { 180 signal: "e,state,icon"; source: "e"; 181 action: STATE_SET "icon" 0.0; 182 target: "e.swallow.icon"; 183 target: "e.text.label"; 184 } 185 program { 186 signal: "e,state,combo"; source: "e"; 187 action: STATE_SET "combo" 0.0; 188 target: "e.swallow.icon"; 189 target: "e.text.label"; 190 } 191 program { 192 signal: "e,state,disabled"; source: "e"; 193 action: STATE_SET "disabled" 0.0; 194 target: "event"; 195 target: "icon_clip"; 196 target: "label_clip"; 197 target: "label2"; 198 } 199 program { 200 signal: "e,state,enabled"; source: "e"; 201 action: STATE_SET "default" 0.0; 202 target: "event"; 203 target: "icon_clip"; 204 target: "label_clip"; 205 target: "label2"; 206 } 207 program { signal: "e,state,focused"; source: "e"; 208 action: STATE_SET "focused" 0.0; 209 target: "glow"; 210 } 211 program { signal: "e,state,unfocused"; source: "e"; 212 action: STATE_SET "default" 0.0; 213 target: "glow"; 214 } 215 } 216} 217