Luncher: Add config options to not show tooltips on mouse in

devs/bu5hm4n/sandbox_fix
Stephen Houston 5 years ago
parent 9581a48280
commit b19cceb224
  1. 6
      src/modules/luncher/bar.c
  2. 36
      src/modules/luncher/config.c
  3. 6
      src/modules/luncher/grid.c
  4. 1
      src/modules/luncher/luncher.h
  5. 2
      src/modules/luncher/mod.c

@ -466,7 +466,8 @@ _bar_icon_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *eve
elm_layout_signal_emit(ic->o_layout, "e,state,default", "e");
elm_layout_signal_emit(ic->o_layout, "e,state,unfocused", "e");
ic->active = EINA_FALSE;
elm_object_tooltip_hide(obj);
if (!ic->inst->cfg->hide_tooltips)
elm_object_tooltip_hide(obj);
E_FREE_FUNC(ic->mouse_in_timer, ecore_timer_del);
E_FREE_FUNC(ic->mouse_out_timer, ecore_timer_del);
ic->mouse_out_timer = ecore_timer_loop_add(0.25, _bar_icon_preview_hide, ic);
@ -920,7 +921,8 @@ _bar_icon_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *even
if (!ic->active)
{
elm_object_tooltip_show(obj);
if (!ic->inst->cfg->hide_tooltips)
elm_object_tooltip_show(obj);
ic->active = EINA_TRUE;
elm_layout_signal_emit(ic->o_layout, "e,state,focused", "e");
}

@ -49,6 +49,17 @@ _type_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
bar_config_updated(inst);
}
static void
_check_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Instance *inst = data;
inst->cfg->hide_tooltips = elm_check_state_get(obj);
e_config_save_queue();
bar_config_updated(inst);
}
static void
_config_source_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@ -277,7 +288,7 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
{
Evas_Object *popup, *tb, *lbl, *fr, *box, *list, *mlist;
Evas_Object *butbox, *sep, *hbox, *img, *but, *o, *group;
Evas_Object *slider;
Evas_Object *slider, *check;
Elm_Object_Item *it;
luncher_config->bar = bar;
@ -387,6 +398,29 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
elm_box_pack_end(box, o);
evas_object_show(o);
lbl = elm_label_add(box);
elm_object_text_set(lbl, _("Tooltips:"));
E_ALIGN(lbl, 0.5, 0.5);
E_WEIGHT(lbl, EVAS_HINT_EXPAND, 0);
elm_box_pack_end(box, lbl);
evas_object_show(lbl);
check = elm_check_add(box);
elm_object_text_set(check, _("Hide tooltips"));
elm_check_state_set(check, inst->cfg->hide_tooltips);
E_ALIGN(check, 0.0, 0.0);
E_WEIGHT(check, EVAS_HINT_EXPAND, 0);
evas_object_smart_callback_add(check, "changed", _check_changed, inst);
elm_box_pack_end(box, check);
evas_object_show(check);
o = elm_separator_add(box);
elm_separator_horizontal_set(o, EINA_TRUE);
E_EXPAND(o);
E_FILL(o);
elm_box_pack_end(box, o);
evas_object_show(o);
lbl = elm_label_add(box);
elm_object_text_set(lbl, _("Preview Size:"));
E_ALIGN(lbl, 0.5, 0.5);

@ -216,7 +216,8 @@ _grid_icon_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *eve
if (_grid_check_modifiers(ev->modifiers)) return;
evas_object_raise(ic->o_layout);
elm_object_tooltip_show(obj);
if (!ic->inst->cfg->hide_tooltips)
elm_object_tooltip_show(obj);
ic->active = EINA_TRUE;
elm_layout_signal_emit(ic->o_layout, "e,state,focused", "e");
}
@ -226,7 +227,8 @@ _grid_icon_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *ev
{
Icon *ic = data;
elm_object_tooltip_hide(obj);
if (!ic->inst->cfg->hide_tooltips)
elm_object_tooltip_hide(obj);
elm_layout_signal_emit(ic->o_layout, "e,state,unfocused", "e");
}

@ -40,6 +40,7 @@ struct _Config_Item
int id;
int version;
int preview_size;
int hide_tooltips;
Eina_Stringshare *dir;
Luncher_Type type;
};

@ -23,6 +23,7 @@ luncher_init(void)
E_CONFIG_VAL(D, T, preview_size, INT);
E_CONFIG_VAL(D, T, dir, STR);
E_CONFIG_VAL(D, T, type, INT);
E_CONFIG_VAL(D, T, hide_tooltips, INT);
conf_edd = E_CONFIG_DD_NEW("Luncher_Config", Config);
#undef T
@ -42,6 +43,7 @@ luncher_init(void)
ci->preview_size = 64;
ci->dir = eina_stringshare_add("default");
ci->type = E_LUNCHER_MODULE_FULL;
ci->hide_tooltips = 0;
luncher_config->items = eina_list_append(luncher_config->items, ci);
}
EINA_LIST_FOREACH(luncher_config->items, l, ci)

Loading…
Cancel
Save