discomfitor pushed a commit to branch master.

http://git.enlightenment.org/apps/empc.git/commit/?id=b67527dbe604e87bac76adbc2ea8908c265b7c05

commit b67527dbe604e87bac76adbc2ea8908c265b7c05
Author: zmike <[email protected]>
Date:   Wed Dec 24 23:51:17 2014 -0500

    fix tooltip creation for player view
---
 src/bin/empc.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/src/bin/empc.c b/src/bin/empc.c
index 643c326..4c9653f 100644
--- a/src/bin/empc.c
+++ b/src/bin/empc.c
@@ -407,23 +407,31 @@ tooltip_create(Evas_Object *tooltip, Elm_Object_Item 
*item)
    Evas_Object *o, *copy, *ly;
    const Eina_File *f;
    Eina_Stringshare *file, *key;
-   Empd_Empdd_Song *so, *soi;
+   Empd_Empdd_Song *so;
    char buf[1024];
    const char *infos;
    Eina_Bool playing;
 
    it = elm_genlist_item_parent_get(item);
    if (!it) it = item;
-   so = elm_object_item_data_get(it);
-   soi = elm_object_item_data_get(item);
+   so = elm_object_item_data_get(item);
 
-   o = elm_object_item_part_content_get(it, EMPC_SWALLOW_ALBUM);
-   if (o)
+   if (item == empd_song_item)
+     {
+        o = bgselector_get(bg[background_num]);
+        if (o)
+          o = elm_image_object_get(o);
+     }
+   else
      {
-        if (!strcmp(evas_object_type_get(o), "Evas_Object_Box"))
-          o = eina_list_data_get(evas_object_box_children_get(o));
+        o = elm_object_item_part_content_get(it, EMPC_SWALLOW_ALBUM);
         if (o)
-          o = evas_object_data_get(o, "__empc_image");
+          {
+             if (!strcmp(evas_object_type_get(o), "Evas_Object_Box"))
+               o = eina_list_data_get(evas_object_box_children_get(o));
+             if (o)
+               o = evas_object_data_get(o, "__empc_image");
+          }
      }
    ly = elm_layout_add(tooltip);
    elm_layout_theme_set(ly, "layout", "empc", "tooltip");
@@ -487,7 +495,8 @@ tooltip_create(Evas_Object *tooltip, Elm_Object_Item *item)
              else if (eina_streq(itemname, "time"))
                {
                   elm_object_text_set(name, "Time:");
-                  elm_object_text_set(value, elm_object_item_part_text_get(it, 
EMPC_TEXT_TIME));
+                  snprintf(buf, sizeof(buf), "%.2ld:%.2ld", so->duration / 60, 
so->duration % 60);
+                  elm_object_text_set(value, buf);
                }
              else if (eina_streq(itemname, "track"))
                {
@@ -500,14 +509,14 @@ tooltip_create(Evas_Object *tooltip, Elm_Object_Item 
*item)
                   else
                     {
                        elm_object_text_set(name, "Track:");
-                       snprintf(buf, sizeof(buf), "%d/%u", soi->track, 
elm_genlist_item_subitems_count(it));
+                       snprintf(buf, sizeof(buf), "%d/%u", so->track, 
elm_genlist_item_subitems_count(it));
                     }
                   elm_object_text_set(value, buf);
                }
              else if (eina_streq(itemname, "index"))
                {
                   elm_object_text_set(name, "Index:");
-                  snprintf(buf, sizeof(buf), "%d", soi->song_pos);
+                  snprintf(buf, sizeof(buf), "%d", so->song_pos);
                   elm_object_text_set(value, buf);
                }
              if (playing)

-- 


Reply via email to