summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-26 22:49:11 +0200
committerBoris Faure <billiob@gmail.com>2019-09-30 21:55:42 +0200
commit5996e5eb2cb5e3481b1258cba965afd00722c8bf (patch)
tree5883ca9c39e5d23595c404feb7e3bf67719832f4
parentea0812eccd8fbd59fca1408e10baf67e6632ebba (diff)
win: show title tab on splits when config is set accordingly
-rw-r--r--src/bin/win.c93
1 files changed, 92 insertions, 1 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index ae330ea..8a0124f 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -508,8 +508,20 @@ _solo_set_title(Term_Container *tc,
508 Term_Container *_child EINA_UNUSED, 508 Term_Container *_child EINA_UNUSED,
509 const char *title) 509 const char *title)
510{ 510{
511 Solo *solo;
512 Term *term;
513
514 assert (tc->type == TERM_CONTAINER_TYPE_SOLO);
515 solo = (Solo*) tc;
516 term = solo->term;
517
511 eina_stringshare_del(tc->title); 518 eina_stringshare_del(tc->title);
512 tc->title = eina_stringshare_add(title); 519 tc->title = eina_stringshare_add(title);
520 if (!term->config->notabs)
521 {
522 edje_object_part_text_set(term->bg, "terminology.tab.title",
523 title);
524 }
513 tc->parent->set_title(tc->parent, tc, title); 525 tc->parent->set_title(tc->parent, tc, title);
514} 526}
515 527
@@ -676,6 +688,61 @@ _solo_new(Term *term, Win *wn)
676 return tc; 688 return tc;
677} 689}
678 690
691static void
692_solo_title_show(Term_Container *tc)
693{
694 Solo *solo;
695 Term *term;
696
697 assert (tc->type == TERM_CONTAINER_TYPE_SOLO);
698 solo = (Solo*) tc;
699 term = solo->term;
700
701 if (!term->tab_spacer)
702 {
703 Evas_Coord w = 0, h = 0;
704
705 term->tab_spacer = evas_object_rectangle_add(
706 evas_object_evas_get(term->bg));
707 evas_object_color_set(term->tab_spacer, 0, 0, 0, 0);
708 elm_coords_finger_size_adjust(1, &w, 1, &h);
709 evas_object_size_hint_min_set(term->tab_spacer, w, h);
710 edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer);
711 edje_object_part_drag_value_set(term->bg, "terminology.tabl", 0.0, 0.0);
712 edje_object_part_drag_value_set(term->bg, "terminology.tabr", 1.0, 0.0);
713 edje_object_part_text_set(term->bg, "terminology.tab.title",
714 solo->tc.title);
715 edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
716 edje_object_message_signal_process(term->bg);
717 }
718 else
719 {
720 edje_object_part_drag_value_set(term->bg, "terminology.tabl", 0.0, 0.0);
721 edje_object_part_drag_value_set(term->bg, "terminology.tabr", 1.0, 0.0);
722 edje_object_message_signal_process(term->bg);
723 }
724}
725
726static void
727_solo_title_hide(Term_Container *tc)
728{
729 Solo *solo;
730 Term *term;
731
732 assert (tc->type == TERM_CONTAINER_TYPE_SOLO);
733 solo = (Solo*) tc;
734 term = solo->term;
735
736 if (term->tab_spacer)
737 {
738 edje_object_signal_emit(term->bg, "tabbar,off", "terminology");
739 edje_object_message_signal_process(term->bg);
740 edje_object_part_unswallow(term->bg, term->tab_spacer);
741 evas_object_del(term->tab_spacer);
742 term->tab_spacer = NULL;
743 }
744}
745
679/* }}} */ 746/* }}} */
680/* {{{ Win */ 747/* {{{ Win */
681 748
@@ -1096,6 +1163,12 @@ _win_swallow(Term_Container *tc, Term_Container *orig,
1096 o = new_child->get_evas_object(new_child); 1163 o = new_child->get_evas_object(new_child);
1097 elm_layout_content_set(wn->base, "terminology.content", o); 1164 elm_layout_content_set(wn->base, "terminology.content", o);
1098 1165
1166 if ((new_child->type == TERM_CONTAINER_TYPE_SOLO
1167 && (!wn->config->notabs)))
1168 {
1169 _solo_title_hide(new_child);
1170 }
1171
1099 evas_object_show(o); 1172 evas_object_show(o);
1100 new_child->parent = tc; 1173 new_child->parent = tc;
1101 wn->child = new_child; 1174 wn->child = new_child;
@@ -1270,6 +1343,14 @@ _win_split(Term_Container *tc, Term_Container *child,
1270 elm_layout_content_unset(wn->base, "terminology.content"); 1343 elm_layout_content_unset(wn->base, "terminology.content");
1271 1344
1272 tc_split = _split_new(child, tc_solo_new, is_horizontal); 1345 tc_split = _split_new(child, tc_solo_new, is_horizontal);
1346 if (!wn->config->notabs)
1347 {
1348 if (child->type == TERM_CONTAINER_TYPE_SOLO)
1349 {
1350 _solo_title_show(child);
1351 }
1352 _solo_title_show(tc_solo_new);
1353 }
1273 1354
1274 tc_split->is_focused = tc->is_focused; 1355 tc_split->is_focused = tc->is_focused;
1275 tc->swallow(tc, NULL, tc_split); 1356 tc->swallow(tc, NULL, tc_split);
@@ -2509,6 +2590,11 @@ _split_split(Term_Container *tc, Term_Container *child,
2509 tc_split->is_focused = tc->is_focused; 2590 tc_split->is_focused = tc->is_focused;
2510 tc->swallow(tc, child, tc_split); 2591 tc->swallow(tc, child, tc_split);
2511 2592
2593 if (!wn->config->notabs)
2594 {
2595 _solo_title_show(tc_solo_new);
2596 }
2597
2512 evas_object_show(obj_split); 2598 evas_object_show(obj_split);
2513} 2599}
2514 2600
@@ -2521,6 +2607,7 @@ _split_is_visible(Term_Container *tc, Term_Container *_child EINA_UNUSED)
2521 return tc->parent->is_visible(tc->parent, tc); 2607 return tc->parent->is_visible(tc->parent, tc);
2522} 2608}
2523 2609
2610/* tc1 is a new solo */
2524static Term_Container * 2611static Term_Container *
2525_split_new(Term_Container *tc1, Term_Container *tc2, 2612_split_new(Term_Container *tc1, Term_Container *tc2,
2526 Eina_Bool is_horizontal) 2613 Eina_Bool is_horizontal)
@@ -3227,17 +3314,21 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3227 { 3314 {
3228 Term *next_term; 3315 Term *next_term;
3229 Solo *next_solo; 3316 Solo *next_solo;
3317 Config *config;
3230 3318
3231 assert (next_child->type == TERM_CONTAINER_TYPE_SOLO); 3319 assert (next_child->type == TERM_CONTAINER_TYPE_SOLO);
3232 next_solo = (Solo*)next_child; 3320 next_solo = (Solo*)next_child;
3233 next_term = next_solo->term; 3321 next_term = next_solo->term;
3322 config = next_term->config;
3234 3323
3235 edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology"); 3324 edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology");
3236 if (next_term->tabcount_spacer) 3325 if (next_term->tabcount_spacer && config->notabs)
3237 { 3326 {
3238 evas_object_del(next_term->tabcount_spacer); 3327 evas_object_del(next_term->tabcount_spacer);
3239 next_term->tabcount_spacer = NULL; 3328 next_term->tabcount_spacer = NULL;
3240 } 3329 }
3330 if (!config->notabs)
3331 _solo_title_show(next_child);
3241 3332
3242 if (tabs->selector) 3333 if (tabs->selector)
3243 _tabs_restore(tabs); 3334 _tabs_restore(tabs);