From bd3749aa61d79c5e354bbbed27e943906849a6a3 Mon Sep 17 00:00:00 2001 From: Eugene Kurzberg Date: Fri, 30 Dec 2016 09:42:11 +0200 Subject: [PATCH] Change color of "Select All" text according to GUI. Change-Id: Id7b3d0d91a6c331b9b7af551eefba8289574f971 Signed-off-by: Eugene Kurzberg --- lib-apps-common/inc/Ux/SelectAllItem.h | 10 ++++++++++ lib-apps-common/src/Ux/SelectAllItem.cpp | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lib-apps-common/inc/Ux/SelectAllItem.h b/lib-apps-common/inc/Ux/SelectAllItem.h index 4520ae2..91ca06f 100644 --- a/lib-apps-common/inc/Ux/SelectAllItem.h +++ b/lib-apps-common/inc/Ux/SelectAllItem.h @@ -35,6 +35,11 @@ namespace Ux protected: /** + * @see GenItem::getItemClass() + */ + virtual Elm_Gen_Item_Class *getItemClass() const override; + + /** * @see GenItem::getText() */ virtual char *getText(Evas_Object *parent, const char *part) override; @@ -44,6 +49,11 @@ namespace Ux */ virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override; + /** + * @see GenItem::onInserted() + */ + virtual void onInserted() override; + private: std::string m_Text; }; diff --git a/lib-apps-common/src/Ux/SelectAllItem.cpp b/lib-apps-common/src/Ux/SelectAllItem.cpp index 441b833..dac3a3a 100644 --- a/lib-apps-common/src/Ux/SelectAllItem.cpp +++ b/lib-apps-common/src/Ux/SelectAllItem.cpp @@ -17,6 +17,8 @@ #include "Ux/SelectAllItem.h" #include +#define TEXT_COLOR 61, 185, 204, 255 + using namespace Ux; SelectAllItem::SelectAllItem(const char *text) @@ -26,6 +28,12 @@ SelectAllItem::SelectAllItem(const char *text) } } +Elm_Gen_Item_Class *SelectAllItem::getItemClass() const +{ + static Elm_Gen_Item_Class itc = createItemClass("end_icon"); + return &itc; +} + char *SelectAllItem::getText(Evas_Object *parent, const char *part) { if (strcmp(part, "elm.text") == 0) { @@ -43,3 +51,9 @@ Evas_Object *SelectAllItem::getContent(Evas_Object *parent, const char *part) return nullptr; } + +void SelectAllItem::onInserted() +{ + elm_object_item_color_class_color_set(getObjectItem(), "text", TEXT_COLOR); + elm_object_item_color_class_color_set(getObjectItem(), "text_pressed", TEXT_COLOR); +} -- 2.7.4