for(BubbleEntity *entity : m_BubbleEntityList)
{
BubbleViewItem *item = entity->createView(*bubble);
- bubble->append(*item, entity->getDirection());
- item->setListener(this);
+ if(item)
+ {
+ bubble->append(*item, entity->getDirection());
+ item->setListener(this);
+ }
}
bubble->go();
bubble->show();
void setIcon(Evas_Object *icon);
void setMainText(const std::string &text);
void setSubText(const std::string &text);
+ virtual void calculate();
static Evas_Object *createIcon(Evas_Object *parent, const std::string &edjFileName, BgType bgType);
Evas_Object *createIcon(const std::string &edjFileName) const;
#ifndef BubbleItemContainer_h_
#define BubbleItemContainer_h_
-#include "View.h"
+#include "BubbleViewItem.h"
#include "Message.h"
namespace Msg
BubbleItemContainer(Evas_Object *parent);
virtual ~BubbleItemContainer();
- void append(Evas_Object *item, Message::Direction direction);
+ void append(BubbleViewItem &item, Message::Direction direction);
void go();
};
}
BubbleViewItem(BubbleEntity &entity);
virtual ~BubbleViewItem();
+ virtual void calculate();
void setListener(IBubbleViewItemListener *l);
BubbleEntity &getEntity();
{
applyColor(obj, m_BgType);
}
-
}
m_pIconTextLayout = addLayout(getEo(), CONV_LIST_BUBBLE_EDJ_PATH, group);
- evas_object_smart_calculate(m_pIconTextLayout);
setContent(m_pIconTextLayout);
}
{
return m_LayoutType;
}
+
+void BubbleIconTextLayoutItem::calculate()
+{
+ evas_object_smart_calculate(m_pIconTextLayout);
+ BubbleBgViewItem::calculate();
+}
{
}
-void BubbleItemContainer::append(Evas_Object *item, Message::Direction direction)
+void BubbleItemContainer::append(BubbleViewItem &item, Message::Direction direction)
{
const char *itemType = evas_object_type_get(item);
if(strcmp(itemType, "elm_button") == 0)
else
evas_object_size_hint_align_set(item, 0.0, EVAS_HINT_FILL);
- evas_object_smart_calculate(item);
- evas_object_show(item);
+ item.calculate();
+ item.show();
elm_box_pack_end(getEo(), item);
}
if(m_pListener)
m_pListener->onAction(*this);
}
+
+void BubbleViewItem::calculate()
+{
+ evas_object_smart_calculate(getEo());
+}