start a desktop entry mode. shift arrows start/mod selection. can just

click and drag to select.



SVN revision: 58258
This commit is contained in:
Carsten Haitzler 2011-04-01 13:20:40 +00:00
parent e6ba1dfbf1
commit 4febdc8e0c
6 changed files with 96 additions and 59 deletions

View File

@ -35,4 +35,5 @@ group "Elm_Config" struct {
value "icon_size" int: 32; value "icon_size" int: 32;
value "longpress_timeout" double: 1.0; value "longpress_timeout" double: 1.0;
value "effect_enable" uchar: 1; value "effect_enable" uchar: 1;
value "desktop_entry" uchar: 0;
} }

View File

@ -35,4 +35,5 @@ group "Elm_Config" struct {
value "icon_size" int: 32; value "icon_size" int: 32;
value "longpress_timeout" double: 1.0; value "longpress_timeout" double: 1.0;
value "effect_enable" uchar: 1; value "effect_enable" uchar: 1;
value "desktop_entry" uchar: 0;
} }

View File

@ -35,4 +35,5 @@ group "Elm_Config" struct {
value "icon_size" int: 32; value "icon_size" int: 32;
value "longpress_timeout" double: 1.0; value "longpress_timeout" double: 1.0;
value "effect_enable" uchar: 1; value "effect_enable" uchar: 1;
value "desktop_entry" uchar: 1;
} }

View File

@ -599,6 +599,7 @@ _desc_init(void)
ELM_CONFIG_VAL(D, T, icon_size, T_INT); ELM_CONFIG_VAL(D, T, icon_size, T_INT);
ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE); ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE);
ELM_CONFIG_VAL(D, T, effect_enable, T_UCHAR); ELM_CONFIG_VAL(D, T, effect_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, desktop_entry, T_UCHAR);
#undef T #undef T
#undef D #undef D
#undef T_INT #undef T_INT
@ -1132,7 +1133,6 @@ _config_load(void)
_elm_config->fps = 60.0; _elm_config->fps = 60.0;
_elm_config->theme = eina_stringshare_add("default"); _elm_config->theme = eina_stringshare_add("default");
_elm_config->modules = NULL; _elm_config->modules = NULL;
_elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
_elm_config->tooltip_delay = 1.0; _elm_config->tooltip_delay = 1.0;
_elm_config->cursor_engine_only = EINA_TRUE; _elm_config->cursor_engine_only = EINA_TRUE;
_elm_config->focus_highlight_enable = EINA_FALSE; _elm_config->focus_highlight_enable = EINA_FALSE;
@ -1143,6 +1143,9 @@ _config_load(void)
_elm_config->icon_size = 32; _elm_config->icon_size = 32;
_elm_config->longpress_timeout = 1.0; _elm_config->longpress_timeout = 1.0;
_elm_config->effect_enable = EINA_TRUE; _elm_config->effect_enable = EINA_TRUE;
_elm_config->desktop_entry = EINA_FALSE;
_elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
} }
static const char * static const char *
@ -1573,6 +1576,9 @@ _env_get(void)
s = getenv("ELM_EFFECT_ENABLE"); s = getenv("ELM_EFFECT_ENABLE");
if (s) _elm_config->effect_enable = !!atoi(s); if (s) _elm_config->effect_enable = !!atoi(s);
s = getenv("ELM_DESKTOP_ENTRY");
if (s) _elm_config->desktop_entry = !!atoi(s);
} }
/** /**

View File

@ -543,6 +543,8 @@ _theme_hook(Evas_Object *obj)
t = eina_stringshare_add(elm_entry_entry_get(obj)); t = eina_stringshare_add(elm_entry_entry_get(obj));
_elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj)); _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
if (_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
elm_entry_entry_set(obj, t); elm_entry_entry_set(obj, t);
eina_stringshare_del(t); eina_stringshare_del(t);
if (elm_widget_disabled_get(obj)) if (elm_widget_disabled_get(obj))
@ -754,10 +756,13 @@ _dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
wd->usedown = 0; wd->usedown = 0;
if (wd->hoversel) evas_object_hide(wd->hoversel); if (wd->hoversel) evas_object_hide(wd->hoversel);
if (wd->selmode) if (wd->selmode)
{
if (!_elm_config->desktop_entry)
{ {
if (!wd->password) if (!wd->password)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
} }
}
elm_widget_scroll_freeze_pop(data); elm_widget_scroll_freeze_pop(data);
if (wd->hovdeljob) ecore_job_del(wd->hovdeljob); if (wd->hovdeljob) ecore_job_del(wd->hovdeljob);
wd->hovdeljob = ecore_job_add(_hover_del, data); wd->hovdeljob = ecore_job_add(_hover_del, data);
@ -770,9 +775,13 @@ _select(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
if (!wd) return; if (!wd) return;
wd->selmode = EINA_TRUE; wd->selmode = EINA_TRUE;
edje_object_part_text_select_none(wd->ent, "elm.text"); edje_object_part_text_select_none(wd->ent, "elm.text");
if (!_elm_config->desktop_entry)
{
if (!wd->password) if (!wd->password)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
}
edje_object_signal_emit(wd->ent, "elm,state,select,on", "elm"); edje_object_signal_emit(wd->ent, "elm,state,select,on", "elm");
if (!_elm_config->desktop_entry)
elm_widget_scroll_hold_push(data); elm_widget_scroll_hold_push(data);
} }
@ -815,8 +824,10 @@ _cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
/* Store it */ /* Store it */
wd->selmode = EINA_FALSE; wd->selmode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
if (!_elm_config->desktop_entry)
elm_widget_scroll_hold_pop(data); elm_widget_scroll_hold_pop(data);
_store_selection(ELM_SEL_CLIPBOARD, data); _store_selection(ELM_SEL_CLIPBOARD, data);
edje_object_part_text_insert(wd->ent, "elm.text", ""); edje_object_part_text_insert(wd->ent, "elm.text", "");
@ -829,9 +840,12 @@ _copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
Widget_Data *wd = elm_widget_data_get(data); Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return; if (!wd) return;
wd->selmode = EINA_FALSE; wd->selmode = EINA_FALSE;
if (!_elm_config->desktop_entry)
{
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
elm_widget_scroll_hold_pop(data); elm_widget_scroll_hold_pop(data);
}
_store_selection(ELM_SEL_CLIPBOARD, data); _store_selection(ELM_SEL_CLIPBOARD, data);
// edje_object_part_text_select_none(wd->ent, "elm.text"); // edje_object_part_text_select_none(wd->ent, "elm.text");
} }
@ -842,8 +856,10 @@ _cancel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
Widget_Data *wd = elm_widget_data_get(data); Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return; if (!wd) return;
wd->selmode = EINA_FALSE; wd->selmode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
if (!_elm_config->desktop_entry)
elm_widget_scroll_hold_pop(data); elm_widget_scroll_hold_pop(data);
edje_object_part_text_select_none(wd->ent, "elm.text"); edje_object_part_text_select_none(wd->ent, "elm.text");
} }
@ -887,10 +903,13 @@ _menu_press(Evas_Object *obj)
if (top) elm_hoversel_hover_parent_set(wd->hoversel, top); if (top) elm_hoversel_hover_parent_set(wd->hoversel, top);
evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, obj); evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, obj);
if (!wd->selmode) if (!wd->selmode)
{
if (!_elm_config->desktop_entry)
{ {
if (!wd->password) if (!wd->password)
elm_hoversel_item_add(wd->hoversel, E_("Select"), NULL, ELM_ICON_NONE, elm_hoversel_item_add(wd->hoversel, E_("Select"), NULL, ELM_ICON_NONE,
_select, obj); _select, obj);
}
if (1) // need way to detect if someone has a selection if (1) // need way to detect if someone has a selection
{ {
if (wd->editable) if (wd->editable)
@ -925,10 +944,13 @@ _menu_press(Evas_Object *obj)
evas_object_show(wd->hoversel); evas_object_show(wd->hoversel);
elm_hoversel_hover_begin(wd->hoversel); elm_hoversel_hover_begin(wd->hoversel);
} }
if (!_elm_config->desktop_entry)
{
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
edje_object_part_text_select_abort(wd->ent, "elm.text"); edje_object_part_text_select_abort(wd->ent, "elm.text");
} }
} }
}
static Eina_Bool static Eina_Bool
_long_press(void *data) _long_press(void *data)
@ -1595,6 +1617,8 @@ elm_entry_add(Evas_Object *parent)
edje_object_signal_callback_add(wd->ent, "mouse,down,1,double", "elm.text", edje_object_signal_callback_add(wd->ent, "mouse,down,1,double", "elm.text",
_signal_mouse_double, obj); _signal_mouse_double, obj);
edje_object_part_text_set(wd->ent, "elm.text", ""); edje_object_part_text_set(wd->ent, "elm.text", "");
if (_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
elm_widget_resize_object_set(obj, wd->ent); elm_widget_resize_object_set(obj, wd->ent);
_sizing_eval(obj); _sizing_eval(obj);
@ -1955,6 +1979,7 @@ elm_entry_select_none(Evas_Object *obj)
if (wd->selmode) if (wd->selmode)
{ {
wd->selmode = EINA_FALSE; wd->selmode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
} }
@ -1978,6 +2003,7 @@ elm_entry_select_all(Evas_Object *obj)
if (wd->selmode) if (wd->selmode)
{ {
wd->selmode = EINA_FALSE; wd->selmode = EINA_FALSE;
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE); edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
} }

