hotkeys - enable f5, f6 hotkeys.
This commit is contained in:
parent
f4f65b7fc9
commit
faf6a5f803
|
@ -827,6 +827,7 @@ edit_changed_set(edit_data *ed, Eina_Bool changed)
|
|||
void
|
||||
edit_line_number_toggle(edit_data *ed)
|
||||
{
|
||||
//FIXME: edit & config toogle should be handled in one place.
|
||||
Eina_Bool linenumber = config_linenumber_get();
|
||||
if (ed->linenumber == linenumber) return;
|
||||
ed->linenumber = linenumber;
|
||||
|
|
|
@ -34,18 +34,19 @@ static void
|
|||
f5_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
/* app_data *ad = data;
|
||||
config_linenumber_set(ad->cd, !config_linenumber_get(ad->cd));
|
||||
edit_line_number_toggle(ad->ed); */
|
||||
edit_data *ed = data;
|
||||
config_linenumber_set(!config_linenumber_get());
|
||||
edit_line_number_toggle(ed);
|
||||
}
|
||||
|
||||
static void
|
||||
f6_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
/* app_data *ad = data;
|
||||
config_stats_bar_set(ad->cd, !config_stats_bar_get(ad->cd));
|
||||
statusbar_toggle(ad); */
|
||||
//FIXME: ... how ad can be passed here? should be cut off from here.
|
||||
app_data *ad = data;
|
||||
config_stats_bar_set(!config_stats_bar_get());
|
||||
statusbar_toggle(ad);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -71,7 +72,7 @@ btn_create(Evas_Object *parent, const char *text, Evas_Smart_Cb cb, void *data)
|
|||
}
|
||||
|
||||
Evas_Object *
|
||||
hotkeys_create(Evas_Object *parent)
|
||||
hotkeys_create(Evas_Object *parent, app_data *ad, edit_data *ed)
|
||||
{
|
||||
Evas_Object *box = elm_box_add(parent);
|
||||
elm_box_horizontal_set(box, EINA_TRUE);
|
||||
|
@ -91,12 +92,10 @@ hotkeys_create(Evas_Object *parent)
|
|||
btn = btn_create(box, "F4: Load", f4_cb, NULL);
|
||||
elm_box_pack_end(box, btn);
|
||||
|
||||
btn = btn_create(box, "F5: ---", f5_cb, NULL);
|
||||
elm_object_disabled_set(btn, EINA_TRUE);
|
||||
btn = btn_create(box, "F5: Line Num", f5_cb, ed);
|
||||
elm_box_pack_end(box, btn);
|
||||
|
||||
btn = btn_create(box, "F6: ---", f6_cb, NULL);
|
||||
elm_object_disabled_set(btn, EINA_TRUE);
|
||||
btn = btn_create(box, "F6: Status", f6_cb, ad);
|
||||
elm_box_pack_end(box, btn);
|
||||
|
||||
btn = btn_create(box, "F7: ---", NULL, NULL);
|
||||
|
|
|
@ -128,15 +128,6 @@ main_key_up_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
statusbar_toggle(app_data *ad)
|
||||
{
|
||||
if (config_stats_bar_get())
|
||||
elm_object_signal_emit(ad->layout, "elm,state,statusbar,show", "");
|
||||
else
|
||||
elm_object_signal_emit(ad->layout, "elm,state,statusbar,hide", "");
|
||||
}
|
||||
|
||||
static void
|
||||
part_highlight_toggle(app_data *ad, Eina_Bool msg)
|
||||
{
|
||||
|
@ -573,6 +564,13 @@ edj_mgr_set(app_data *ad)
|
|||
elm_object_part_content_set(ad->panes, "left", edj_mgr_obj_get(ad->em));
|
||||
}
|
||||
|
||||
static void
|
||||
hotkeys_set(Evas_Object *layout, app_data *ad, edit_data *ed)
|
||||
{
|
||||
Evas_Object *hotkeys = hotkeys_create(layout, ad, ed);
|
||||
elm_object_part_content_set(layout, "elm.swallow.hotkeys", hotkeys);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
init(app_data *ad, int argc, char **argv)
|
||||
{
|
||||
|
@ -596,9 +594,7 @@ init(app_data *ad, int argc, char **argv)
|
|||
edc_edit_set(ad, ad->sd);
|
||||
edc_view_set(ad, ad->sd, stats_group_name_get(ad->sd));
|
||||
menu_init(ad->win, ad->ed);
|
||||
|
||||
Evas_Object *hotkeys = hotkeys_create(ad->layout);
|
||||
elm_object_part_content_set(ad->layout, "elm.swallow.hotkeys", hotkeys);
|
||||
hotkeys_set(ad->layout, ad, ad->ed);
|
||||
|
||||
ad->edc_monitor = eio_monitor_add(config_edc_path_get());
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, edc_changed_cb, ad);
|
||||
|
@ -620,6 +616,16 @@ term(app_data *ad)
|
|||
ecore_event_shutdown();
|
||||
}
|
||||
|
||||
//This function is used in hotkey. Maybe layout should be separated from main.
|
||||
void
|
||||
statusbar_toggle(app_data *ad)
|
||||
{
|
||||
if (config_stats_bar_get())
|
||||
elm_object_signal_emit(ad->layout, "elm,state,statusbar,show", "");
|
||||
else
|
||||
elm_object_signal_emit(ad->layout, "elm,state,statusbar,hide", "");
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
extern const char *PROTO_EDC_PATH;
|
||||
extern char EDJE_PATH[PATH_MAX];
|
||||
|
||||
void statusbar_toggle(app_data *ad);
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Evas_Object *hotkeys_create(Evas_Object *parent);
|
||||
Evas_Object *hotkeys_create(Evas_Object *parent, app_data *ad, edit_data *ed);
|
||||
|
||||
|
|
Loading…
Reference in New Issue