For indicator widget, the elementaries for window are changed
authorlke01.lee <lke01.lee@samsung.com>
Tue, 23 Oct 2012 07:20:53 +0000 (16:20 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Fri, 2 Nov 2012 07:14:41 +0000 (16:14 +0900)
From : window-naviframe-conformant
To : window-conformant-naviframe

Change-Id: I07875fe619c232e8151e3dd24f9cd85a51b78a7d

data/Daemon.edc
src/wrt-client/window_data.cpp
src/wrt-client/window_data.h
src/wrt-client/wrt-client.cpp

index 4c9c9d7..8c7e818 100644 (file)
@@ -7,6 +7,7 @@ collections {
                 type: RECT;
                 description {
                     state: "default" 0.0;
+                    fixed: 1 1;
                     rel1 { relative: 0 0; offset: 0 0; }
                     rel2 { relative: 1 1; offset: -1 -1; }
                     color: 255 255 255 255;
@@ -56,7 +57,6 @@ collections {
                     visible: 0;
                     min: 700 100;
                     max: 800 100;
-                    fixed: 0 0 ;
                     align: 1.0 1.0;
                     rel1 { relative: 0.0 1.0; }
                     rel2 { relative: 1.0 1.0; }
@@ -76,6 +76,7 @@ collections {
                     visible: 0;
                     min: 50 50;
                     max: 50 50;
+                    fixed: 1 1;
                     align: 1.0 1.0;
                     rel1 { relative: 1.0 1.0; to: base; }
                     rel2 { relative: 1.0 1.0; to: base; }
index 20ed0a6..f0cc751 100755 (executable)
@@ -74,14 +74,15 @@ void WindowData::init()
     // import button theme
     elm_theme_overlay_add(NULL, THEME_EDJ_PATH);
 
-    m_platform_layout = createPlatformLayout(m_win);
+    m_conformant = createConformant(m_win);
+    evas_object_show(m_conformant);
+    m_platform_layout = createPlatformLayout(m_conformant);
     evas_object_show(m_platform_layout);
     m_navigation = createNavigationBar(m_platform_layout);
     evas_object_show(m_navigation);
     m_user_layout = createUserLayout(m_navigation);
     evas_object_show(m_user_layout);
-    m_conformant = createConformant(m_user_layout);
-    evas_object_show(m_conformant);
+
 }
 
 void WindowData::setEvasObjectForLayout(Evas_Object* evas_object)
@@ -97,19 +98,11 @@ void WindowData::unsetEvasObjectForLayout()
 void WindowData::toggleIndicator(bool indicator)
 {
     LogDebug(__PRETTY_FUNCTION__);
-    if (indicator) {
+    if (indicator)
         elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);
-        elm_layout_theme_set(m_platform_layout,
-                LAYOUT,
-                APPLICATION,
-                INDICATOR);
-    } else {
+    else
         elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_HIDE);
-        elm_layout_theme_set(m_platform_layout,
-                LAYOUT,
-                APPLICATION,
-                NOINDICATOR);
-    }
+
 }
 
 void WindowData::setViewMode(
@@ -392,24 +385,53 @@ Evas_Object* WindowData::createWindow(unsigned long pid)
     return window;
 }
 
+Evas_Object* WindowData::createConformant(Evas_Object* parent)
+{
+    Assert(parent != NULL && "Parent is null");
+    Evas_Object* conformant = elm_conformant_add(parent);
+
+    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);
+    elm_win_resize_object_add(parent, conformant);
+    return conformant;
+}
+
 Evas_Object* WindowData::createPlatformLayout(Evas_Object* parent)
 {
     Evas_Object*  platform_layout = elm_layout_add(parent);
 
-    if (!elm_layout_file_set(platform_layout, PLATFORM_EDJ_PATH, "platformlayout"))
-        elm_layout_theme_set(platform_layout, LAYOUT, APPLICATION, NOINDICATOR);
+    elm_layout_file_set(platform_layout, PLATFORM_EDJ_PATH, "platformlayout");
 
-    evas_object_size_hint_expand_set(platform_layout,
-                                     EVAS_HINT_EXPAND,
-                                     EVAS_HINT_EXPAND);
-
-    elm_win_resize_object_add(parent, platform_layout);
+    evas_object_size_hint_align_set(platform_layout,
+            EVAS_HINT_FILL,
+            EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(platform_layout,
+            EVAS_HINT_EXPAND,
+            EVAS_HINT_EXPAND);
 
+    elm_object_content_set(parent, platform_layout);
     edje_object_signal_emit(
             elm_layout_edje_get(platform_layout), ELM_STATE_SHOW_CONTENT, ELM);
     return platform_layout;
 }
 
+Evas_Object* WindowData::createNavigationBar(Evas_Object* parent)
+{
+    Assert(parent != NULL && "Parent for naviframe is null");
+    Evas_Object* navigation = elm_naviframe_add(parent);
+
+    evas_object_size_hint_align_set(navigation,
+            EVAS_HINT_FILL,
+            EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(navigation,
+            EVAS_HINT_EXPAND,
+            EVAS_HINT_EXPAND);
+    elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, navigation);
+    //elm_object_content_set(parent, navigation);
+    return navigation;
+}
+
 Evas_Object* WindowData::createUserLayout(Evas_Object* parent)
 {
     Assert(parent != NULL && "Parent for User Layout is null");
@@ -418,7 +440,6 @@ Evas_Object* WindowData::createUserLayout(Evas_Object* parent)
     evas_object_size_hint_weight_set(
             layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
     evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    elm_win_resize_object_add(parent, layout);
 
     Elm_Object_Item* naviIt = elm_naviframe_item_push(
         /* Evas_Object *obj */
@@ -439,27 +460,6 @@ Evas_Object* WindowData::createUserLayout(Evas_Object* parent)
     return layout;
 }
 
-Evas_Object* WindowData::createConformant(Evas_Object* parent)
-{
-    Assert(parent != NULL && "Parent is null");
-    Evas_Object* conformant = elm_conformant_add(parent);
-    elm_object_style_set(conformant, INTERNAL_LAYOUT);
-    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);
-    elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, conformant);
-    evas_object_show(conformant);
-    return conformant;
-}
-
-Evas_Object* WindowData::createNavigationBar(Evas_Object* parent)
-{
-    Assert(parent != NULL && "Parent for naviframe is null");
-    Evas_Object* navigation = elm_naviframe_add(parent);
-    elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, navigation);
-    return navigation;
-}
-
 void WindowData::showHiddenOption(Evas_Object* parent)
 {
     Assert(parent != NULL && "Parent for Hiden Option");
index 818b037..3ff22d0 100755 (executable)
@@ -75,7 +75,8 @@ class WindowData : private DPL::Noncopyable
 
   public:
     Evas_Object* m_win;
-    Evas_Object* m_conformant;
+    Evas_Object* m_user_layout;
+
     bool m_debugMode;
 
     struct CtxMenuItem
@@ -147,8 +148,8 @@ class WindowData : private DPL::Noncopyable
     void toggleFullscreen(bool fullscreen);
 
   protected:
+    Evas_Object* m_conformant;
     Evas_Object* m_platform_layout;
-    Evas_Object* m_user_layout;
     Evas_Object* m_navigation;
     Evas_Object* m_naviBackButton;
     Evas_Object* m_floatBackButton;
index 14f7d4d..c75a3b9 100644 (file)
@@ -38,6 +38,7 @@
 const char *EDJE_SHOW_BACKWARD_SIGNAL = "show,backward,signal";
 const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
 const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized";
+char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
 
 WrtClient::WrtClient(int argc, char **argv) :
     Application(argc, argv, "wrt-client", false),
@@ -666,7 +667,9 @@ void WrtClient::connectElmCallback()
 void WrtClient::setLayout(Evas_Object* newBuffer) {
     LogDebug("add new webkit buffer to window");
     Assert(newBuffer);
-    elm_object_content_set(m_windowData->m_conformant, newBuffer);
+
+    elm_object_part_content_set(m_windowData->m_user_layout, ELM_SWALLOW_CONTENT, newBuffer);
+
     evas_object_show(newBuffer);
     evas_object_focus_set(newBuffer, EINA_TRUE);
 }
@@ -675,7 +678,9 @@ void WrtClient::unsetLayout(Evas_Object* currentBuffer) {
     LogDebug("remove current webkit buffer from window");
     Assert(currentBuffer);
     evas_object_hide(currentBuffer);
-    elm_object_content_unset(m_windowData->m_conformant);
+
+    elm_object_part_content_unset(m_windowData->m_user_layout, ELM_SWALLOW_CONTENT);
+
 }
 
 void WrtClient::shutdownStep()