From d8f471fd020591dff685ab5ee0ee9fd1f06f193a Mon Sep 17 00:00:00 2001 From: Hermet Date: Sat, 14 Feb 2015 17:12:32 +0900 Subject: [PATCH] bin/console: improve the console usage. show the console with the default size if it's size is 0 when toggle is clicked. this is improvement for those people who doesn't understand that nothing is happened when console toggle is clicked. --- src/bin/config_data.c | 2 +- src/bin/panes.c | 10 ++++++++++ src/include/console.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/bin/config_data.c b/src/bin/config_data.c index 90f0e6d..9259ad8 100644 --- a/src/bin/config_data.c +++ b/src/bin/config_data.c @@ -143,7 +143,7 @@ config_load(void) } cd->font_scale = 1.0f; cd->view_scale = 1; - cd->console_size = 0.175; + cd->console_size = DEFAULT_CONSOLE_SIZE; cd->stats_bar = EINA_TRUE; cd->linenumber = EINA_TRUE; cd->part_highlight = EINA_TRUE; diff --git a/src/bin/panes.c b/src/bin/panes.c index f17c062..a65e1f1 100644 --- a/src/bin/panes.c +++ b/src/bin/panes.c @@ -60,6 +60,9 @@ v_unpress_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) double size = elm_panes_content_right_size_get(obj); if (pd->vert.last_size[0] != size) pd->vert.last_size[1] = size; config_console_size_set(size); + + double origin = elm_panes_content_right_size_get(pd->vert.obj); + if (origin == 0.0) pd->vert.state = PANES_EDITORS_EXPAND; } static void @@ -98,6 +101,13 @@ panes_v_full_view_cancel(panes_data *pd) pd->vert.origin = elm_panes_content_right_size_get(pd->vert.obj); pd->vert.delta = pd->vert.last_size[1] - pd->vert.origin; + //init console size to default + if (pd->vert.delta == 0.0) + { + pd->vert.delta = DEFAULT_CONSOLE_SIZE; + config_console_size_set(DEFAULT_CONSOLE_SIZE); + } + Elm_Transit *transit = elm_transit_add(); elm_transit_effect_add(transit, transit_op_v, pd, NULL); elm_transit_tween_mode_set(transit, ELM_TRANSIT_TWEEN_MODE_DECELERATE); diff --git a/src/include/console.h b/src/include/console.h index e6ceb51..5211af7 100644 --- a/src/include/console.h +++ b/src/include/console.h @@ -1,3 +1,5 @@ +#define DEFAULT_CONSOLE_SIZE 0.175 + Evas_Object *console_create(Evas_Object *parent); void console_text_set(Evas_Object *console, const char *text);