From ac2fca776ac5e6a69f89615eea60fb0f398e8b22 Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Tue, 20 Apr 2010 18:49:42 +0000 Subject: [PATCH] 'everything' first start help page SVN revision: 48170 --- data/themes/default.edc | 42 +++++++++++++++++--- src/modules/everything/Evry.h | 2 + src/modules/everything/e_mod_main.c | 16 ++++++-- src/modules/everything/evry.c | 39 ++++++++++-------- src/modules/everything/evry_plug_view_help.c | 32 ++++++++------- 5 files changed, 91 insertions(+), 40 deletions(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 4aa18d9b7..20b2b270f 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -33412,8 +33412,8 @@ collections { normal: "base_bg.png"; border: 2 2 2 2; } - fill.smooth: 0; - color: 205 205 205 255; + fill.smooth: 1; + color: 245 245 245 255; } } part { @@ -34333,12 +34333,12 @@ collections { normal: "everything_item_bg.png"; border: 5 5 5 5; } - color: 255 255 255 32; + color: 255 255 255 16; } description { state: "selected" 0.0; inherit: "default" 0.0; - color: 255 255 255 128; + color: 255 255 255 108; } } part { @@ -34557,7 +34557,7 @@ collections { source: "e"; action: STATE_SET "selected" 0.0; target: "bg"; - transition: ACCELERATE 0.05; + transition: ACCELERATE 0.15; /* target: "clip"; */ } program { @@ -34565,7 +34565,7 @@ collections { signal: "e,state,unselected"; source: "e"; action: STATE_SET "default" 0.0; - /* transition: LINEAR 0.1; */ + transition: LINEAR 0.2; target: "bg"; /* target: "clip"; */ } @@ -34944,6 +34944,36 @@ collections { } } + group { + name: "e/modules/everything/textblock"; + styles { + style { + name: "everything_textblock_style"; + base: "font=Sans font_size=11 align=left color=#000"; + tag: "hilight" "+ font=Sans:style=Bold color=#0c0c0c"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "br" "\n"; + tag: "/title" "- \n \n"; + } + } + parts { + part { + name: "e.textblock.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + text { + style: "everything_textblock_style"; + min: 1 1; + } + } + } + } + } ///////////////////////////////////////////////////////////////////////////// /*** MOD: CONF_COLORS ***/ diff --git a/src/modules/everything/Evry.h b/src/modules/everything/Evry.h index e610a6152..fc57508f8 100644 --- a/src/modules/everything/Evry.h +++ b/src/modules/everything/Evry.h @@ -344,6 +344,8 @@ struct _Config Eina_List *views; int min_w, min_h; + + unsigned char first_run; }; struct _Plugin_Config diff --git a/src/modules/everything/e_mod_main.c b/src/modules/everything/e_mod_main.c index 84a25c6ff..ff1fc81e6 100644 --- a/src/modules/everything/e_mod_main.c +++ b/src/modules/everything/e_mod_main.c @@ -12,7 +12,7 @@ /* #undef DBG * #define DBG(...) ERR(__VA_ARGS__) */ -#define CONFIG_VERSION 9 +#define CONFIG_VERSION 10 /* actual module specifics */ static void _e_mod_action_cb(E_Object *obj, const char *params); @@ -214,6 +214,7 @@ _config_init() E_CONFIG_LIST(D, T, conf_actions, plugin_conf_edd); E_CONFIG_LIST(D, T, conf_objects, plugin_conf_edd); E_CONFIG_LIST(D, T, conf_views, plugin_conf_edd); + E_CONFIG_VAL(D, T, first_run, UCHAR); #undef T #undef D evry_conf = e_config_domain_load("module.everything", conf_edd); @@ -226,13 +227,19 @@ _config_init() if (evry_conf && evry_conf->version == 8) { - evry_conf->width = 460; + evry_conf->width = 445; evry_conf->height = 310; evry_conf->rel_y = 0.25; evry_conf->scroll_animate = 1; - evry_conf->version = CONFIG_VERSION; + evry_conf->version = 9; } + if (evry_conf && evry_conf->version == 9) + { + evry_conf->first_run = EINA_TRUE; + evry_conf->version = CONFIG_VERSION; + } + if (evry_conf && evry_conf->version != CONFIG_VERSION) { _config_free(); @@ -245,7 +252,7 @@ _config_init() evry_conf->version = CONFIG_VERSION; evry_conf->rel_x = 0.5; evry_conf->rel_y = 0.25; - evry_conf->width = 460; + evry_conf->width = 445; evry_conf->height = 310; evry_conf->scroll_animate = 1; evry_conf->scroll_speed = 10.0; @@ -258,6 +265,7 @@ _config_init() evry_conf->view_zoom = 0; evry_conf->cycle_mode = 0; evry_conf->history_sort_mode = 0; + evry_conf->first_run = EINA_TRUE; } } diff --git a/src/modules/everything/evry.c b/src/modules/everything/evry.c index 0fa768537..3340226e2 100644 --- a/src/modules/everything/evry.c +++ b/src/modules/everything/evry.c @@ -143,9 +143,17 @@ _cb_show_timer(void *data) Evry_View *view =evry_conf->views->data; Evry_State *s = selector->state; - s->view = view->create(view, s, list->o_main); - - _evry_view_show(s->view); + if (evry_conf->first_run) + { + _evry_view_toggle(s, "?"); + evry_conf->first_run = EINA_FALSE; + } + else + { + s->view = view->create(view, s, list->o_main); + + _evry_view_show(s->view); + } } else return 0; @@ -1520,16 +1528,11 @@ _evry_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event) if (len < (INPUTLEN - strlen(ev->compose))) { strcat(s->input, ev->compose); - /* if ((len == 0) && isspace(s->input[0])) - * _evry_show_triggers(); */ - if ((len == 1) && - (isspace(s->input[0])) && - (_evry_view_toggle(s, s->input + 1))) - { - /* space at the beginning is trigger */ - _evry_update(selector, 0); - } - else if (isspace(*ev->compose)) + + if (len == 0 && (_evry_view_toggle(s, s->input))) + goto end; + + if (isspace(*ev->compose)) { /* do not update matches on space */ _evry_update(selector, 0); @@ -1797,14 +1800,18 @@ _evry_view_toggle(Evry_State *s, const char *trigger) { Evry_View *view, *v = NULL; Eina_List *l, *ll; - + Eina_Bool triggered = FALSE; + if (trigger) { EINA_LIST_FOREACH(evry_conf->views, ll, view) { if (view->trigger && !strncmp(trigger, view->trigger, 1) && (v = view->create(view, s, list->o_main))) - goto found; + { + triggered = EINA_TRUE; + goto found; + } } } else @@ -1855,7 +1862,7 @@ _evry_view_toggle(Evry_State *s, const char *trigger) _evry_view_show(s->view); view->update(s->view, 0); - return 1; + return triggered; } static void diff --git a/src/modules/everything/evry_plug_view_help.c b/src/modules/everything/evry_plug_view_help.c index fb0b000a8..4e3b204ca 100644 --- a/src/modules/everything/evry_plug_view_help.c +++ b/src/modules/everything/evry_plug_view_help.c @@ -62,19 +62,23 @@ _view_create(Evry_View *v, const Evry_State *s, const Evas_Object *swallow) int mw, mh; char *text = - _("<b>Welcome!</b>" - "Ok, here comes the explanation of everything...
" - "Just type a few letters of the thing you are looking for.
" - "Use cursor <up/down> to choose from the list of things.
" - "Press <tab> to select " - "an action, then press <return>.
" - /* "You might want to know
some mo keybinding to ease your experience though.
" */ - "<space><?> show this page
" - "<ctrl+letter> jump to plugin beginning with 'letter'
" - "<ctrl+left/right>" - "cycle through plugins
" - "<ctrl+1> " - "choose a different view (e.g. for images)
"); + _(" Ok, here comes the explanation of everything...
" + " Just type a few letters of the thing you are looking for.
" + " Use cursor <up/down> to choose from the list of things.
" + " Press <tab> to select" + " an action, then press <return>.
" + /* "You might want to know
some mo keybinding to ease your experience though.
" */ + " <?> show this page
" + " <return> run action
" + " <ctrl+return> run action and continue
" + " <tab> toggle between selectors
" + " <ctrl+tab> complete input (depends on plugin)
" + " <ctrl+'x'> jump to plugin beginning with 'x'
" + " <ctrl+left/right> cycle through plugins
" + " <ctrl+1> toggle view modes (exit this page ;)
" + " <ctrl+2> toggle list view modes
" + " <ctrl+3> toggle thumb view modes" + ); if (v->active) return v; @@ -85,7 +89,7 @@ _view_create(Evry_View *v, const Evry_State *s, const Evas_Object *swallow) e_box_freeze(v->o_list); o = edje_object_add(evas_object_evas_get(swallow)); e_theme_edje_object_set(o, "base/theme/widgets", - "e/widgets/textblock"); + "e/modules/everything/textblock"); edje_object_part_text_set(o, "e.textblock.text", text); e_box_pack_start(v->o_list, o);