forked from enlightenment/efl
Modify Elm conformant widget to notify display mode change
to child widget related with keypad state change. elm naviframe check this change and deal with this using theme SVN revision: 77965
This commit is contained in:
parent
c2f161fb3d
commit
997824fba0
|
@ -606,3 +606,7 @@
|
|||
|
||||
* Fix the transit to launch the effect directly when elm_transit_go is called.
|
||||
|
||||
2012-10-14 Jiyoun Park (jypark)
|
||||
|
||||
* Add display mode change feature related with keypad state chante
|
||||
to elm conformant and naviframe.
|
||||
|
|
|
@ -25,6 +25,7 @@ Improvements:
|
|||
* Diskselector handles dyanmic show/hide of icons now like buttons.
|
||||
* Plug widget handles image object deletion
|
||||
* Handle COMPOUND_TEXT cnp
|
||||
* Conformant widget handles displaymode change related with keypad.
|
||||
|
||||
Fixes:
|
||||
|
||||
|
|
|
@ -1015,6 +1015,34 @@ _item_new(Evas_Object *obj,
|
|||
return it;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_on_obj_size_hints_changed(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Elm_Naviframe_Item *it;
|
||||
Evas_Display_Mode dispmode;
|
||||
|
||||
ELM_NAVIFRAME_DATA_GET(obj, sd);
|
||||
|
||||
it = elm_naviframe_top_item_get(obj);
|
||||
if (!it) return;
|
||||
|
||||
dispmode = evas_object_size_hint_display_mode_get(obj);
|
||||
if (sd->dispmode == dispmode) return;
|
||||
|
||||
sd->dispmode = dispmode;
|
||||
|
||||
switch (dispmode)
|
||||
{
|
||||
case EVAS_DISPLAY_MODE_COMPRESS:
|
||||
edje_object_signal_emit(VIEW(it), "display,mode,compress", "");
|
||||
break;
|
||||
default:
|
||||
edje_object_signal_emit(VIEW(it), "display,mode,default", "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_elm_naviframe_smart_focus_next(const Evas_Object *obj,
|
||||
Elm_Focus_Direction dir,
|
||||
|
@ -1083,6 +1111,7 @@ _elm_naviframe_smart_add(Evas_Object *obj)
|
|||
priv->auto_pushed = EINA_TRUE;
|
||||
priv->freeze_events = EINA_TRUE;
|
||||
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_obj_size_hints_changed, obj);
|
||||
elm_widget_can_focus_set(obj, EINA_FALSE);
|
||||
}
|
||||
|
||||
|
|
|
@ -446,16 +446,26 @@ _on_prop_change(void *data,
|
|||
else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
|
||||
{
|
||||
Ecore_X_Window zone;
|
||||
Ecore_X_Virtual_Keyboard_State vkb_state;
|
||||
|
||||
DBG("Keyboard Geometry Changed\n");
|
||||
zone = ecore_x_e_illume_zone_get(ev->win);
|
||||
sd->vkb_state = ecore_x_e_virtual_keyboard_state_get(zone);
|
||||
vkb_state = ecore_x_e_virtual_keyboard_state_get(zone);
|
||||
if (sd->vkb_state != vkb_state)
|
||||
{
|
||||
sd->vkb_state = vkb_state;
|
||||
if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
||||
{
|
||||
evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
|
||||
evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
|
||||
elm_widget_display_mode_set(data,EVAS_DISPLAY_MODE_NONE);
|
||||
}
|
||||
else if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
|
||||
{
|
||||
elm_widget_display_mode_set(data,EVAS_DISPLAY_MODE_COMPRESS);
|
||||
_autoscroll_objects_update(data);
|
||||
}
|
||||
}
|
||||
else _autoscroll_objects_update(data);
|
||||
}
|
||||
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE)
|
||||
{
|
||||
|
|
|
@ -3530,6 +3530,72 @@ elm_widget_activate(Evas_Object *obj, Elm_Activate act)
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Returns the widget's Evas_Display_Mode
|
||||
*
|
||||
* @param obj The widget.
|
||||
* @return Evas_Display_Mode of the object.
|
||||
*
|
||||
* @see elm_widget_display_mode_set().
|
||||
* @ingroup Widget
|
||||
**/
|
||||
EAPI Evas_Display_Mode
|
||||
elm_widget_display_mode_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Display_Mode new_mode;
|
||||
Evas_Object *parent;
|
||||
|
||||
API_ENTRY return EVAS_DISPLAY_MODE_NONE;
|
||||
|
||||
new_mode = evas_object_size_hint_display_mode_get(obj);
|
||||
parent = elm_widget_parent_get(obj);
|
||||
|
||||
if ((new_mode == EVAS_DISPLAY_MODE_INHERIT) && parent)
|
||||
return elm_widget_display_mode_get(parent);
|
||||
return new_mode;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Sets the widget and child widget's Evas_Display_Mode.
|
||||
*
|
||||
* @param obj The widget.
|
||||
* @param dispmode Evas_Display_Mode to set widget's mode.
|
||||
*
|
||||
* Widgets are resized by several reasons.
|
||||
* Evas_Display_Mode can help for widgets to get more reson of resize.
|
||||
* For example, elm conform widget resize it's contents when keypad state changed.
|
||||
* After keypad showing, conform widget can change child's Evas_Display_Mode.
|
||||
* @ingroup Widget
|
||||
*/
|
||||
EAPI void
|
||||
elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode)
|
||||
{
|
||||
Evas_Display_Mode child_mode;
|
||||
Evas_Object *child;
|
||||
Eina_List *l;
|
||||
|
||||
API_ENTRY return;
|
||||
|
||||
if (elm_widget_display_mode_get(obj) == dispmode) return;
|
||||
evas_object_size_hint_display_mode_set(obj, dispmode);
|
||||
|
||||
//TODO: Need to deal with EVAS_DISPLAY_MODE_INHERIT efficiently.
|
||||
EINA_LIST_FOREACH (sd->subobjs, l, child)
|
||||
{
|
||||
child_mode = evas_object_size_hint_display_mode_get(child);
|
||||
if (child_mode != EVAS_DISPLAY_MODE_DONT_CHANGE)
|
||||
{
|
||||
elm_widget_display_mode_set(child, dispmode);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
|
|
|
@ -692,6 +692,8 @@ EAPI Evas_Object *elm_widget_parent_get(const Evas_Object *obj);
|
|||
EAPI Evas_Object *elm_widget_parent2_get(const Evas_Object *obj);
|
||||
EAPI void elm_widget_parent2_set(Evas_Object *obj, Evas_Object *parent);
|
||||
EAPI void elm_widget_focus_steal(Evas_Object *obj);
|
||||
EAPI Evas_Display_Mode elm_widget_display_mode_get(Evas_Object *obj);
|
||||
EAPI void elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode);
|
||||
EAPI const Elm_Widget_Smart_Class *elm_widget_smart_class_get(void);
|
||||
|
||||
/**
|
||||
|
|
|
@ -126,6 +126,7 @@ struct _Elm_Naviframe_Smart_Data
|
|||
Eina_Inlist *stack; /* top item is the list's LAST item */
|
||||
Evas_Object *dummy_edje;
|
||||
Ecore_Animator *animator;
|
||||
Evas_Display_Mode dispmode;
|
||||
|
||||
Eina_Bool preserve : 1;
|
||||
Eina_Bool on_deletion : 1;
|
||||
|
|
Loading…
Reference in New Issue