Use ewkView as parent object of picker popup
authorKwangYong Choi <ky0.choi@samsung.com>
Fri, 4 Oct 2013 14:33:31 +0000 (23:33 +0900)
committerKwangYong Choi <ky0.choi@samsung.com>
Fri, 4 Oct 2013 14:35:46 +0000 (23:35 +0900)
[Title] Use ewkView as parent object of picker popup.
[Issue#] P131004-01644
[Problem] Picker popup is not displayed.
[Cause] EFL starts to check parent of popup tightly.
[Solution] Use ewkView as parent object of picker popup.

Change-Id: Ic520e7c28c8e3358860171d775a3941818c3687b

Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.cpp
Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.h
Source/WebKit2/UIProcess/API/efl/tizen/control.edc

index 22eb715..99ef5b4 100755 (executable)
@@ -144,7 +144,6 @@ static char* datetimeFormat()
 
 Input_Picker_Layout::Input_Picker_Layout(Evas_Object* ewkView)
     : m_ewkView(ewkView)
-    , conformant(0)
     , popup(0)
     , layout(0)
     , datePicker(0)
@@ -492,8 +491,7 @@ void InputPicker::ewk_color_popup(int r, int g, int b)
 
     m_pickerLayout = new Input_Picker_Layout(m_ewkView);
 
-    Evas_Object* parent = parentWindow();
-    m_pickerLayout->popup = elm_popup_add(parent);
+    m_pickerLayout->popup = elm_popup_add(elm_object_parent_widget_get(m_ewkView));
     elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select color");
 
 #if ENABLE(TIZEN_HW_MORE_BACK_KEY)
@@ -1043,8 +1041,7 @@ void InputPicker::ewk_datetime_popup(const char* inputValue, bool local)
 
 void InputPicker::createDatetimePopup(const char* title, struct tm* currentTime)
 {
-    Evas_Object* parent = parentWindow();
-    m_pickerLayout->popup = elm_popup_add(parent);
+    m_pickerLayout->popup = elm_popup_add(elm_object_parent_widget_get(m_ewkView));
     evas_object_size_hint_weight_set(m_pickerLayout->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
     elm_object_part_text_set(m_pickerLayout->popup, "title,text", title);
 
@@ -1078,44 +1075,11 @@ void InputPicker::createDatetimePopup(const char* title, struct tm* currentTime)
 #endif
 }
 
-Evas_Object* InputPicker::parentWindow()
-{
-    Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
-    Evas_Object* win = parent;
-
-    while (parent) {
-        const char* type = elm_object_widget_type_get(parent);
-        if (type) {
-            if (!strncmp(type, "elm_win", strlen("elm_win"))) {
-                win = parent;
-                break;
-            }
-        }
-        parent = elm_object_parent_widget_get(parent);
-    }
-
-    if (!win)
-        win = m_ewkView;
-
-    Evas_Object* conformant = elm_conformant_add(win);
-    elm_win_conformant_set(win, EINA_TRUE);
-    elm_win_resize_object_add(win, conformant);
-    evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    evas_object_show(conformant);
-    m_pickerLayout->conformant = conformant;
-
-    Evas_Object* content = elm_layout_add(conformant);
-    elm_object_content_set(conformant, content);
-
-    return content;
-}
-
 void InputPicker::deletePopupLayout()
 {
-    if(m_pickerLayout->conformant){
-        evas_object_del(m_pickerLayout->conformant);
-        m_pickerLayout->conformant = 0;
+    if(m_pickerLayout->popup){
+        evas_object_del(m_pickerLayout->popup);
+        m_pickerLayout->popup = 0;
     }
 }
 
index 29e7603..fed7484 100644 (file)
@@ -37,7 +37,6 @@ public:
     ~Input_Picker_Layout();
 
     Evas_Object* m_ewkView;
-    Evas_Object* conformant;
     Evas_Object* popup;
     Evas_Object* layout;
     Evas_Object* datePicker;
@@ -89,7 +88,6 @@ public:
 
 private:
     void createDatetimePopup(const char*, struct tm*);
-    Evas_Object* parentWindow();
     void deletePopupLayout();
     void addColorRect(const char*, int, int, int, ColorPopupUserData*);
 
index 3ad9d72..f77c2db 100644 (file)
@@ -18,13 +18,24 @@ collections {
                     rel2 { relative: 1.0 1.0; }
                 }
             }
+            part { name: "pad_left";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 0.5;
+                    min: 20 0;
+                    rel1 { relative: 0.0 0.0; to: "bg"; }
+                    rel2 { relative: 0.0 1.0; to: "bg"; }
+                }
+            }
             part { name: "elm.swallow.datetime";
                 type: SWALLOW;
                 scale: 1;
                 description {
                     state: "default" 0.0;
                     align: 0.0 0.5;
-                    rel1 { relative: 0.0 0.0; to: "bg"; }
+                    rel1 { relative: 1.0 0.0; to: "pad_left"; }
                     rel2 { relative: 1.0 1.0; to: "bg"; }
                 }
             }