forked from enlightenment/efl
patch from <jihoon48.kim@samsung.com> - horizontal context menu option.
SVN revision: 45105
This commit is contained in:
parent
15e801e3d3
commit
658583e309
|
@ -196,6 +196,7 @@ test_entry_scrolled(void *data, Evas_Object *obj, void *event_info)
|
||||||
elm_box_pack_end(bx, sc);
|
elm_box_pack_end(bx, sc);
|
||||||
|
|
||||||
en = elm_entry_add(win);
|
en = elm_entry_add(win);
|
||||||
|
elm_entry_context_menu_horizontal_set(en, 1);
|
||||||
elm_entry_context_menu_item_add(en, "Hello", NULL, ELM_ICON_NONE, NULL, NULL);
|
elm_entry_context_menu_item_add(en, "Hello", NULL, ELM_ICON_NONE, NULL, NULL);
|
||||||
elm_entry_context_menu_item_add(en, "World", NULL, ELM_ICON_NONE, NULL, NULL);
|
elm_entry_context_menu_item_add(en, "World", NULL, ELM_ICON_NONE, NULL, NULL);
|
||||||
elm_entry_entry_set(en,
|
elm_entry_entry_set(en,
|
||||||
|
|
|
@ -560,6 +560,7 @@ extern "C" {
|
||||||
EAPI void elm_entry_selection_copy(Evas_Object *obj);
|
EAPI void elm_entry_selection_copy(Evas_Object *obj);
|
||||||
EAPI void elm_entry_selection_paste(Evas_Object *obj);
|
EAPI void elm_entry_selection_paste(Evas_Object *obj);
|
||||||
EAPI void elm_entry_context_menu_clear(Evas_Object *obj);
|
EAPI void elm_entry_context_menu_clear(Evas_Object *obj);
|
||||||
|
EAPI void elm_entry_context_menu_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
|
||||||
EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data);
|
EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data);
|
||||||
EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled);
|
EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled);
|
||||||
EAPI Eina_Bool elm_entry_context_menu_disabled_get(Evas_Object *obj);
|
EAPI Eina_Bool elm_entry_context_menu_disabled_get(Evas_Object *obj);
|
||||||
|
@ -665,6 +666,7 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent);
|
EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent);
|
||||||
|
EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
|
||||||
EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
|
EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
|
||||||
EAPI void elm_hoversel_label_set(Evas_Object *obj, const char *label);
|
EAPI void elm_hoversel_label_set(Evas_Object *obj, const char *label);
|
||||||
EAPI const char *elm_hoversel_label_get(Evas_Object *obj);
|
EAPI const char *elm_hoversel_label_get(Evas_Object *obj);
|
||||||
|
|
|
@ -26,6 +26,7 @@ struct _Widget_Data
|
||||||
Evas_Object *btn, *hover;
|
Evas_Object *btn, *hover;
|
||||||
Evas_Object *hover_parent;
|
Evas_Object *hover_parent;
|
||||||
Eina_List *items;
|
Eina_List *items;
|
||||||
|
Eina_Bool horizontal:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Elm_Hoversel_Item
|
struct _Elm_Hoversel_Item
|
||||||
|
@ -151,6 +152,7 @@ _activate(Evas_Object *obj)
|
||||||
|
|
||||||
bx = elm_box_add(wd->hover);
|
bx = elm_box_add(wd->hover);
|
||||||
elm_box_homogenous_set(bx, 1);
|
elm_box_homogenous_set(bx, 1);
|
||||||
|
elm_box_horizontal_set(bx, wd->horizontal);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
|
snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
|
||||||
elm_widget_style_get(obj));
|
elm_widget_style_get(obj));
|
||||||
|
@ -185,6 +187,8 @@ _activate(Evas_Object *obj)
|
||||||
|
|
||||||
evas_object_show(wd->hover);
|
evas_object_show(wd->hover);
|
||||||
evas_object_smart_callback_call(obj, "clicked", NULL);
|
evas_object_smart_callback_call(obj, "clicked", NULL);
|
||||||
|
|
||||||
|
if(wd->horizontal)evas_object_hide(wd->btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -282,6 +286,13 @@ elm_hoversel_label_set(Evas_Object *obj, const char *label)
|
||||||
elm_button_label_set(wd->btn, label);
|
elm_button_label_set(wd->btn, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
wd->horizontal = !!horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the hoversel button label
|
* Get the hoversel button label
|
||||||
*
|
*
|
||||||
|
|
|
@ -33,6 +33,7 @@ struct _Widget_Data
|
||||||
Eina_Bool deferred_cur : 1;
|
Eina_Bool deferred_cur : 1;
|
||||||
Eina_Bool disabled : 1;
|
Eina_Bool disabled : 1;
|
||||||
Eina_Bool context_menu : 1;
|
Eina_Bool context_menu : 1;
|
||||||
|
Eina_Bool horizontal : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Elm_Entry_Context_Menu_Item
|
struct _Elm_Entry_Context_Menu_Item
|
||||||
|
@ -387,6 +388,7 @@ _long_press(void *data)
|
||||||
if (wd->hoversel) evas_object_del(wd->hoversel);
|
if (wd->hoversel) evas_object_del(wd->hoversel);
|
||||||
else elm_widget_scroll_freeze_push(data);
|
else elm_widget_scroll_freeze_push(data);
|
||||||
wd->hoversel = elm_hoversel_add(data);
|
wd->hoversel = elm_hoversel_add(data);
|
||||||
|
elm_hoversel_horizontal_set(wd->hoversel, wd->horizontal);
|
||||||
elm_object_style_set(wd->hoversel, "entry");
|
elm_object_style_set(wd->hoversel, "entry");
|
||||||
elm_widget_sub_object_add(data, wd->hoversel);
|
elm_widget_sub_object_add(data, wd->hoversel);
|
||||||
elm_hoversel_label_set(wd->hoversel, "Text");
|
elm_hoversel_label_set(wd->hoversel, "Text");
|
||||||
|
@ -1457,6 +1459,13 @@ elm_entry_context_menu_clear(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_entry_context_menu_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
wd->horizontal = !!horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data)
|
elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue