Luncher: Allow the size of previews to be configurable.
This commit is contained in:
parent
7ff0e585ac
commit
16c05faabd
|
@ -602,7 +602,7 @@ _bar_icon_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS
|
||||||
|
|
||||||
popup = elm_ctxpopup_add(e_comp->elm);
|
popup = elm_ctxpopup_add(e_comp->elm);
|
||||||
elm_object_style_set(popup, "noblock");
|
elm_object_style_set(popup, "noblock");
|
||||||
evas_object_smart_callback_add(popup, "dismissed", _bar_popup_dismissed, NULL);
|
evas_object_smart_callback_add(popup, "dismissed", _bar_popup_dismissed, ic);
|
||||||
evas_object_size_hint_min_set(popup, ic->inst->size, ic->inst->size);
|
evas_object_size_hint_min_set(popup, ic->inst->size, ic->inst->size);
|
||||||
|
|
||||||
box = elm_box_add(popup);
|
box = elm_box_add(popup);
|
||||||
|
@ -811,6 +811,7 @@ static void
|
||||||
_bar_icon_preview_client_add(Icon *ic, E_Client *ec)
|
_bar_icon_preview_client_add(Icon *ic, E_Client *ec)
|
||||||
{
|
{
|
||||||
Evas_Object *layout, *label, *img;
|
Evas_Object *layout, *label, *img;
|
||||||
|
Edje_Message_Int_Set *msg;
|
||||||
|
|
||||||
layout = elm_layout_add(ic->preview_box);
|
layout = elm_layout_add(ic->preview_box);
|
||||||
evas_object_data_set(layout, "icon", ic);
|
evas_object_data_set(layout, "icon", ic);
|
||||||
|
@ -824,6 +825,11 @@ _bar_icon_preview_client_add(Icon *ic, E_Client *ec)
|
||||||
elm_box_pack_end(ic->preview_box, layout);
|
elm_box_pack_end(ic->preview_box, layout);
|
||||||
evas_object_show(layout);
|
evas_object_show(layout);
|
||||||
|
|
||||||
|
msg = alloca(sizeof(Edje_Message_Int_Set) + (sizeof(int)));
|
||||||
|
msg->count = 1;
|
||||||
|
msg->val[0] = ic->inst->cfg->preview_size;
|
||||||
|
edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_INT_SET, 1, msg);
|
||||||
|
|
||||||
label = elm_label_add(layout);
|
label = elm_label_add(layout);
|
||||||
elm_object_style_set(label, "luncher_preview");
|
elm_object_style_set(label, "luncher_preview");
|
||||||
elm_label_ellipsis_set(label, EINA_TRUE);
|
elm_label_ellipsis_set(label, EINA_TRUE);
|
||||||
|
@ -900,12 +906,15 @@ _bar_icon_preview_show(void *data)
|
||||||
{
|
{
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
elm_box_horizontal_set(ic->preview_box, EINA_TRUE);
|
elm_box_horizontal_set(ic->preview_box, EINA_TRUE);
|
||||||
break;
|
elm_box_padding_set(ic->preview_box, 2, 0);
|
||||||
|
break;
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
elm_box_horizontal_set(ic->preview_box, EINA_FALSE);
|
elm_box_horizontal_set(ic->preview_box, EINA_FALSE);
|
||||||
break;
|
elm_box_padding_set(ic->preview_box, 0, 2);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
elm_box_horizontal_set(ic->preview_box, EINA_TRUE);
|
elm_box_horizontal_set(ic->preview_box, EINA_TRUE);
|
||||||
|
elm_box_padding_set(ic->preview_box, 2, 0);
|
||||||
}
|
}
|
||||||
EINA_LIST_FOREACH(ic->execs, l, ex)
|
EINA_LIST_FOREACH(ic->execs, l, ex)
|
||||||
{
|
{
|
||||||
|
@ -2030,6 +2039,7 @@ _conf_item_get(int *id)
|
||||||
ci->id = eina_list_count(luncher_config->items)+1;
|
ci->id = eina_list_count(luncher_config->items)+1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
ci->preview_size = 64;
|
||||||
ci->dir = eina_stringshare_add("default");
|
ci->dir = eina_stringshare_add("default");
|
||||||
ci->style = eina_stringshare_add("default");
|
ci->style = eina_stringshare_add("default");
|
||||||
ci->type = E_LUNCHER_MODULE_FULL;
|
ci->type = E_LUNCHER_MODULE_FULL;
|
||||||
|
@ -2132,6 +2142,10 @@ bar_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNUSED
|
||||||
inst->main_del = EINA_FALSE;
|
inst->main_del = EINA_FALSE;
|
||||||
inst->icons_desktop_hash = eina_hash_string_superfast_new(NULL);
|
inst->icons_desktop_hash = eina_hash_string_superfast_new(NULL);
|
||||||
inst->icons_clients_hash = eina_hash_pointer_new(NULL);
|
inst->icons_clients_hash = eina_hash_pointer_new(NULL);
|
||||||
|
|
||||||
|
if (!inst->cfg->preview_size)
|
||||||
|
inst->cfg->preview_size = 64;
|
||||||
|
|
||||||
inst->o_main = elm_layout_add(parent);
|
inst->o_main = elm_layout_add(parent);
|
||||||
e_theme_edje_object_set(inst->o_main, "e/gadget/luncher/bar",
|
e_theme_edje_object_set(inst->o_main, "e/gadget/luncher/bar",
|
||||||
"e/gadget/luncher/bar");
|
"e/gadget/luncher/bar");
|
||||||
|
|
|
@ -315,11 +315,22 @@ _icon_theme_file_set(Evas_Object *img, const char *icon)
|
||||||
elm_image_file_set(img, path, k);
|
elm_image_file_set(img, path, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_update_preview_size(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Instance *inst = data;
|
||||||
|
int value = elm_slider_value_get(obj);
|
||||||
|
|
||||||
|
inst->cfg->preview_size = value;
|
||||||
|
e_config_save_queue();
|
||||||
|
}
|
||||||
|
|
||||||
EINTERN Evas_Object *
|
EINTERN Evas_Object *
|
||||||
config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
||||||
{
|
{
|
||||||
Evas_Object *popup, *tb, *lbl, *fr, *box, *list, *mlist;
|
Evas_Object *popup, *tb, *lbl, *fr, *box, *list, *mlist;
|
||||||
Evas_Object *butbox, *sep, *hbox, *img, *but, *o, *group;
|
Evas_Object *butbox, *sep, *hbox, *img, *but, *o, *group;
|
||||||
|
Evas_Object *slider;
|
||||||
Elm_Object_Item *it;
|
Elm_Object_Item *it;
|
||||||
|
|
||||||
luncher_config->bar = bar;
|
luncher_config->bar = bar;
|
||||||
|
@ -374,7 +385,7 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
||||||
|
|
||||||
lbl = elm_label_add(box);
|
lbl = elm_label_add(box);
|
||||||
elm_object_text_set(lbl, _("Luncher Type:"));
|
elm_object_text_set(lbl, _("Luncher Type:"));
|
||||||
E_ALIGN(lbl, 0.0, 0.0);
|
E_ALIGN(lbl, 0.5, 0.5);
|
||||||
E_WEIGHT(lbl, EVAS_HINT_EXPAND, 0);
|
E_WEIGHT(lbl, EVAS_HINT_EXPAND, 0);
|
||||||
elm_box_pack_end(box, lbl);
|
elm_box_pack_end(box, lbl);
|
||||||
evas_object_show(lbl);
|
evas_object_show(lbl);
|
||||||
|
@ -424,6 +435,33 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
E_WEIGHT(lbl, EVAS_HINT_EXPAND, 0);
|
||||||
|
elm_box_pack_end(box, lbl);
|
||||||
|
evas_object_show(lbl);
|
||||||
|
|
||||||
|
slider = elm_slider_add(box);
|
||||||
|
elm_slider_unit_format_set(slider, "%1.0f");
|
||||||
|
elm_slider_indicator_format_set(slider, "%1.0f");
|
||||||
|
elm_slider_min_max_set(slider, 1, 256);
|
||||||
|
elm_slider_value_set(slider, inst->cfg->preview_size);
|
||||||
|
elm_slider_step_set(slider, 1);
|
||||||
|
elm_slider_span_size_set(slider, 256);
|
||||||
|
E_ALIGN(slider, 0.0, 0.0);
|
||||||
|
E_WEIGHT(slider, EVAS_HINT_EXPAND, 0);
|
||||||
|
evas_object_smart_callback_add(slider, "delay,changed", _update_preview_size, inst);
|
||||||
|
elm_box_pack_end(box, slider);
|
||||||
|
evas_object_show(slider);
|
||||||
|
|
||||||
elm_object_content_set(fr, box);
|
elm_object_content_set(fr, box);
|
||||||
|
|
||||||
fr = elm_frame_add(tb);
|
fr = elm_frame_add(tb);
|
||||||
|
|
|
@ -718,6 +718,9 @@ grid_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNUSE
|
||||||
inst->inside = EINA_FALSE;
|
inst->inside = EINA_FALSE;
|
||||||
inst->bar = EINA_FALSE;
|
inst->bar = EINA_FALSE;
|
||||||
|
|
||||||
|
if (!inst->cfg->preview_size)
|
||||||
|
inst->cfg->preview_size = 64;
|
||||||
|
|
||||||
_grid_icon_class.item_style = "luncher";
|
_grid_icon_class.item_style = "luncher";
|
||||||
_grid_icon_class.func.text_get = NULL;
|
_grid_icon_class.func.text_get = NULL;
|
||||||
_grid_icon_class.func.content_get = _gengrid_icon_get;
|
_grid_icon_class.func.content_get = _gengrid_icon_get;
|
||||||
|
|
|
@ -40,6 +40,7 @@ struct _Config_Item
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
int version;
|
int version;
|
||||||
|
int preview_size;
|
||||||
Eina_Stringshare *style;
|
Eina_Stringshare *style;
|
||||||
Eina_Stringshare *dir;
|
Eina_Stringshare *dir;
|
||||||
Luncher_Type type;
|
Luncher_Type type;
|
||||||
|
|
|
@ -21,6 +21,7 @@ luncher_init(void)
|
||||||
#define D conf_item_edd
|
#define D conf_item_edd
|
||||||
E_CONFIG_VAL(D, T, id, INT);
|
E_CONFIG_VAL(D, T, id, INT);
|
||||||
E_CONFIG_VAL(D, T, version, INT);
|
E_CONFIG_VAL(D, T, version, INT);
|
||||||
|
E_CONFIG_VAL(D, T, preview_size, INT);
|
||||||
E_CONFIG_VAL(D, T, style, STR);
|
E_CONFIG_VAL(D, T, style, STR);
|
||||||
E_CONFIG_VAL(D, T, dir, STR);
|
E_CONFIG_VAL(D, T, dir, STR);
|
||||||
E_CONFIG_VAL(D, T, type, INT);
|
E_CONFIG_VAL(D, T, type, INT);
|
||||||
|
@ -40,7 +41,8 @@ luncher_init(void)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
ci->id = 0;
|
ci->id = 0;
|
||||||
ci->version = CONFIG_VERSION;
|
ci->version = CONFIG_VERSION;
|
||||||
ci->style = eina_stringshare_add("default");
|
ci->preview_size = 64;
|
||||||
|
ci->style = eina_stringshare_add("default");
|
||||||
ci->dir = eina_stringshare_add("default");
|
ci->dir = eina_stringshare_add("default");
|
||||||
ci->type = E_LUNCHER_MODULE_FULL;
|
ci->type = E_LUNCHER_MODULE_FULL;
|
||||||
luncher_config->items = eina_list_append(luncher_config->items, ci);
|
luncher_config->items = eina_list_append(luncher_config->items, ci);
|
||||||
|
|
Loading…
Reference in New Issue