When the separators exist in toolbar and the toolbar shrinks by resizing window,
authorjaehwan <jaehwan@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 15 May 2012 06:30:17 +0000 (06:30 +0000)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Fri, 29 Jun 2012 06:13:15 +0000 (15:13 +0900)
sometimes the only separators are shown even though the items are hidden.
So the separator's visibility is desided by it's previous item.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@71093 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_toolbar.c

index 7293bd1..4a56248 100644 (file)
@@ -580,7 +580,7 @@ _toolbar_item_prio_compare_cb(const void *i1, const void *i2)
 static void
 _fix_items_visibility(Widget_Data *wd, Evas_Coord *iw, Evas_Coord vw)
 {
-   Elm_Toolbar_Item *it;
+   Elm_Toolbar_Item *it, *prev;
    Eina_List *sorted = NULL;
    Evas_Coord ciw = 0, cih = 0;
 
@@ -601,7 +601,13 @@ _fix_items_visibility(Widget_Data *wd, Evas_Coord *iw, Evas_Coord vw)
         evas_object_geometry_get(VIEW(it), NULL, NULL, &ciw, &cih);
         if (wd->vertical) *iw += cih;
         else              *iw += ciw;
-        it->prio.visible = (*iw <= vw);
+        if (!it->separator)
+          it->prio.visible = (*iw <= vw);
+        else
+          {
+             prev = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
+             it->prio.visible = prev->prio.visible;
+          }
      }
 }