forked from enlightenment/evisum
ui: remmember in memory position too
This commit is contained in:
parent
16330fd4e0
commit
25336bff1b
|
@ -344,6 +344,21 @@ _core_times_feedback_cb(void *data, Ecore_Thread *thread EINA_UNUSED, void *msgd
|
|||
free(cores);
|
||||
}
|
||||
|
||||
static void
|
||||
_win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Animate *ad;
|
||||
Ui *ui;
|
||||
Evas_Coord x = 0, y = 0;
|
||||
|
||||
ad = data;
|
||||
ui = ad->ui;
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||
ui->cpu.x = x;
|
||||
ui->cpu.y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
_win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -352,6 +367,7 @@ _win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
|
|||
Ui *ui = ad->ui;
|
||||
|
||||
evisum_ui_config_save(ui);
|
||||
|
||||
ecore_thread_cancel(ad->thread);
|
||||
ecore_thread_wait(ad->thread, 0.5);
|
||||
|
||||
|
@ -694,6 +710,7 @@ _graph(Ui *ui, Evas_Object *parent)
|
|||
(obj, 100, (BAR_HEIGHT * ad->cpu_count) * elm_config_scale_get());
|
||||
|
||||
evas_object_event_callback_add(ui->cpu.win, EVAS_CALLBACK_DEL, _win_del_cb, ad);
|
||||
evas_object_event_callback_add(ui->cpu.win, EVAS_CALLBACK_MOVE, _win_move_cb, ad);
|
||||
|
||||
// run a feedback thread that sends feedback to the mainloop
|
||||
ad->thread = ecore_thread_feedback_run(_core_times_main_cb,
|
||||
|
|
|
@ -306,6 +306,21 @@ _win_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
evas_object_del(pd->ui->disk.win);
|
||||
}
|
||||
|
||||
static void
|
||||
_win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ui_Data *pd;
|
||||
Ui *ui;
|
||||
Evas_Coord x = 0, y = 0;
|
||||
|
||||
pd = data;
|
||||
ui = pd->ui;
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||
ui->disk.x = x;
|
||||
ui->disk.y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
_win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
|
@ -683,6 +698,7 @@ ui_win_disk_add(Ui *ui, Evas_Object *parent)
|
|||
}
|
||||
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_MOVE, _win_move_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, pd);
|
||||
evas_object_event_callback_add(tbl, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, pd);
|
||||
evas_object_show(win);
|
||||
|
|
|
@ -364,6 +364,21 @@ _win_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
evas_object_del(pd->win);
|
||||
}
|
||||
|
||||
static void
|
||||
_win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ui_Data *pd;
|
||||
Ui *ui;
|
||||
Evas_Coord x = 0, y = 0;
|
||||
|
||||
pd = data;
|
||||
ui = pd->ui;
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||
ui->mem.x = x;
|
||||
ui->mem.y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
_win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
|
@ -527,6 +542,7 @@ ui_win_memory_add(Ui *ui, Evas_Object *parent)
|
|||
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_MOVE, _win_move_cb, pd);
|
||||
evas_object_event_callback_add(tbl, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, pd);
|
||||
evas_object_show(win);
|
||||
|
||||
|
|
|
@ -1525,6 +1525,21 @@ _evisum_config_changed_cb(void *data, int type EINA_UNUSED, void *event EINA_UNU
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ui_Data *pd;
|
||||
Ui *ui;
|
||||
Evas_Coord x = 0, y = 0;
|
||||
|
||||
pd = data;
|
||||
ui = pd->ui;
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||
ui->proc.x = x;
|
||||
ui->proc.y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
_win_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
|
@ -1614,6 +1629,8 @@ ui_process_list_win_add(Ui *ui, Evas_Object *parent EINA_UNUSED)
|
|||
_win_del_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE,
|
||||
_win_resize_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_MOVE,
|
||||
_win_move_cb, pd);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
|
||||
_win_key_down_cb, pd);
|
||||
evas_object_show(win);
|
||||
|
|
|
@ -216,6 +216,21 @@ _win_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
evas_object_del(pd->ui->sensors.win);
|
||||
}
|
||||
|
||||
static void
|
||||
_win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ui_Data *pd;
|
||||
Ui *ui;
|
||||
Evas_Coord x = 0, y = 0;
|
||||
|
||||
pd = data;
|
||||
ui = pd->ui;
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||
ui->sensors.x = x;
|
||||
ui->sensors.y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
_win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
|
@ -270,9 +285,9 @@ ui_win_sensors_add(Ui *ui, Evas_Object *parent)
|
|||
evas_object_size_hint_align_set(win, FILL, FILL);
|
||||
evisum_ui_background_random_add(win,
|
||||
evisum_ui_backgrounds_enabled_get());
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE,
|
||||
_win_resize_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_MOVE, _win_move_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, pd);
|
||||
evas_object_event_callback_add(win, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, pd);
|
||||
|
||||
fr = elm_frame_add(win);
|
||||
|
|
Loading…
Reference in New Issue