group input: add config option about default to visible ones or all

This commit is contained in:
Boris Faure 2020-04-12 17:16:14 +02:00
parent 2259519d10
commit 51468de3fd
Signed by untrusted user who does not match committer: borisfaure
GPG Key ID: 35C0410516166BE8
4 changed files with 18 additions and 3 deletions

View File

@ -7,7 +7,7 @@
#include "col.h"
#include "utils.h"
#define CONF_VER 23
#define CONF_VER 24
#define CONFIG_KEY "config"
#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
@ -191,6 +191,8 @@ config_init(void)
(edd_base, Config, "shine", shine, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "hide_cursor", hide_cursor, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "group_all", group_all, EET_T_UCHAR);
}
void
@ -319,6 +321,7 @@ config_sync(const Config *config_src, Config *config)
config->shine = config_src->shine;
config->translucent = config_src->translucent;
config->opacity = config_src->opacity;
config->group_all = config_src->group_all;
}
static void
@ -595,6 +598,7 @@ config_new(void)
_add_default_keys(config);
config->shine = 255;
config->hide_cursor = 5.0;
config->group_all = EINA_FALSE;
}
return config;
}
@ -728,8 +732,11 @@ config_load(void)
case 22:
config->show_tabs = !config->notabs;
EINA_FALLTHROUGH;
case 23:
config->group_all = EINA_FALSE;
EINA_FALLTHROUGH;
/*pass through*/
case CONF_VER: /* 23 */
case CONF_VER: /* 24 */
config->version = CONF_VER;
break;
default:
@ -832,6 +839,7 @@ config_fork(const Config *config)
CPY(changedir_to_current);
CPY(emoji_dbl_width);
CPY(shine);
CPY(group_all);
EINA_LIST_FOREACH(config->keys, l, key)
{

View File

@ -95,6 +95,7 @@ struct _Config
Eina_Bool ty_escapes;
Eina_Bool changedir_to_current;
Eina_Bool emoji_dbl_width;
Eina_Bool group_all;
Config_Color colors[(4 * 12)];
Eina_List *keys;

View File

@ -231,9 +231,13 @@ _cb_group_input_changed(void *data, Evas_Object *obj EINA_UNUSED,
{
Controls_Ctx *ctx = data;
Win *wn = ctx->wn;
Config *config = termio_config_get(ctx->term);
controls_hide(ctx, EINA_TRUE);
win_toggle_visible_group(wn);
if (config && config->group_all)
win_toggle_all_group(wn);
else
win_toggle_visible_group(wn);
}
static void

View File

@ -65,6 +65,7 @@ CB(mv_always_show, 0);
CB(ty_escapes, 0);
CB(changedir_to_current, 0);
CB(emoji_dbl_width, 0);
CB(group_all, 0);
#undef CB
@ -512,6 +513,7 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
CX(_("Enable special Terminology escape codes"), ty_escapes, 0);
CX(_("Open new terminals in current working directory"), changedir_to_current, 0);
CX(_("Treat Emojis as double-width characters"), emoji_dbl_width, 0);
CX(_("When grouping input, do it to all terminals and not just the visible ones"), group_all, 0);
#undef CX