}
desc { "visible";
inherit: "default";
- rel1.offset: 2 5;
+ rel1.offset: 5 5;
text.min: 1 1;
text.ellipsis: -1;
visible: 1;
}
desc { "disabled_visible";
inherit: "default";
- rel1.offset: 2 5;
+ rel1.offset: 5 5;
color_class: "hoversel_text_disabled";
text.min: 1 1;
text.ellipsis: -1;
visible: 0;
}
}
+ spacer { "text_container";
+ desc { "default";
+ rel1.relative: 1.0 0.0;
+ rel1.to_x: "elm.swallow.content";
+ rel1.to_y: "base";
+ rel2.to: "base";
+ }
+ }
text { "elm.text"; nomouse;
effect: SHADOW BOTTOM;
scale: 1;
clip_to: "click_clip";
desc { "default";
rel1.offset: 0 5;
- rel1.relative: 1.0 0.0;
- rel1.to_x: "elm.swallow.content";
- rel1.to_y: "base";
rel2.offset: -8 -8;
- rel2.to: "base";
+ rel1.to: "text_container";
+ rel2.to: "text_container";
color_class: "hoversel_text";
color3: 255 255 255 255;
text { font: FN; size: 10;
- align: 0.0 0.5;
+ align: -1 0.5;
min: 0 0;
text_class: "button";
}
color3: 255 255 255 255;
text { font: FN; size: 10;
text_source: "elm.text";
- align: 0.0 0.5;
+ align: -1 0.5;
text_class: "hoversel_item";
}
visible: 0;
elm_hoversel_clear((Evas_Object *)data);
}
+static void
+_reverse_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ if (!data) return;
+ elm_object_mirrored_set(data, !elm_object_mirrored_get (data));
+ printf("\nMirrored mode is now %s", elm_object_mirrored_get(data) ? "ON" : "OFF" );
+ fflush(stdout);
+}
+
+Eina_Bool is_eng = EINA_TRUE;
+static void
+_arabic_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ if (!data) return;
+ is_eng = !is_eng;
+ elm_object_text_set(data, is_eng ?
+ "Enable Arabic for new items" :
+ "Enable English for new items");
+}
+
EAPI_MAIN int
elm_main(int argc, char **argv)
{
evas_object_move(btn, 10, 50);
evas_object_show(btn);
+ btn = elm_button_add(win);
+ elm_object_text_set(btn, "Change Mirror Mode");
+ evas_object_smart_callback_add(btn, "clicked", _reverse_btn_clicked_cb, hoversel);
+ evas_object_resize(btn, 180, 30);
+ evas_object_move(btn, 10, 90);
+ evas_object_show(btn);
+
+ btn = elm_button_add(win);
+ elm_object_text_set(btn, "Enable Arabic for new items");
+ evas_object_smart_callback_add(btn, "clicked", _arabic_btn_clicked_cb, btn);
+ evas_object_resize(btn, 180, 30);
+ evas_object_move(btn, 10, 130);
+ evas_object_show(btn);
+
evas_object_resize(win, 200, 300);
evas_object_show(win);
_add_item(void *data, Evas_Object *obj, void *event_info)
{
static int num = 0;
- char *str = malloc(sizeof(char) * 10);
+ char *str = malloc(sizeof(char) * 11);
Elm_Object_Item *hoversel_it;
- snprintf(str, 10, "item %d", ++num);
+ if(is_eng)
+ snprintf(str, 11, "item %d", ++num);
+ else
+ snprintf(str, 11, "بند %d", ++num);
hoversel_it = elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL,
str);
sd->hover = elm_hover_add(sd->hover_parent);
elm_widget_sub_object_add(obj, sd->hover);
- elm_widget_mirrored_automatic_set(sd->hover, EINA_FALSE);
if (sd->horizontal)
snprintf(buf, sizeof(buf), "hoversel_horizontal/%s",
/* hover's content */
bx = elm_box_add(sd->hover);
- elm_widget_mirrored_automatic_set(bx, EINA_FALSE);
elm_box_homogeneous_set(bx, EINA_TRUE);
elm_box_horizontal_set(bx, sd->horizontal);
{
ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
VIEW(item) = bt = elm_button_add(bx);
- elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
elm_object_style_set(bt, buf);
elm_object_text_set(bt, item->label);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
- elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
-
evas_object_smart_callback_add(obj, "clicked", _on_clicked, obj);
//What are you doing here?