enventor: Add customized entry styles for line entry

Summary: Add customized entry styles for line entry

Reviewers: Hermet

Differential Revision: https://phab.enlightenment.org/D1363
This commit is contained in:
Jaehyun Cho 2014-08-27 17:00:41 +09:00 committed by ChunEon Park
parent 1eae977508
commit 99af6d4b9e
5 changed files with 208 additions and 2 deletions

View File

@ -65,4 +65,6 @@ EXTRA_DIST = \
live_text.png \
live_textblock.png \
live_edit.png \
new.png
new.png \
white_bar_vert_glow.png \
horizontal_separated_bar_small_glow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

View File

@ -11,6 +11,25 @@
#define PANEMIN2 16
#define PANEWID 32
styles {
style { name: "entry_style";
base: "font="FN" font_size=10 color=#656565 text_class=entry shadow_color=#00000080 style=shadow,bottom";
tag: "em" "+ font_style=Oblique";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
tag: "hilight" "+ font_weight=Bold";
tag: "preedit" "+ underline=on underline_color=#000";
tag: "preedit_sel" "+ backing=on backing_color=#000 color=#FFFFFF";
}
style { name: "entry_edit_style";
base: "font="FN" font_size=10 color=#d4d4d4 text_class=entry shadow_color=#00000080 style=shadow,bottom";
tag: "em" "+ font_style=Oblique";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
tag: "hilight" "+ font_weight=Bold";
tag: "preedit" "+ underline=on underline_color=#000";
tag: "preedit_sel" "+ backing=on backing_color=#000 color=#FFFFFF";
}
}
group { name: "elm/scroller/base/enventor";
images.image: "inset_shadow.png" COMP;
images.image: "bevel_in.png" COMP;
@ -1117,3 +1136,188 @@ group { name: "elm/panes/vertical/enventor";
}
}
}
group { name: "elm/entry/base/enventor";
alias: "elm/entry/base/about";
/*
sounds {
sample { name: "key-tap1" LOSSY 64;
source: "kbd-tap.wav";
}
sample { name: "key-tap2" LOSSY 64;
source: "kbd-tap2.wav";
}
sample { name: "key-tap3" LOSSY 64;
source: "kbd-tap3.wav";
}
sample { name: "key-tap4" LOSSY 64;
source: "kbd-tap4.wav";
}
sample { name: "key-tap5" LOSSY 64;
source: "kbd-tap5.wav";
}
}
*/
parts {
part { name: "elm.text"; type: TEXTBLOCK;
scale: 1;
entry_mode: EDITABLE;
select_mode: EXPLICIT;
cursor_mode: BEFORE;
multiline: 1;
source: "elm/entry/selection/enventor"; // selection under
source4: "elm/entry/cursor/enventor"; // cursorover
source6: "elm/entry/anchor/enventor"; // anchor over
description { state: "default" 0.0;
/* we gotta use 0 0 here, because of scrolled entries */
fixed: 0 0;
rel1.offset: 2 2;
rel2.offset: -3 -3;
text { style: "entry_edit_style";
min: 0 1;
align: 0.0 0.0;
}
}
}
}
programs {
program {
signal: "load"; source: "";
action: FOCUS_SET;
target: "elm.text";
}
/*
program { name: "key-down";
signal: "entry,keydown"; source: "elm.text";
script {
new buf[32];
snprintf(buf, 31, "key-down%i", (rand() % 5) + 1);
run_program(get_program_id(buf));
}
}
program { name: "key-down1";
action: PLAY_SAMPLE "key-tap1" 1.0;
}
program { name: "key-down2";
action: PLAY_SAMPLE "key-tap2" 1.0;
}
program { name: "key-down3";
action: PLAY_SAMPLE "key-tap3" 1.0;
}
program { name: "key-down4";
action: PLAY_SAMPLE "key-tap4" 1.0;
}
program { name: "key-down5";
action: PLAY_SAMPLE "key-tap5" 1.0;
} */
}
}
group { name: "elm/entry/base-nowrap-noedit/enventor";
inherit: "elm/entry/base/enventor";
parts {
part { name: "elm.text";
entry_mode: PLAIN;
source: "elm/entry/selection/enventor"; // selection under
source4: ""; // cursorover
source6: "elm/entry/anchor/enventor"; // anchor under
description { state: "default" 0.0;
text { style: "entry_style";
min: 1 1;
align: 0.0 0.0;
}
}
}
}
}
group { name: "elm/entry/cursor/enventor";
min: 1 0;
images.image: "white_bar_vert_glow.png" COMP;
parts {
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;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
}
programs {
program {
signal: "elm,action,focus"; source: "elm";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
target: "cursor_show_timer";
target: "cursor_hide_timer";
after: "cursor_show";
}
program {
signal: "elm,action,unfocus"; source: "elm";
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";
action: STATE_SET "default" 0.0;
target: "cursor";
transition: SINUSOIDAL 0.2;
after: "cursor_hide_timer";
}
program { name: "cursor_show_timer";
in: 0.5 0.0;
after: "cursor_hide";
}
program { name: "cursor_hide_timer";
in: 0.2 0.0;
after: "cursor_show";
}
}
}
group { name: "elm/entry/selection/enventor";
parts {
part { name: "base"; type: RECT;
description { state: "default" 0.0;
color: 100 100 100 255;
}
}
}
}
group { name: "elm/entry/anchor/enventor";
images.image: "horizontal_separated_bar_small_glow.png" COMP;
parts {
part { name: "bar";
description { state: "default" 0.0;
image.normal: "horizontal_separated_bar_small_glow.png";
image.border: 4 4 4 4;
fill.smooth: 0;
rel1.relative: 0.0 1.0;
rel1.offset: -3 -5;
rel2.offset: 2 4;
}
}
}
}

View File

@ -885,7 +885,7 @@ edit_init(Evas_Object *parent)
//Line Number Entry
Evas_Object *en_line = elm_entry_add(layout);
evas_object_color_set(en_line, 101, 101, 101, 255);
elm_object_style_set(en_line, elm_app_name_get());
elm_entry_editable_set(en_line, EINA_FALSE);
elm_entry_line_wrap_set(en_line, ELM_WRAP_NONE);
elm_object_focus_allow_set(en_line, EINA_FALSE);