forked from enlightenment/edi
menu: hide by default until we can fix elm menu calcs
You can show it with alt-f
This commit is contained in:
parent
cd4e83b9b2
commit
863b3d7ab3
|
@ -1310,6 +1310,25 @@ _win_delete_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
||||||
edi_close();
|
edi_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_win_cb_key_down(void *data, Evas *e EINA_UNUSED,
|
||||||
|
Evas_Object *obj EINA_UNUSED, void *event)
|
||||||
|
{
|
||||||
|
Eina_Bool ctrl, alt, shift;
|
||||||
|
Evas_Event_Key_Down *ev = event;
|
||||||
|
Evas_Object *win = data;
|
||||||
|
|
||||||
|
ctrl = evas_key_modifier_is_set(ev->modifiers, "Ctrl");
|
||||||
|
alt = evas_key_modifier_is_set(ev->modifiers, "Alt");
|
||||||
|
shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
|
||||||
|
|
||||||
|
if (!ctrl && alt && !shift)
|
||||||
|
{
|
||||||
|
if (!strcmp(ev->key, "f"))
|
||||||
|
_edi_menu_setup(win);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
edi_open(const char *inputpath)
|
edi_open(const char *inputpath)
|
||||||
{
|
{
|
||||||
|
@ -1356,8 +1375,6 @@ edi_open(const char *inputpath)
|
||||||
elm_box_pack_end(hbx, vbx);
|
elm_box_pack_end(hbx, vbx);
|
||||||
evas_object_show(vbx);
|
evas_object_show(vbx);
|
||||||
|
|
||||||
_edi_menu_setup(win);
|
|
||||||
|
|
||||||
content = edi_content_setup(vbx, path);
|
content = edi_content_setup(vbx, path);
|
||||||
evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(content, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(content, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
@ -1380,6 +1397,9 @@ edi_open(const char *inputpath)
|
||||||
ecore_event_handler_add(EDI_EVENT_FILE_CHANGED, _edi_file_changed, NULL);
|
ecore_event_handler_add(EDI_EVENT_FILE_CHANGED, _edi_file_changed, NULL);
|
||||||
ecore_event_handler_add(EDI_EVENT_FILE_SAVED, _edi_file_saved, NULL);
|
ecore_event_handler_add(EDI_EVENT_FILE_SAVED, _edi_file_saved, NULL);
|
||||||
|
|
||||||
|
evas_object_event_callback_add(win, EVAS_CALLBACK_KEY_DOWN,
|
||||||
|
_win_cb_key_down, win);
|
||||||
|
|
||||||
free(path);
|
free(path);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue