summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorGwang O Lee <pu8046@gmail.com>2014-09-20 11:05:32 +0200
committerBoris Faure <billiob@gmail.com>2014-09-20 11:11:08 +0200
commit86002b6b121e469b29ae9c26f67757ec8e134c66 (patch)
treea254d18f2d9d0da8c9384abd0add99c2be123df8 /src/bin
parent9879be313b12fe2dd18c3810464e4dd327aa1534 (diff)
Add "Miniview" and "Close Terminal" controls
Miniview button and icon are added. Thank you! Reviewers: seoz, raster, billiob Subscribers: seoz Differential Revision: https://phab.enlightenment.org/D1442
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/controls.c58
1 files changed, 40 insertions, 18 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index d18320e..365cd3a 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -7,8 +7,8 @@
7#include "termio.h" 7#include "termio.h"
8#include "main.h" 8#include "main.h"
9 9
10static Evas_Object *ct_frame = NULL, *ct_boxh = NULL, *ct_box = NULL; 10static Evas_Object *ct_frame = NULL, *ct_boxh = NULL, *ct_boxv = NULL;
11static Evas_Object *ct_box2 = NULL, *ct_over = NULL; 11static Evas_Object *ct_box = NULL, *ct_box2 = NULL, *ct_box3 = NULL, *ct_over = NULL;
12static Eina_Bool ct_out = EINA_FALSE; 12static Eina_Bool ct_out = EINA_FALSE;
13static Ecore_Timer *ct_del_timer = NULL; 13static Ecore_Timer *ct_del_timer = NULL;
14static Evas_Object *ct_win = NULL, *ct_bg = NULL, *ct_term = NULL; 14static Evas_Object *ct_win = NULL, *ct_bg = NULL, *ct_term = NULL;
@@ -86,6 +86,12 @@ _cb_ct_split_h(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
86} 86}
87 87
88static void 88static void
89_cb_ct_miniview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
90{
91 term_miniview_toggle(termio_term_get(ct_term));
92}
93
94static void
89_cb_ct_close(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) 95_cb_ct_close(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
90{ 96{
91 main_close(ct_win, ct_term); 97 main_close(ct_win, ct_term);
@@ -240,36 +246,41 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
240 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 246 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
241 elm_object_text_set(o, _("Controls")); 247 elm_object_text_set(o, _("Controls"));
242 248
249 ct_boxv = o = elm_box_add(win);
250 elm_box_horizontal_set(o, EINA_FALSE);
251 elm_object_content_set(ct_frame, o);
252 evas_object_show(o);
253
243 ct_boxh = o = elm_box_add(win); 254 ct_boxh = o = elm_box_add(win);
255 elm_box_pack_end(ct_boxv, o);
244 elm_box_horizontal_set(o, EINA_TRUE); 256 elm_box_horizontal_set(o, EINA_TRUE);
245 elm_object_content_set(ct_frame, o);
246 evas_object_show(o); 257 evas_object_show(o);
247 258
248 ct_box2 = o = elm_box_add(win); 259 ct_box = o = elm_box_add(win);
249 elm_box_pack_end(ct_boxh, o); 260 elm_box_pack_end(ct_boxh, o);
250 evas_object_show(o); 261 evas_object_show(o);
251 262
252 o = _button_add(win, _("New"), "new", _cb_ct_new, NULL); 263 o = _button_add(win, _("New"), "new", _cb_ct_new, NULL);
253 elm_box_pack_end(ct_box2, o); 264 elm_box_pack_end(ct_box, o);
254 265
255 o = _sep_add_h(win); 266 o = _sep_add_h(win);
256 elm_box_pack_end(ct_box2, o); 267 elm_box_pack_end(ct_box, o);
257 268
258 o = _button_add(win, _("Split V"), "split-h", _cb_ct_split_v, NULL); 269 o = _button_add(win, _("Split V"), "split-h", _cb_ct_split_v, NULL);
259 elm_box_pack_end(ct_box2, o); 270 elm_box_pack_end(ct_box, o);
260 o = _button_add(win, _("Split H"), "split-v", _cb_ct_split_h, NULL); 271 o = _button_add(win, _("Split H"), "split-v", _cb_ct_split_h, NULL);
261 elm_box_pack_end(ct_box2, o); 272 elm_box_pack_end(ct_box, o);
262 273
263 o = _sep_add_h(win); 274 o = _sep_add_h(win);
264 elm_box_pack_end(ct_box2, o); 275 elm_box_pack_end(ct_box, o);
265 276
266 o = _button_add(win, _("Close"), "close", _cb_ct_close, NULL); 277 o = _button_add(win, _("Miniview"), "mini-view", _cb_ct_miniview, NULL);
267 elm_box_pack_end(ct_box2, o); 278 elm_box_pack_end(ct_box, o);
268 279
269 o = _sep_add_v(win); 280 o = _sep_add_v(win);
270 elm_box_pack_end(ct_boxh, o); 281 elm_box_pack_end(ct_boxh, o);
271 282
272 ct_box = o = elm_box_add(win); 283 ct_box2 = o = elm_box_add(win);
273 elm_box_pack_end(ct_boxh, o); 284 elm_box_pack_end(ct_boxh, o);
274 evas_object_show(o); 285 evas_object_show(o);
275 286
@@ -277,21 +288,32 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
277 evas_object_data_set(ct_frame, "bt_copy", o); 288 evas_object_data_set(ct_frame, "bt_copy", o);
278 if (!termio_selection_exists(term)) 289 if (!termio_selection_exists(term))
279 elm_object_disabled_set(o, EINA_TRUE); 290 elm_object_disabled_set(o, EINA_TRUE);
280 elm_box_pack_end(ct_box, o); 291 elm_box_pack_end(ct_box2, o);
292
281 o = _button_add(win, _("Paste"), "paste", _cb_ct_paste, NULL); 293 o = _button_add(win, _("Paste"), "paste", _cb_ct_paste, NULL);
282 elm_box_pack_end(ct_box, o); 294 elm_box_pack_end(ct_box2, o);
283 295
284 o = _sep_add_h(win); 296 o = _sep_add_h(win);
285 elm_box_pack_end(ct_box, o); 297 elm_box_pack_end(ct_box2, o);
286 298
287 o = _button_add(win, _("Settings"), "settings", _cb_ct_options, NULL); 299 o = _button_add(win, _("Settings"), "settings", _cb_ct_options, NULL);
288 elm_box_pack_end(ct_box, o); 300 elm_box_pack_end(ct_box2, o);
289 301
290 o = _sep_add_h(win); 302 o = _sep_add_h(win);
291 elm_box_pack_end(ct_box, o); 303 elm_box_pack_end(ct_box2, o);
292 304
293 o = _button_add(win, _("About"), "about", _cb_ct_about, NULL); 305 o = _button_add(win, _("About"), "about", _cb_ct_about, NULL);
294 elm_box_pack_end(ct_box, o); 306 elm_box_pack_end(ct_box2, o);
307
308 o = _sep_add_h(win);
309 elm_box_pack_end(ct_boxv, o);
310
311 ct_box3 = o = elm_box_add(win);
312 elm_box_pack_end(ct_boxv, o);
313 evas_object_show(o);
314
315 o = _button_add(win, _("Close Terminal"), "close", _cb_ct_close, NULL);
316 elm_box_pack_end(ct_box3, o);
295 317
296 evas_object_event_callback_add(ct_frame, EVAS_CALLBACK_DEL, 318 evas_object_event_callback_add(ct_frame, EVAS_CALLBACK_DEL,
297 _cb_frame_del, NULL); 319 _cb_frame_del, NULL);