Add a padding before scan button in IOT common profile 24/241924/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 21 Aug 2020 02:25:51 +0000 (11:25 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 21 Aug 2020 02:25:51 +0000 (11:25 +0900)
Change-Id: Iec07a00837038eea8195159b096cfa8260a9c52e
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
res/edje/main_layout.edc
standard/bt-callback.c
standard/bt-main-view.c

index 66df75e..050b119 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #define PADDING_SIZE 40
+#define PADDING_BOTTOM_SIZE 30
 
 collections
 {
@@ -56,8 +57,8 @@ collections
                        }
                        spacer { "padding.bottom"; scale;
                                desc { "default";
-                                       min: 0 PADDING_SIZE;
-                                       max: -1 PADDING_SIZE;
+                                       min: 0 PADDING_BOTTOM_SIZE;
+                                       max: -1 PADDING_BOTTOM_SIZE;
                                        fixed: 0 1;
                                        align: 0.0 1.0;
                                        rel.to: "base";
index 1ad0303..12b983d 100644 (file)
@@ -146,9 +146,6 @@ static void __bt_cb_enable(int result, void *data)
        if (!ecore_idler_add(__bt_cb_auto_discovery, ugd))
                BT_ERR("idler can not be added\n\n");
 
-       if (TIZEN_COMMON)
-               elm_object_item_signal_emit(ugd->onoff_item, "elm,state,group,top", "elm");
-
        FN_END;
 }
 
@@ -228,9 +225,6 @@ static void __bt_cb_disable(int result, void *data)
        _bt_update_genlist_item(ugd->paired_title);
        _bt_update_genlist_item(ugd->searched_title);
 
-       if (TIZEN_COMMON)
-               elm_object_item_signal_emit(ugd->onoff_item, "elm,state,group,single", "elm");
-
        FN_END;
 }
 
index 4c6a711..d526a9a 100644 (file)
@@ -1808,7 +1808,10 @@ static void __bt_main_gl_realized(void *data, Evas_Object *obj, void *event_info
 
        /* onoff / device name item style */
        if (item == ugd->onoff_item) {
-               group_type = (next_item == NULL) ? BT_GENLIST_GROUP_SINGLE : BT_GENLIST_GROUP_TOP;
+               if (TIZEN_COMMON)
+                       group_type = BT_GENLIST_GROUP_SINGLE;
+               else
+                       group_type = (next_item == NULL) ? BT_GENLIST_GROUP_SINGLE : BT_GENLIST_GROUP_TOP;
        } else if (item == ugd->device_name_item) {
                group_type = BT_GENLIST_GROUP_BOTTOM;
        } else {
@@ -3194,19 +3197,40 @@ static void __bt_more_menu_cb(void *data,
 Evas_Object * _bt_main_create_scan_button(bt_ug_data *ugd)
 {
        Evas_Object *scan_button = NULL;
+       Evas_Object *box = NULL;
+
+       box = elm_box_add(ugd->navi_bar);
+       if (!box) {
+               BT_DBG("Can't create box");
+               return NULL;
+       }
 
-       scan_button = elm_button_add(ugd->navi_bar);
+       scan_button = elm_button_add(box);
 
-       /* Use "bottom" style button */
-       elm_object_style_set(scan_button, "bottom");
+       if (TIZEN_COMMON) {
+               /* Use "border" style button for IOT common */
+               elm_object_style_set(scan_button, "border");
+       } else {
+               /* Use "bottom" style button */
+               elm_object_style_set(scan_button, "bottom");
+       }
 
        elm_object_text_set(scan_button, BT_STR_SCAN);
 
+       evas_object_size_hint_align_set(scan_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(scan_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       if (TIZEN_COMMON)
+               evas_object_size_hint_padding_set(scan_button, 0, 0, 30, 0);
+
        evas_object_smart_callback_add(scan_button, "clicked",
                        __bt_main_controlbar_btn_cb, ugd);
 
-       /* Set button into "toolbar" swallow part */
-       elm_object_item_part_content_set(ugd->navi_it, "toolbar", scan_button);
+       elm_box_pack_end(box, scan_button);
+
+       /* Set box into "toolbar" swallow part */
+       elm_object_item_part_content_set(ugd->navi_it, "toolbar", box);
+       evas_object_show(scan_button);
 
        return scan_button;
 }