diff options
author | Gustavo Sverzut Barbieri <barbieri@gmail.com> | 2012-08-23 15:47:24 +0000 |
---|---|---|
committer | Gustavo Sverzut Barbieri <barbieri@gmail.com> | 2012-08-23 15:47:24 +0000 |
commit | 9237fe77865a8bfd94a144111570699e60106ef8 (patch) | |
tree | f5f30f8090c5af28b05f973ae32dd3a6f50b9ae0 /src | |
parent | 302a0987402a11f2d75f95e158d8f20e9aef8b37 (diff) |
open links with applications if "Control" is pressed.
It's handy to preview things in the terminal, but sometimes we want to
use the external applications (high res image to see details), then
holding "Control" while clicking the link will force the default
application.
SVN revision: 75631
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/termio.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c index 84c12ac..6684fbc 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c | |||
@@ -79,6 +79,23 @@ static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; | |||
79 | 79 | ||
80 | static void _smart_calculate(Evas_Object *obj); | 80 | static void _smart_calculate(Evas_Object *obj); |
81 | 81 | ||
82 | static inline Eina_Bool | ||
83 | _should_inline(const Evas_Object *obj) | ||
84 | { | ||
85 | const Config *config = termio_config_get(obj); | ||
86 | const Evas *e; | ||
87 | const Evas_Modifier *mods; | ||
88 | |||
89 | if (!config->helper.inline_please) return EINA_FALSE; | ||
90 | |||
91 | e = evas_object_evas_get(obj); | ||
92 | mods = evas_key_modifier_get(e); | ||
93 | |||
94 | if (evas_key_modifier_is_set(mods, "Control")) return EINA_FALSE; | ||
95 | |||
96 | return EINA_TRUE; | ||
97 | } | ||
98 | |||
82 | static void | 99 | static void |
83 | _activate_link(Evas_Object *obj) | 100 | _activate_link(Evas_Object *obj) |
84 | { | 101 | { |
@@ -121,7 +138,7 @@ _activate_link(Evas_Object *obj) | |||
121 | cmd = "xdg-open"; | 138 | cmd = "xdg-open"; |
122 | 139 | ||
123 | type = media_src_type_get(sd->link.string); | 140 | type = media_src_type_get(sd->link.string); |
124 | if (config->helper.inline_please) | 141 | if (_should_inline(obj)) |
125 | { | 142 | { |
126 | if ((type == TYPE_IMG) || | 143 | if ((type == TYPE_IMG) || |
127 | (type == TYPE_SCALE) || | 144 | (type == TYPE_SCALE) || |
@@ -167,7 +184,7 @@ _activate_link(Evas_Object *obj) | |||
167 | cmd = "xdg-open"; | 184 | cmd = "xdg-open"; |
168 | 185 | ||
169 | type = media_src_type_get(sd->link.string); | 186 | type = media_src_type_get(sd->link.string); |
170 | if (config->helper.inline_please) | 187 | if (_should_inline(obj)) |
171 | { | 188 | { |
172 | if ((type == TYPE_IMG) || | 189 | if ((type == TYPE_IMG) || |
173 | (type == TYPE_SCALE) || | 190 | (type == TYPE_SCALE) || |