View File

@ -78,7 +78,7 @@ struct _Elm_Config
{ {
int config_version; int config_version;
const char *engine; const char *engine;
Eina_Bool thumbscroll_enable; unsigned char thumbscroll_enable;
int thumbscroll_threshold; int thumbscroll_threshold;
double thumbscroll_momentum_threshold; double thumbscroll_momentum_threshold;
double thumbscroll_friction; double thumbscroll_friction;
@ -86,7 +86,7 @@ struct _Elm_Config
double page_scroll_friction; double page_scroll_friction;
double bring_in_scroll_friction; double bring_in_scroll_friction;
double zoom_friction; double zoom_friction;
Eina_Bool thumbscroll_bounce_enable; unsigned char thumbscroll_bounce_enable;
double thumbscroll_border_friction; double thumbscroll_border_friction;
double scale; double scale;
int bgpixmap; int bgpixmap;
@ -95,7 +95,7 @@ struct _Elm_Config
Eina_List *font_overlays; Eina_List *font_overlays;
int font_hinting; int font_hinting;
int cache_flush_poll_interval; int cache_flush_poll_interval;
Eina_Bool cache_flush_enable; unsigned char cache_flush_enable;
int image_cache; int image_cache;
int font_cache; int font_cache;
int edje_cache; int edje_cache;
@ -105,16 +105,18 @@ struct _Elm_Config
const char *theme; const char *theme;
const char *modules; const char *modules;
double tooltip_delay; double tooltip_delay;
Eina_Bool cursor_engine_only; unsigned char cursor_engine_only;
Eina_Bool focus_highlight_enable; unsigned char focus_highlight_enable;
Eina_Bool focus_highlight_animate; unsigned char focus_highlight_animate;
int toolbar_shrink_mode; int toolbar_shrink_mode;
Eina_Bool fileselector_expand_enable; unsigned char fileselector_expand_enable;
Eina_Bool inwin_dialogs_enable; unsigned char inwin_dialogs_enable;
int icon_size; int icon_size;
double longpress_timeout; double longpress_timeout;
unsigned char effect_enable;
unsigned char desktop_entry;
Eina_Bool is_mirrored : 1; Eina_Bool is_mirrored : 1;
Eina_Bool effect_enable;
}; };
struct _Elm_Module struct _Elm_Module