start work on an entry for channel input

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-12-18 16:33:17 -05:00
parent cbc7e8ab0d
commit d8acc7216a
3 changed files with 215 additions and 5 deletions

View File

@ -305,6 +305,12 @@ collections
group
{
name: "express/channel";
images
{
image: "bg_bevel.png" COMP;
image: "bg_glint.png" COMP;
image: "pm_shadow.png" COMP;
}
script
{
public message(Msg_Type:type, id, ...)
@ -348,9 +354,185 @@ collections
{
state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
rel2.to_y: "channel.entry";
rel2.offset: -2 -10;
}
}
part
{
name: "entryclip";
type: RECT;
description
{
state: "default" 0.0;
color: 255 255 255 0;
visible: 0;
rel1
{
to: "channel.entry";
offset: -100 -100;
}
rel2
{
to: "channel.entry";
offset: 99 99;
}
}
description
{
state: "visible" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
visible: 1;
}
}
part
{
name: "entryshadow";
type: IMAGE;
mouse_events: 0;
clip_to: "entryclip";
description
{
state: "default" 0.0;
fixed: 1 1;
rel1
{
offset: -32 -32;
to: "entryback";
}
rel2
{
offset: 31 31;
to: "entryback";
}
image
{
normal: "pm_shadow.png";
border: 64 64 64 64;
}
fill.smooth: 0;
}
}
part
{
name: "entryback";
type: RECT;
clip_to: "entryclip";
description
{
state: "default" 0.0;
color: 48 48 48 255;
rel1
{
to: "channel.entry";
offset: -2 -2;
}
rel2
{
to: "channel.entry";
offset: 1 1;
}
}
}
part
{
name: "channel.entry";
type: SWALLOW;
clip_to: "entryclip";
description
{
state: "default" 0.0;
fixed: 1 1;
min: 8 8;
align: 0.5 0.0;
rel1
{
relative: 0.0 1.0;
offset: 8 9;
}
rel2.offset: -9 9;
}
description
{
state: "visible" 0.0;
inherit: "default" 0.0;
rel1.offset: 8 -9;
rel2.offset: -9 -9;
align: 0.5 1.0;
}
}
part
{
name: "entrybevel";
type: IMAGE;
mouse_events: 0;
clip_to: "entryclip";
description
{
state: "default" 0.0;
fixed: 1 1;
rel1.to: "entryback";
rel2.to: "entryback";
image
{
normal: "bg_bevel.png";
border: 3 3 3 3;
middle: 0;
}
fill.smooth: 0;
}
}
part
{
name: "entryglint";
type: IMAGE;
mouse_events: 0;
clip_to: "entryclip";
description
{
state: "default" 0.0;
fixed: 1 1;
min: 79 5;
max: 79 5;
rel1.to: "entryback";
rel2
{
relative: 1.0 0.0;
offset: -1 0;
to: "entryback";
}
image.normal: "bg_glint.png";
}
}
}
programs
{
program
{
signal: "chlentry,on";
source: "express";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.4;
target: "entryclip";
}
program
{
signal: "chlentry,on";
source: "express";
action: STATE_SET "visible" 0.0;
transition: SPRING 0.4 0.5 4;
target: "channel.entry";
}
program
{
signal: "chlentry,off";
source: "express";
action: STATE_SET "default" 0.0;
transition: ACCELERATE 0.5;
target: "channel.entry";
target: "entryclip";
}
}
}

View File

@ -16,6 +16,7 @@ struct _Channel
Evas_Object *o_grid;
Evas_Object *o_spacer;
Evas_Object *o_img;
Evas_Object *o_entry;
int step_x, step_y;
int min_w, min_h;
@ -207,6 +208,7 @@ _channel_destroy(Channel *chl)
/* delete channel objects */
if (chl->o_img) evas_object_del(chl->o_img);
if (chl->o_spacer) evas_object_del(chl->o_spacer);
if (chl->o_entry) evas_object_del(chl->o_entry);
if (chl->o_grid) evas_object_del(chl->o_grid);
if (chl->o_bg) evas_object_del(chl->o_bg);
if (chl->o_base) evas_object_del(chl->o_base);
@ -252,6 +254,7 @@ _channel_focus(Channel *chl)
edje_object_signal_emit(chl->o_bg, "focus,in", PACKAGE_NAME);
edje_object_signal_emit(chl->o_base, "focus,in", PACKAGE_NAME);
edje_object_signal_emit(chl->o_base, "chlentry,on", PACKAGE_NAME);
elm_object_focus_set(chl->o_grid, EINA_TRUE);
chl->focused = EINA_TRUE;
@ -263,7 +266,9 @@ _channel_unfocus(Channel *chl)
{
if (!chl->focused) return;
elm_object_focus_set(chl->o_grid, EINA_FALSE);
elm_object_focus_set(chl->o_entry, EINA_FALSE);
edje_object_signal_emit(chl->o_base, "chlentry,off", PACKAGE_NAME);
edje_object_signal_emit(chl->o_bg, "focus,out", PACKAGE_NAME);
edje_object_signal_emit(chl->o_base, "focus,out", PACKAGE_NAME);
@ -492,4 +497,26 @@ _channel_window_set(Channel *chl, Evas_Object *win)
{
_grid_window_set(chl->o_grid, win);
_grid_theme_set(chl->o_grid, chl->o_bg);
if (chl->o_entry) return;
chl->o_entry = elm_entry_add(win);
elm_entry_single_line_set(chl->o_entry, EINA_TRUE);
elm_entry_scrollable_set(chl->o_entry, EINA_TRUE);
elm_scroller_policy_set(chl->o_entry, ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_OFF);
elm_entry_input_panel_layout_set(chl->o_entry,
ELM_INPUT_PANEL_LAYOUT_TERMINAL);
elm_entry_autocapital_type_set(chl->o_entry, ELM_AUTOCAPITAL_TYPE_NONE);
elm_entry_input_panel_enabled_set(chl->o_entry, EINA_TRUE);
elm_entry_input_panel_language_set(chl->o_entry,
ELM_INPUT_PANEL_LANG_ALPHABET);
elm_entry_input_panel_return_key_type_set(chl->o_entry,
ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO);
elm_entry_prediction_allow_set(chl->o_entry, EINA_FALSE);
/* TODO: callbacks */
edje_object_part_swallow(chl->o_base, "channel.entry", chl->o_entry);
elm_entry_entry_set(chl->o_entry, "");
}

View File

@ -121,12 +121,12 @@ _cb_selector_selected(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
{
if (event == _channel_image_get(chl))
{
/* focus this channel */
_window_channel_focus(chl);
/* swallow this channel */
_window_channel_swallow(chl);
/* focus this channel */
_window_channel_focus(chl);
/* destroy selector */
_cb_selector_destroy();
@ -185,6 +185,7 @@ _cb_focus_out(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
_win->focused = EINA_FALSE;
elm_win_keyboard_mode_set(_win->o_win, ELM_WIN_KEYBOARD_OFF);
if ((chl = _window_channel_focused_get()))
_channel_unfocus(chl);
}