Elementary test: Added a toggle to switch between UI-mirroring modes. On the fly...
authorTom Hacohen <tom@stosb.com>
Tue, 8 Feb 2011 14:13:07 +0000 (14:13 +0000)
committerTom Hacohen <tom@stosb.com>
Tue, 8 Feb 2011 14:13:07 +0000 (14:13 +0000)
SVN revision: 56811

src/bin/test.c

index e195fbe9b02189ff1b7a86be4f8158e45e305d54..e4d12ddb928053d3162d474f4af14ae5cc1b4b4d 100644 (file)
@@ -156,10 +156,18 @@ index_changed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
    elm_list_item_show(event_info);
 }
 
+static void
+_ui_tg_changed(void *data, Evas_Object *obj, void *event_info)
+{
+   (void) data; (void) event_info;
+   elm_mirrored_set(elm_toggle_state_get(obj));
+}
+
+
 static void
 my_win_main(char *autorun)
 {
-   Evas_Object *win, *bg, *bx0, *lb, *li, *idx, *fr;
+   Evas_Object *win, *bg, *bx0, *lb, *li, *idx, *fr, *tg;
    Eina_List *tests, *l;
    struct elm_test *t;
 
@@ -227,6 +235,13 @@ my_win_main(char *autorun)
    elm_frame_content_set(fr, lb);
    evas_object_show(lb);
 
+   tg = elm_toggle_add(win);
+   elm_toggle_label_set(tg, "UI-Mirroring:");
+   elm_toggle_state_set(tg, elm_mirrored_get());
+   evas_object_smart_callback_add(tg, "changed", _ui_tg_changed, NULL);
+   elm_box_pack_end(bx0, tg);
+   evas_object_show(tg);
+
    li = elm_list_add(win);
    elm_list_always_select_mode_set(li, 1);
    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);