config: add "active_links_color"
This commit is contained in:
parent
d84304fc2e
commit
c011c48720
|
@ -7,7 +7,7 @@
|
||||||
#include "col.h"
|
#include "col.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#define CONF_VER 24
|
#define CONF_VER 25
|
||||||
#define CONFIG_KEY "config"
|
#define CONFIG_KEY "config"
|
||||||
|
|
||||||
#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
|
#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
|
||||||
|
@ -133,6 +133,8 @@ config_init(void)
|
||||||
(edd_base, Config, "active_links_url", active_links_url, EET_T_UCHAR);
|
(edd_base, Config, "active_links_url", active_links_url, EET_T_UCHAR);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC
|
EET_DATA_DESCRIPTOR_ADD_BASIC
|
||||||
(edd_base, Config, "active_links_escape", active_links_escape, EET_T_UCHAR);
|
(edd_base, Config, "active_links_escape", active_links_escape, EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC
|
||||||
|
(edd_base, Config, "active_links_color", active_links_color, EET_T_UCHAR);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC
|
EET_DATA_DESCRIPTOR_ADD_BASIC
|
||||||
(edd_base, Config, "translucent", translucent, EET_T_UCHAR);
|
(edd_base, Config, "translucent", translucent, EET_T_UCHAR);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC
|
EET_DATA_DESCRIPTOR_ADD_BASIC
|
||||||
|
@ -296,6 +298,7 @@ config_sync(const Config *config_src, Config *config)
|
||||||
config->active_links_file = config_src->active_links_file;
|
config->active_links_file = config_src->active_links_file;
|
||||||
config->active_links_url = config_src->active_links_url;
|
config->active_links_url = config_src->active_links_url;
|
||||||
config->active_links_escape = config_src->active_links_escape;
|
config->active_links_escape = config_src->active_links_escape;
|
||||||
|
config->active_links_color = config_src->active_links_color;
|
||||||
config->mute = config_src->mute;
|
config->mute = config_src->mute;
|
||||||
config->visualize = config_src->visualize;
|
config->visualize = config_src->visualize;
|
||||||
config->urg_bell = config_src->urg_bell;
|
config->urg_bell = config_src->urg_bell;
|
||||||
|
@ -563,6 +566,7 @@ config_new(void)
|
||||||
config->active_links_file = EINA_TRUE;
|
config->active_links_file = EINA_TRUE;
|
||||||
config->active_links_url = EINA_TRUE;
|
config->active_links_url = EINA_TRUE;
|
||||||
config->active_links_escape = EINA_TRUE;
|
config->active_links_escape = EINA_TRUE;
|
||||||
|
config->active_links_color = EINA_TRUE;
|
||||||
config->translucent = EINA_FALSE;
|
config->translucent = EINA_FALSE;
|
||||||
config->mute = EINA_FALSE;
|
config->mute = EINA_FALSE;
|
||||||
config->visualize = EINA_TRUE;
|
config->visualize = EINA_TRUE;
|
||||||
|
@ -736,7 +740,15 @@ config_load(void)
|
||||||
config->group_all = EINA_FALSE;
|
config->group_all = EINA_FALSE;
|
||||||
EINA_FALLTHROUGH;
|
EINA_FALLTHROUGH;
|
||||||
/*pass through*/
|
/*pass through*/
|
||||||
case CONF_VER: /* 24 */
|
case 24:
|
||||||
|
config->active_links_color = (
|
||||||
|
config->active_links_email ||
|
||||||
|
config->active_links_file ||
|
||||||
|
config->active_links_url ||
|
||||||
|
config->active_links_escape);
|
||||||
|
EINA_FALLTHROUGH;
|
||||||
|
/*pass through*/
|
||||||
|
case CONF_VER: /* 25 */
|
||||||
config->version = CONF_VER;
|
config->version = CONF_VER;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct _Config
|
||||||
Eina_Bool active_links_file;
|
Eina_Bool active_links_file;
|
||||||
Eina_Bool active_links_url;
|
Eina_Bool active_links_url;
|
||||||
Eina_Bool active_links_escape;
|
Eina_Bool active_links_escape;
|
||||||
|
Eina_Bool active_links_color;
|
||||||
Eina_Bool translucent;
|
Eina_Bool translucent;
|
||||||
Eina_Bool mute;
|
Eina_Bool mute;
|
||||||
Eina_Bool visualize;
|
Eina_Bool visualize;
|
||||||
|
|
|
@ -2474,10 +2474,10 @@ _smart_mouseover_apply(Termio *sd)
|
||||||
|
|
||||||
s = termio_link_find(sd->self, sd->mouse.cx, sd->mouse.cy,
|
s = termio_link_find(sd->self, sd->mouse.cx, sd->mouse.cy,
|
||||||
&x1, &y1, &x2, &y2);
|
&x1, &y1, &x2, &y2);
|
||||||
if (!s)
|
if (!s && config->active_links_color)
|
||||||
{
|
{
|
||||||
uint8_t r = 0, g = 0, b = 0, a = 0;
|
uint8_t r = 0, g = 0, b = 0, a = 0;
|
||||||
/* TODO: boris: check config */
|
|
||||||
if (termio_color_find(sd->self, sd->mouse.cx, sd->mouse.cy,
|
if (termio_color_find(sd->self, sd->mouse.cx, sd->mouse.cy,
|
||||||
&x1, &y1, &x2, &y2, &r, &g, &b, &a))
|
&x1, &y1, &x2, &y2, &r, &g, &b, &a))
|
||||||
{
|
{
|
||||||
|
@ -2491,6 +2491,8 @@ _smart_mouseover_apply(Termio *sd)
|
||||||
termio_remove_links(sd);
|
termio_remove_links(sd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!s)
|
||||||
|
return;
|
||||||
|
|
||||||
if (link_is_url(s))
|
if (link_is_url(s))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue