TizenRefApp-7200 Update log type icon in the Log Details View according to GUI 69/88369/4
authorNataliia Sydorchuk <n.sydorchuk@samsung.com>
Mon, 19 Sep 2016 08:26:11 +0000 (11:26 +0300)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 21 Sep 2016 12:17:31 +0000 (05:17 -0700)
Change-Id: I78c73f803dc129ffaffed757b46315913d31cd2b
Signed-off-by: Nataliia Sydorchuk <n.sydorchuk@samsung.com>
lib-logs/res/details/edje/LogsDetailsItemLayout.h
lib-logs/res/details/edje/LogsDetailsItemLayoutMetrics.h [deleted file]
lib-logs/res/details/edje/logs-details-item-layout.edc
lib-logs/src/Logs/Details/ActionItem.cpp
lib-logs/src/Logs/Details/BasicInfoItem.cpp
lib-logs/src/Logs/Details/LogDetailItem.cpp

index 58cd51a..bf8224c 100644 (file)
 #define STATE_SAVED                      "state_saved"
 #define PART_UNSAVED_BTNS                "swallow.unsaved_btns"
 
-#define COLOR_UNSAVED_BUTTON_NORMAL       0, 0, 0, 40
+#define LAYOUT_ICON_CALL                 "icon_call"
+#define LAYOUT_ICON_MESSAGE              "icon_message"
 
-#define GROUP_ICON_CALL                  "icon_call"
-#define GROUP_ICON_MESSAGE               "icon_message"
+#define LAYOUT_LOG_TYPE                  "log_type"
+#define PART_LOG_TYPE                    "swallow.log_type"
+
+#define COLOR_UNSAVED_BUTTON_NORMAL      0, 0, 0, 40
+#define UNSAVED_BTN_PAD_BETWEEN          16
 
 #endif /* LOGS_DETAILS_ITEM_LAYOUT_H */
diff --git a/lib-logs/res/details/edje/LogsDetailsItemLayoutMetrics.h b/lib-logs/res/details/edje/LogsDetailsItemLayoutMetrics.h
deleted file mode 100644 (file)
index 9d64ebb..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef LOGS_DETAILS_ITEM_LAYOUT_METRICS_H
-#define LOGS_DETAILS_ITEM_LAYOUT_METRICS_H
-
-#define UNSAVED_BTN_PAD_T 46
-#define UNSAVED_BTN_PAD_BETWEEN 16
-#define UNSAVED_BTN_PAD_B 30
-
-#define UNSAVED_BTN_H 78
-
-#endif /* LOGS_DETAILS_ITEM_LAYOUT_METRICS_H */
index ff6ae98..db2106d 100644 (file)
  */
 
 #include "LogsDetailsItemLayout.h"
-#include "LogsDetailsItemLayoutMetrics.h"
 
 #include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
 #include "../../../../lib-common/res/details/edje/details-item-layout.edc"
 
+#define UNSAVED_BTN_H 78
+#define UNSAVED_BTN_T 46
+#define UNSAVED_BTN_B 30
+
+#define LOG_TYPE_WH 45
+#define LOG_TYPE_T 6
+
 collections
 {
        base_scale: 2.6;
 
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_CALL, DETAILS_ICON_CALL,
+       IMAGE_WITH_COLOR_AND_TOUCH(LAYOUT_ICON_CALL, DETAILS_ICON_CALL,
                        "touch_icon_normal", "touch_icon_pressed");
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_MESSAGE, DETAILS_ICON_MESSAGE,
+       IMAGE_WITH_COLOR_AND_TOUCH(LAYOUT_ICON_MESSAGE, DETAILS_ICON_MESSAGE,
                        "touch_icon_normal", "touch_icon_pressed");
 
        group {
@@ -43,7 +49,7 @@ collections
                parts {
                        spacer { "spacer.unsaved.top"; scale;
                                desc { "default";
-                                       min: 0 UNSAVED_BTN_PAD_T;
+                                       min: 0 UNSAVED_BTN_T;
                                        align: 0.5 0.0;
                                        rel1 { relative: 0.0 1.0; to_y: PART_THUMBNAIL; }
                                        rel2 { relative: 1.0 1.0; to_y: PART_THUMBNAIL; }
@@ -63,7 +69,7 @@ collections
                        }
                        spacer { "spacer.unsaved.bottom"; scale;
                                desc { "default";
-                                       min: 0 UNSAVED_BTN_PAD_B;
+                                       min: 0 UNSAVED_BTN_B;
                                        align: 0.5 0.0;
                                        rel1 { relative: 0.0 1.0; to_y: PART_UNSAVED_BTNS; }
                                        rel2 { relative: 1.0 1.0; }
@@ -85,4 +91,25 @@ collections
                        }
                }
        }
+
+       group { LAYOUT_LOG_TYPE;
+               parts {
+                       spacer { "spacer.log_type.top"; scale;
+                               desc { "default";
+                                       align: 0.5 0.0;
+                                       min: 0.0 LOG_TYPE_T;
+                                       rel1.relative: 0.0 0.0;
+                                       rel2.relative: 1.0 0.0;
+                               }
+                       }
+                       swallow { PART_LOG_TYPE; scale;
+                               desc { "default";
+                                       align: 0.5 0.0;
+                                       min: LOG_TYPE_WH LOG_TYPE_WH;
+                                       rel1 { relative: 0.5 1.0; to_y: "spacer.log_type.top"; }
+                                       rel2 { relative: 0.5 1.0; to_y: "spacer.log_type.top"; }
+                               }
+                       }
+               }
+       }
 }
index fbcb694..74440b8 100644 (file)
@@ -163,8 +163,8 @@ Evas_Object *ActionItem::createActionButton(Evas_Object *parent, ActionType acti
 {
        static const int imageSize = Ui::getScaledValue(ACTION_BTN_WH);
        static const char *actionIcons[] = {
-               /* ActionCall = */ GROUP_ICON_CALL,
-               /* ActionMessage = */ GROUP_ICON_MESSAGE
+               /* ActionCall    = */ LAYOUT_ICON_CALL,
+               /* ActionMessage = */ LAYOUT_ICON_MESSAGE
        };
 
        Evas_Object *image = elm_image_add(parent);
index b62490c..441a453 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "AppsCommonButtons.h"
 #include "LogsDetailsItemLayout.h"
-#include "LogsDetailsItemLayoutMetrics.h"
 
 #include <app_i18n.h>
 
index 7fb23e8..f0342fc 100644 (file)
@@ -18,6 +18,7 @@
 #include "Logs/Details/LogDetailItem.h"
 #include "Logs/Model/Log.h"
 #include "Logs/Common/Utils.h"
+#include "LogsDetailsItemLayout.h"
 #include "LogItemLayout.h"
 #include "LogPath.h"
 
@@ -26,7 +27,6 @@
 
 #include <app_i18n.h>
 #define BUFFER_SIZE             64
-#define LOG_TYPE_SIZE           45
 
 #define PART_LOG_TYPE_TEXT      "elm.text.sub"
 #define PART_LOG_TYPE_ICON      "elm.swallow.icon"
@@ -40,6 +40,7 @@ using namespace Logs::Common;
 namespace
 {
        const std::string layoutPath = App::getResourcePath(LOG_ITEM_LAYOUT_EDJ);
+       const std::string detailsLayoutPath = App::getResourcePath(LOGS_DETAILS_ITEM_LAYOUT_EDJ);
 }
 
 LogDetailItem::LogDetailItem(Log *log)
@@ -86,12 +87,14 @@ Ux::SelectResult LogDetailItem::getDefaultResult() const
 
 Evas_Object *LogDetailItem::createIcon(Evas_Object *parent, const char *path)
 {
+       Evas_Object *layout = elm_layout_add(parent);
+       elm_layout_file_set(layout, detailsLayoutPath.c_str(), LAYOUT_LOG_TYPE);
+
        Evas_Object *icon = elm_image_add(parent);
        elm_image_file_set(icon, layoutPath.c_str(), path);
+       elm_layout_content_set(layout, PART_LOG_TYPE, icon);
 
-       static int size = getScaledValue(LOG_TYPE_SIZE);
-       evas_object_size_hint_min_set(icon, size, size);
-       return icon;
+       return layout;
 }
 
 const char *LogDetailItem::getImagePath(int type)