HomeScreen: Adding a config to adjust background of menu window 04/24704/4
authorXiong Zhang <xiong.y.zhang@intel.com>
Fri, 18 Jul 2014 08:23:54 +0000 (16:23 +0800)
committerRyota Okubi <ryota.okubi@mail.toyota-td.jp>
Fri, 14 Nov 2014 08:09:52 +0000 (17:09 +0900)
Currently, the backgrund of menu window is a white transparent
rectangle. If some windows are in application layer, we could
see this app window from menu window. So the menu window
looks mess and seems something wrong in layer management.

This patch add a config to adjust the background of menu window.
If background set to picture, the menu window won't be
transparent, then APP windows won't be seen from menu window.
If background set to transparent, nothing will change.

Change-Id: I8ae049344ac2d87e0a27bb7b829d70b9b04faddf
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
res/org.tizen.ico.homescreen/res/config/homescreen.conf
src/homescreen/CicoHSMenuWindow.cpp
src/homescreen/CicoHSMenuWindow.h
src/homescreen/CicoHomeScreenCommon.h

index 2f5cfa7..6fd691c 100644 (file)
 #       StatusBar application id
 #   -- onscreen
 #       OnScreen application id
+#   -- background
+#       picture    : picture as background
+#       transparent: see under runing APP window
 #
 #---------------------------------------------------------------------------
 [homescreen]
 statusbar=org.tizen.ico.statusbar
 onscreen=org.tizen.ico.onscreen
+background=picture
 
 #---------------------------------------------------------------------------
 #   HomeScreen application log setting
index ed50c4d..62b1f7b 100644 (file)
@@ -39,6 +39,13 @@ int  CicoHSMenuWindow::menu_tile_height = 290;
 /*--------------------------------------------------------------------------*/
 CicoHSMenuWindow::CicoHSMenuWindow(void)
 {
+    CicoGKeyFileConfig config;
+    config.Initialize(ICO_HOMESCREEN_CONFIG_FILE);
+    const char *value = config.ConfigGetString("homescreen", "background", "picture");
+    transparent_background = false;
+    if (strcmp(value, "picture") != 0)
+        transparent_background = true;
+
     /*initialzie values*/
     terminate_mode = false;
 
@@ -94,21 +101,26 @@ CicoHSMenuWindow::SetMenuBack(void)
 {
     char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
     /* set menu back */
-    /* image file name*/
-    snprintf(img_path, sizeof(img_path), "%s%s",
-             img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND);
 
     /* set object*/
-    rectangle = evas_object_rectangle_add(evas);
-    if (true == CicoHSSystemState::getInstance()->getNightMode()) {
-        evas_object_color_set(rectangle,0,0,0,178);
-    }
-    else {
-        evas_object_color_set(rectangle,120,120,120,178);
-    }
-    evas_object_move(rectangle, 0, 0);
-    evas_object_resize(rectangle, width, height);
-    evas_object_show(rectangle);
+    if (transparent_background) {
+        /* image file name*/
+        snprintf(img_path, sizeof(img_path), "%s%s",
+                img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_BLANK);
+
+        rectangle = evas_object_rectangle_add(evas);
+        if (true == CicoHSSystemState::getInstance()->getNightMode()) {
+            evas_object_color_set(rectangle,0,0,0,178);
+        }
+        else {
+            evas_object_color_set(rectangle,120,120,120,178);
+        }
+        evas_object_move(rectangle, 0, 0);
+        evas_object_resize(rectangle, width, height);
+        evas_object_show(rectangle);
+    } else
+        snprintf(img_path, sizeof(img_path), "%s%s",
+                img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_PICTURE);
 
     /* set object*/
     canvas = evas_object_image_filled_add(evas);
@@ -147,7 +159,8 @@ void
 CicoHSMenuWindow::FreeMenuBack(void)
 {
     evas_object_del(canvas);
-    evas_object_del(rectangle);
+    if (transparent_background)
+        evas_object_del(rectangle);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1592,11 +1605,13 @@ void
 CicoHSMenuWindow::SetNightMode(void)
 {
     ICO_TRA("CicoHSMenuWindow::SetNightMode Enter");
-    if (true == CicoHSSystemState::getInstance()->getNightMode()) {
-        evas_object_color_set(rectangle,0,0,0,178);
-    }
-    else {
-        evas_object_color_set(rectangle,120,120,120,178);
+    if (transparent_background) {
+        if (true == CicoHSSystemState::getInstance()->getNightMode()) {
+            evas_object_color_set(rectangle,0,0,0,178);
+        }
+        else {
+            evas_object_color_set(rectangle,120,120,120,178);
+        }
     }
     ICO_TRA("CicoHSMenuWindow::SetNightMode Leave");
 }
index d96ebf4..ea96deb 100644 (file)
@@ -163,6 +163,7 @@ class CicoHSMenuWindow :public CicoHSWindow
     Evas *evas;
     /* menu back */
     Evas_Object *canvas;
+    bool transparent_background;
     Evas_Object *rectangle;
     /* tiles */
     CicoHSMenuTile *menu_tile[ICO_HS_MENU_MAX_TILE_NUM];
index aa0d8d2..53f2bf1 100644 (file)
@@ -70,7 +70,8 @@
 #define ICO_HS_BACK_WINDOW_IMAGE_FILE_PATH "/opt/usr/media/Images/Home_default.jpg"
 
 /*name of image file (in config image directry)*/
-#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND "bg.png"
+#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_BLANK "bg.png"
+#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_PICTURE "bg_bk.png"
 #define ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P "pagePointer_p.png"
 #define ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_N "pagePointer_n.png"