Skip to content

Commit

Permalink
Entry gadget fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thewaiter committed Sep 21, 2017
1 parent b2bbcdc commit 2cc7060
Showing 1 changed file with 142 additions and 96 deletions.
238 changes: 142 additions & 96 deletions default_entry.edc
Original file line number Diff line number Diff line change
Expand Up @@ -3,150 +3,185 @@ images {
}

group {
name: "e/widgets/entry";
name: "e/widgets/entry/scrollframe";
min: 18 18;
parts {
part {
name: "entry";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
//min: 22 24;
max: 9999 24;
image {
normal: "entry.png";
border: 8 8 8 8;
border: 6 6 8 7;
}
color_class: "dialog_base";
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
visible: 0;
}
}

part { name: "clipper"; type: RECT;
description { state: "default" 0.0;
rel1.to: "entry";
rel2.to: "entry";
}
}

part {
name: "entry_focus";
name: "focus_clip";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
image {
normal: "focus.png";
border: 7 7 7 7;
middle: 0;
}
fill {
smooth: 0;
}
}
description {
state: "focus" 0.0;
state: "focused" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}

part {
name: "e.swallow.text";
type: SWALLOW;
name: "focus";
mouse_events: 0;
clip_to: "focus_clip";
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 4 4;
to: "entry";
image.normal: "focus.png";
image.border: 7 7 7 7;
rel1 {
to: "entry";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -5 -5;
to: "entry";
rel2 {
to: "entry";
relative: 1.0 1.0;
offset: -1 -2;
}
color_class: "focus";
}
}

part {
name: "e.swallow.content";
type: SWALLOW;
mouse_events: 1;
clip_to: "clipper";
description {
state: "default" 0.0;
rel1.offset: 6 3;
rel2.offset: -7 -4;
}
}
}
programs {
program {
name: "entry_focus";
signal: "e,state,focused";
source: "e";
action: STATE_SET "focus" 0.0;
transition: DECELERATE 0.2;
target: "entry_focus";
}
program {
name: "entry_unfocus";
signal: "e,state,unfocused";
source: "e";
action: STATE_SET "default" 0.0;
transition: ACCELERATE 0.5;
target: "entry_focus";
# ifdef FOCUS
# undef FOCUS
# endif
#define FOCUS(NAME,SIGNAL,STATE) \
program { \
name: NAME; \
signal: SIGNAL; \
source: "e"; \
action: STATE_SET STATE 0.0; \
target: "focus_clip"; \
}
FOCUS("focus_in", "e,state,focused", "focused")
FOCUS("focus_out", "e,state,unfocused", "default")
}
}


group {
name: "e/widgets/entry/text";
parts {
part {
part {
name: "e.text.text";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0.0;
color: 0 0 0 255;
color_class: "entry_text";
text {
text: "Entry";
font: "Edje-Vera";
size: 10;
min: 1 1;
type: TEXTBLOCK;
mouse_events: 1;
scale: 1;
entry_mode: EDITABLE;
select_mode: DEFAULT;
cursor_mode: BEFORE;
multiline: 0;
source: "e/widgets/entry/selection"; // selection under
source4: "e/widgets/entry/cursor"; // cursorover
description { state: "default" 0.0;
color_class: "entry_text";
align: 0.0 0.5;
text {
//text: "";
style: "entry_textblock_style";
min: 1 1;
align: 0.0 0.5;
ellipsis: -1;
align: 0.0 0.0;
text_class: "entry";
}
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
color: 128 128 128 255;
}
}
}
description { state: "disabled" 0.0;
inherit: "default" 0.0;
text.style: "entry_textblock_disabled_style";
color_class: "entry_text_disabled";
}
}
}

programs {
program {
name: "disable";
signal: "e,state,disabled";
source: "e";
action: STATE_SET "disabled" 0.0;
target: "e.text.text";
}
program {
name: "enable";
signal: "e,state,enabled";
source: "e";
action: STATE_SET "default" 0.0;
target: "e.text.text";
}
}
program { name: "focus";
signal: "load";
source: "";
action: FOCUS_SET;
target: "e.text.text";
}
program {
name: "disable";
signal: "e,state,disabled";
source: "e";
action: STATE_SET "disabled" 0.0;
target: "e.text.text";
}
program {
name: "enable";
signal: "e,state,enabled";
source: "e";
action: STATE_SET "default" 0.0;
target: "e.text.text";
}
}
}

group {
name: "e/widgets/entry/cursor";
min: 1 0;
parts {
part {
name: "cursor";
type: RECT;
description {
state: "default" 0.0;
color: 0 0 0 255;
visible: 0;
part { name: "cursor"; mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: -4 -4;
rel2.offset: 3 3;
image.normal: "white_bar_vert_glow.png";
image.border: 4 4 4 4;
fill.smooth: 0;
color: 255 255 255 0;
min: 9 10;
}
description {
state: "visible" 0.0;
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
}
programs {
program {
name: "on_cursor_show";
signal: "e,action,show,cursor";
source: "e";
signal: "e,action,show,cursor"; source: "e";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
Expand All @@ -155,30 +190,41 @@ group {
after: "cursor_show";
}
program {
name: "cursor_show";
name: "on_cursor_hide";
signal: "e,action,hide,cursor";
source: "e";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
target: "cursor_show_timer";
target: "cursor_hide_timer";
after: "cursor_hide_stop";
}
program {
name: "cursor_hide_stop";
action: STATE_SET "default" 0.0;
target: "cursor";
}
program { name: "cursor_show";
action: STATE_SET "visible" 0.0;
target: "cursor";
after: "cursor_show_timer";
}
program {
name: "cursor_hide";
program { name: "cursor_hide";
action: STATE_SET "default" 0.0;
target: "cursor";
after: "cursor_hide_timer";
}
program {
name: "cursor_show_timer";
program { name: "cursor_show_timer";
in: 1.0 0.0;
after: "cursor_hide";
}
program {
name: "cursor_hide_timer";
program { name: "cursor_hide_timer";
in: 0.25 0.0;
after: "cursor_show";
}
}
}

group {
name: "e/widgets/entry/selection";
data {
Expand Down

0 comments on commit 2cc7060

Please sign in to comment.