startup: See how this behaves

edi-0.5
Alastair Poole 2 years ago
parent efa7f4b083
commit b9cb1dfa49
  1. 28
      src/bin/ui/ui.c
  2. 1
      src/bin/ui/ui.h

@ -374,6 +374,15 @@ _item_create(Evas_Object *parent)
return table;
}
static void
_item_show_hide(Evas_Object *obj, Eina_Bool show)
{
if (show)
evas_object_show(obj);
else
evas_object_hide(obj);
}
static Evas_Object *
_content_get(void *data, Evas_Object *obj, const char *source)
{
@ -404,6 +413,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_pid, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
evas_object_geometry_get(ui->btn_uid, NULL, NULL, &w, NULL);
l = evas_object_data_get(it->obj, "proc_uid");
@ -416,6 +426,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_uid, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
evas_object_geometry_get(ui->btn_size, NULL, NULL, &w, NULL);
l = evas_object_data_get(it->obj, "proc_size");
@ -424,6 +435,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_size, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
evas_object_geometry_get(ui->btn_rss, NULL, NULL, &w, NULL);
l = evas_object_data_get(it->obj, "proc_rss");
@ -432,6 +444,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_rss, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
evas_object_geometry_get(ui->btn_cmd, NULL, NULL, &w, NULL);
l = evas_object_data_get(it->obj, "proc_cmd");
@ -440,6 +453,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_cmd, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
evas_object_geometry_get(ui->btn_state, NULL, NULL, &w, NULL);
l = evas_object_data_get(it->obj, "proc_state");
@ -448,6 +462,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_state, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
evas_object_geometry_get(ui->btn_cpu_usage, NULL, NULL, &w, NULL);
l = evas_object_data_get(it->obj, "proc_cpu_usage");
@ -456,6 +471,7 @@ _content_get(void *data, Evas_Object *obj, const char *source)
if (ow > w) evas_object_size_hint_min_set(ui->btn_cpu_usage, w, 1);
r = evas_object_data_get(l, "rect");
evas_object_size_hint_min_set(r, w, 1);
_item_show_hide(l, ui->show_genlist);
return it->obj;
}
@ -495,6 +511,16 @@ _genlist_ensure_n_items(Evas_Object *genlist, unsigned int items)
elm_genlist_item_class_free(itc);
}
static Eina_Bool
_show_items(void *data)
{
Ui *ui = data;
ui->show_genlist = EINA_TRUE;
elm_genlist_realized_items_update(ui->genlist_procs);
return EINA_FALSE;
}
static Eina_Bool
_bring_in(void *data)
{
@ -506,6 +532,8 @@ _bring_in(void *data)
elm_scroller_last_page_get(ui->scroller, &h_page, &v_page);
elm_scroller_page_bring_in(ui->scroller, h_page, v_page);
ecore_timer_add(0.5, _show_items, ui);
return EINA_FALSE;
}

@ -61,6 +61,7 @@ typedef struct Ui
Evisum_Ui_Cache *cache;
Evas_Object *genlist_procs;
Evas_Object *entry_search;
Eina_Bool show_genlist;
Ecore_Thread *thread_system;
Ecore_Thread *thread_process;

Loading…
Cancel
Save