From: jiin.moon Date: Thu, 11 Jan 2018 08:28:50 +0000 (+0900) Subject: test_win_state: added buttons for switching floating mode X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~341 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94138adc7f4271c90f40cfe2a92e59a2ad6123c0;p=platform%2Fupstream%2Fefl.git test_win_state: added buttons for switching floating mode From 157ff9d43b79936666a1e25332f438c3260b9a0f Mon Sep 17 00:00:00 2001 From: MinJeong Kim Date: Mon, 25 Apr 2016 20:53:09 +0900 Subject: [PATCH] test_win_state: added buttons for switching floating mode Change-Id: I732d5bd2c41ca2d03ee8795f18876dd5db7b702d --- diff --git a/src/bin/elementary/test_win_state.c b/src/bin/elementary/test_win_state.c index b08ea7a..2b9e9b8 100644 --- a/src/bin/elementary/test_win_state.c +++ b/src/bin/elementary/test_win_state.c @@ -226,6 +226,41 @@ _bt_win_center_cb(void *data, Evas_Object *obj EINA_UNUSED, elm_win_center(data, EINA_TRUE, EINA_TRUE); } +/* TIZEN_ONLY(20180111): ++ added buttons for switching floating*/ +static void +_bt_win_floating_mode_set_cb(void *data, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Eina_Bool current = EINA_FALSE; + Evas_Object *win = data; + + current = elm_win_floating_mode_get(win); + if (current) return; + + printf("Set floating mode for window.\n"); + elm_win_floating_mode_set(win, EINA_TRUE); + if (!current) + { + evas_object_move(win, 100, 100); + evas_object_resize(win, 500, 500); + } +} + +static void +_bt_win_floating_mode_unset_cb(void *data, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Eina_Bool current = EINA_FALSE; + Evas_Object *win = data; + + current = elm_win_floating_mode_get(win); + if (!current) return; + + printf("Unset floating mode for window.\n"); + elm_win_floating_mode_set(win, EINA_FALSE); +} +/* TIZEN_ONLY(20180111): -- added buttons for switching floating*/ + static void _win_state_print_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -470,6 +505,35 @@ test_win_state(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event elm_box_pack_end(bx, bx2); evas_object_show(bx2); +/* TIZEN_ONLY(20180111): ++ added-buttons-for-switching-floating*/ + bx2 = elm_box_add(win); + elm_box_horizontal_set(bx2, EINA_TRUE); + elm_box_homogeneous_set(bx2, EINA_TRUE); + evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_fill_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); + + bt = elm_button_add(win); + elm_object_text_set(bt, "floating mode set"); + evas_object_smart_callback_add(bt, "clicked", + _bt_win_floating_mode_set_cb, win); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(bx2, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_object_text_set(bt, "floating mode unset"); + evas_object_smart_callback_add(bt, "clicked", + _bt_win_floating_mode_unset_cb, win); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(bx2, bt); + evas_object_show(bt); + + elm_box_pack_end(bx, bx2); + evas_object_show(bx2); +/* TIZEN_ONLY(20180111): -- added-buttons-for-switching-floating*/ + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, EINA_TRUE); elm_box_homogeneous_set(bx2, EINA_TRUE);