forked from enlightenment/edi
Allow hiding of the toolbar
This commit is contained in:
parent
b4f7301768
commit
bd55404b42
|
@ -244,6 +244,7 @@ _edi_config_init(void)
|
||||||
EDI_CONFIG_VAL(D, T, gui.show_whitespace, EET_T_UCHAR);
|
EDI_CONFIG_VAL(D, T, gui.show_whitespace, EET_T_UCHAR);
|
||||||
EDI_CONFIG_VAL(D, T, gui.width_marker, EET_T_UINT);
|
EDI_CONFIG_VAL(D, T, gui.width_marker, EET_T_UINT);
|
||||||
EDI_CONFIG_VAL(D, T, gui.tabstop, EET_T_UINT);
|
EDI_CONFIG_VAL(D, T, gui.tabstop, EET_T_UINT);
|
||||||
|
EDI_CONFIG_VAL(D, T, gui.toolbar_hidden, EET_T_UCHAR);
|
||||||
|
|
||||||
EDI_CONFIG_LIST(D, T, tabs, _edi_proj_cfg_tab_edd);
|
EDI_CONFIG_LIST(D, T, tabs, _edi_proj_cfg_tab_edd);
|
||||||
|
|
||||||
|
@ -444,6 +445,7 @@ _edi_project_config_load()
|
||||||
|
|
||||||
_edi_project_config->gui.width_marker = 80;
|
_edi_project_config->gui.width_marker = 80;
|
||||||
_edi_project_config->gui.tabstop = 8;
|
_edi_project_config->gui.tabstop = 8;
|
||||||
|
_edi_project_config->gui.toolbar_hidden = EINA_FALSE;
|
||||||
|
|
||||||
_edi_project_config->tabs = NULL;
|
_edi_project_config->tabs = NULL;
|
||||||
IFPCFGEND;
|
IFPCFGEND;
|
||||||
|
|
|
@ -63,6 +63,8 @@ struct _Edi_Project_Config
|
||||||
Eina_Bool leftopen, bottomopen;
|
Eina_Bool leftopen, bottomopen;
|
||||||
Eina_Bool show_whitespace;
|
Eina_Bool show_whitespace;
|
||||||
unsigned int width_marker, tabstop;
|
unsigned int width_marker, tabstop;
|
||||||
|
|
||||||
|
Eina_Bool toolbar_hidden;
|
||||||
} gui;
|
} gui;
|
||||||
|
|
||||||
Eina_List *tabs;
|
Eina_List *tabs;
|
||||||
|
|
|
@ -36,13 +36,13 @@ typedef struct _Edi_Panel_Slide_Effect
|
||||||
|
|
||||||
#define COPYRIGHT "Copyright © 2014 Andy Williams <andy@andyilliams.me> and various contributors (see AUTHORS)."
|
#define COPYRIGHT "Copyright © 2014 Andy Williams <andy@andyilliams.me> and various contributors (see AUTHORS)."
|
||||||
|
|
||||||
static Evas_Object *_edi_leftpanes, *_edi_bottompanes;
|
static Evas_Object *_edi_toolbar, *_edi_leftpanes, *_edi_bottompanes;
|
||||||
static Evas_Object *_edi_logpanel, *_edi_consolepanel, *_edi_testpanel;
|
static Evas_Object *_edi_logpanel, *_edi_consolepanel, *_edi_testpanel;
|
||||||
static Elm_Object_Item *_edi_logpanel_item, *_edi_consolepanel_item, *_edi_testpanel_item;
|
static Elm_Object_Item *_edi_logpanel_item, *_edi_consolepanel_item, *_edi_testpanel_item;
|
||||||
static Elm_Object_Item *_edi_selected_bottompanel;
|
static Elm_Object_Item *_edi_selected_bottompanel;
|
||||||
static Evas_Object *_edi_filepanel, *_edi_filepanel_icon;
|
static Evas_Object *_edi_filepanel, *_edi_filepanel_icon;
|
||||||
|
|
||||||
static Evas_Object *_edi_main_win, *_edi_new_popup, *_edi_goto_popup,*_edi_message_popup;
|
static Evas_Object *_edi_main_win, *_edi_main_box, *_edi_new_popup, *_edi_goto_popup,*_edi_message_popup;
|
||||||
int _edi_log_dom = -1;
|
int _edi_log_dom = -1;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -760,6 +760,26 @@ _edi_resize_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
|
||||||
_edi_project_config_save();
|
_edi_project_config_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_edi_toolbar_set_visible(Eina_Bool visible)
|
||||||
|
{
|
||||||
|
elm_box_unpack(_edi_main_box, _edi_toolbar);
|
||||||
|
if (visible)
|
||||||
|
evas_object_show(_edi_toolbar);
|
||||||
|
else
|
||||||
|
evas_object_hide(_edi_toolbar);
|
||||||
|
|
||||||
|
if (visible)
|
||||||
|
elm_box_pack_start(_edi_main_box, _edi_toolbar);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_edi_config_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||||
|
{
|
||||||
|
_edi_toolbar_set_visible(!_edi_project_config->gui.toolbar_hidden);
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_edi_open_tabs()
|
_edi_open_tabs()
|
||||||
{
|
{
|
||||||
|
@ -804,12 +824,14 @@ edi_open(const char *inputpath)
|
||||||
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _edi_resize_cb, NULL);
|
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _edi_resize_cb, NULL);
|
||||||
|
|
||||||
vbx = elm_box_add(win);
|
vbx = elm_box_add(win);
|
||||||
|
_edi_main_box = vbx;
|
||||||
evas_object_size_hint_weight_set(vbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(vbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
elm_win_resize_object_add(win, vbx);
|
elm_win_resize_object_add(win, vbx);
|
||||||
evas_object_show(vbx);
|
evas_object_show(vbx);
|
||||||
|
|
||||||
tb = edi_toolbar_setup(win);
|
tb = edi_toolbar_setup(win);
|
||||||
elm_box_pack_end(vbx, tb);
|
_edi_toolbar = tb;
|
||||||
|
_edi_toolbar_set_visible(!_edi_project_config->gui.toolbar_hidden);
|
||||||
|
|
||||||
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);
|
||||||
|
@ -823,6 +845,7 @@ edi_open(const char *inputpath)
|
||||||
|
|
||||||
_edi_config_project_add(path);
|
_edi_config_project_add(path);
|
||||||
_edi_open_tabs();
|
_edi_open_tabs();
|
||||||
|
ecore_event_handler_add(EDI_EVENT_CONFIG_CHANGED, _edi_config_changed, NULL);
|
||||||
|
|
||||||
free(path);
|
free(path);
|
||||||
return win;
|
return win;
|
||||||
|
|
|
@ -90,6 +90,17 @@ _edi_settings_display_tabstop_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||||
_edi_project_config_save();
|
_edi_project_config_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_edi_settings_toolbar_hidden_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||||
|
void *event EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Evas_Object *check;
|
||||||
|
|
||||||
|
check = (Evas_Object *)obj;
|
||||||
|
_edi_project_config->gui.toolbar_hidden = elm_check_state_get(check);
|
||||||
|
_edi_project_config_save();
|
||||||
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_edi_settings_display_create(Evas_Object *parent)
|
_edi_settings_display_create(Evas_Object *parent)
|
||||||
{
|
{
|
||||||
|
@ -163,7 +174,7 @@ _edi_settings_display_create(Evas_Object *parent)
|
||||||
|
|
||||||
hbox = elm_box_add(parent);
|
hbox = elm_box_add(parent);
|
||||||
elm_box_horizontal_set(hbox, EINA_TRUE);
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
||||||
evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.5);
|
evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0);
|
||||||
evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, 0.05);
|
evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, 0.05);
|
||||||
elm_box_pack_end(box, hbox);
|
elm_box_pack_end(box, hbox);
|
||||||
evas_object_show(hbox);
|
evas_object_show(hbox);
|
||||||
|
@ -187,6 +198,16 @@ _edi_settings_display_create(Evas_Object *parent)
|
||||||
elm_box_pack_end(hbox, spinner);
|
elm_box_pack_end(hbox, spinner);
|
||||||
evas_object_show(spinner);
|
evas_object_show(spinner);
|
||||||
|
|
||||||
|
check = elm_check_add(box);
|
||||||
|
elm_object_text_set(check, "Hide Toolbar");
|
||||||
|
elm_check_state_set(check, _edi_project_config->gui.toolbar_hidden);
|
||||||
|
elm_box_pack_end(box, check);
|
||||||
|
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.5);
|
||||||
|
evas_object_size_hint_align_set(check, 0.0, 0.5);
|
||||||
|
evas_object_smart_callback_add(check, "changed",
|
||||||
|
_edi_settings_toolbar_hidden_cb, NULL);
|
||||||
|
evas_object_show(check);
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue