netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=ed7fd738ba052268060593cbe7ca1a153df6e47d

commit ed7fd738ba052268060593cbe7ca1a153df6e47d
Author: Alastair Poole <nets...@gmail.com>
Date:   Sun Jan 24 18:16:26 2021 +0000

    sensors: no_icon style.
    
    Thanks for feedback.
---
 src/bin/ui/ui_sensors.c | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

diff --git a/src/bin/ui/ui_sensors.c b/src/bin/ui/ui_sensors.c
index 4abe747..433db99 100644
--- a/src/bin/ui/ui_sensors.c
+++ b/src/bin/ui/ui_sensors.c
@@ -173,32 +173,19 @@ _genlist_item_pressed_cb(void *data, Evas_Object *obj, 
void *event_info)
    elm_object_text_set(obj, buf);
 }
 
-static Evas_Object *
-_content_get(void *data, Evas_Object *obj, const char *part)
+static char *
+_text_get(void *data, Evas_Object *obj, const char *part)
 {
-   Evas_Object *bx, *lb;
    sensor_t *s;
    char buf[64];
 
-   if (strcmp(part, "elm.swallow.content")) return NULL;
+   if (strcmp(part, "elm.text")) return NULL;
 
    s = data;
 
-   bx = elm_box_add(obj);
-   evas_object_size_hint_weight_set(bx, EXPAND, EXPAND);
-   evas_object_size_hint_align_set(bx, FILL, FILL);
-   evas_object_show(bx);
-
-   lb = elm_label_add(obj);
-   evas_object_size_hint_weight_set(lb, EXPAND, EXPAND);
-   evas_object_size_hint_align_set(lb, 0.0, FILL);
    _name_set(buf, sizeof(buf), s);
-   elm_object_text_set(lb, buf);
-   evas_object_show(lb);
-
-   elm_box_pack_end(bx, lb);
 
-   return bx;
+   return strdup(buf);
 }
 
 static void
@@ -375,9 +362,9 @@ ui_sensors_win_add(Ui *ui)
    elm_box_pack_end(content, fr);
 
    pd->itc = elm_genlist_item_class_new();
-   pd->itc->item_style = "full";
-   pd->itc->func.content_get = _content_get;
-   pd->itc->func.text_get = NULL;
+   pd->itc->item_style = "no_icon";
+   pd->itc->func.content_get = NULL;
+   pd->itc->func.text_get = _text_get;
    pd->itc->func.filter_get = NULL;
    pd->itc->func.del = _item_del;
 

-- 


Reply via email to