TizenRefApp-6667 Only 4 items can be added to 4x3 contact widget 44/80044/1 submit/tizen/20160714.172209
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Thu, 14 Jul 2016 07:40:57 +0000 (10:40 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Thu, 14 Jul 2016 07:40:57 +0000 (10:40 +0300)
Change-Id: I68109c1721a0e16e140ee6c7e19055ecc4372a6e
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com
contacts-widget/src/Widget.cpp

index ee6159d..3f9f7b4 100644 (file)
@@ -73,9 +73,11 @@ void Widget::onDestroy(widget_app_destroy_type reason)
 
 void Widget::onResize(int width, int height)
 {
-       bool isLarge = (getType() == WIDGET_SIZE_TYPE_4x4);
-       m_MaxCount = GRID_COLS * (isLarge ? LARGE_GRID_ROWS : SMALL_GRID_ROWS);
-
+       /* FIXME: onResize() called twice with non-standard size (720x720) on the second time */
+       if (!m_MaxCount) {
+               bool isLarge = (getType() == WIDGET_SIZE_TYPE_4x4);
+               m_MaxCount = GRID_COLS * (isLarge ? LARGE_GRID_ROWS : SMALL_GRID_ROWS);
+       }
        if (m_Gengrid) {
                elm_gengrid_item_size_set(m_Gengrid->getEvasObject(), getWidth() / GRID_COLS, Ui::getScaledValue(ITEM_H));
        }