summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-30 21:54:53 +0200
committerBoris Faure <billiob@gmail.com>2019-09-30 21:55:47 +0200
commit9a2ddd8468cd104a82c1f35ec61108ed4ed18493 (patch)
tree761a5fb7c33b49f14b935316072e159253684839
parentdc1ddf7e405b8c1a99f8a1cb270c84840531e983 (diff)
win: update terms on change of config about show_tabs
-rw-r--r--src/bin/win.c120
1 files changed, 67 insertions, 53 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 0d5ca46..e90b542 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -628,12 +628,6 @@ _solo_focus(Term_Container *tc, Term_Container *relative)
628 term->missed_bell = EINA_FALSE; 628 term->missed_bell = EINA_FALSE;
629} 629}
630 630
631static void
632_solo_update(Term_Container *tc)
633{
634 assert (tc->type == TERM_CONTAINER_TYPE_SOLO);
635}
636
637static Eina_Bool 631static Eina_Bool
638_solo_is_visible(Term_Container *tc, Term_Container *_child EINA_UNUSED) 632_solo_is_visible(Term_Container *tc, Term_Container *_child EINA_UNUSED)
639{ 633{
@@ -641,53 +635,6 @@ _solo_is_visible(Term_Container *tc, Term_Container *_child EINA_UNUSED)
641 return tc->parent->is_visible(tc->parent, tc); 635 return tc->parent->is_visible(tc->parent, tc);
642} 636}
643 637
644static Term_Container *
645_solo_new(Term *term, Win *wn)
646{
647 Term_Container *tc = NULL;
648 Solo *solo = NULL;
649 solo = calloc(1, sizeof(Solo));
650 if (!solo)
651 {
652 free(solo);
653 return NULL;
654 }
655
656 tc = (Term_Container*)solo;
657 tc->term_next = _solo_term_next;
658 tc->term_prev = _solo_term_prev;
659 tc->term_up = _solo_term_up;
660 tc->term_down = _solo_term_down;
661 tc->term_left = _solo_term_left;
662 tc->term_right = _solo_term_right;
663 tc->term_first = _solo_term_first;
664 tc->term_last = _solo_term_last;
665 tc->focused_term_get = _solo_focused_term_get;
666 tc->get_evas_object = _solo_get_evas_object;
667 tc->split = _solo_split;
668 tc->find_term_at_coords = _solo_find_term_at_coords;
669 tc->size_eval = _solo_size_eval;
670 tc->swallow = NULL;
671 tc->focus = _solo_focus;
672 tc->unfocus = _solo_unfocus;
673 tc->set_title = _solo_set_title;
674 tc->bell = _solo_bell;
675 tc->close = _solo_close;
676 tc->update = _solo_update;
677 tc->title = eina_stringshare_add("Terminology");
678 tc->is_visible = _solo_is_visible;
679 tc->type = TERM_CONTAINER_TYPE_SOLO;
680
681 tc->parent = NULL;
682 tc->wn = wn;
683
684 solo->term = term;
685
686 term->container = tc;
687
688 return tc;
689}
690
691static void 638static void
692_solo_title_show(Term_Container *tc) 639_solo_title_show(Term_Container *tc)
693{ 640{
@@ -743,6 +690,73 @@ _solo_title_hide(Term_Container *tc)
743 } 690 }
744} 691}
745 692
693static void
694_solo_update(Term_Container *tc)
695{
696 Solo *solo;
697 Term *term;
698 Term_Container *tc_parent = tc->parent;
699
700 assert (tc->type == TERM_CONTAINER_TYPE_SOLO);
701 solo = (Solo*) tc;
702 term = solo->term;
703
704 if (tc_parent->type == TERM_CONTAINER_TYPE_SPLIT)
705 {
706 if (term->config->show_tabs)
707 _solo_title_show(tc);
708 else
709 _solo_title_hide(tc);
710 }
711}
712
713static Term_Container *
714_solo_new(Term *term, Win *wn)
715{
716 Term_Container *tc = NULL;
717 Solo *solo = NULL;
718 solo = calloc(1, sizeof(Solo));
719 if (!solo)
720 {
721 free(solo);
722 return NULL;
723 }
724
725 tc = (Term_Container*)solo;
726 tc->term_next = _solo_term_next;
727 tc->term_prev = _solo_term_prev;
728 tc->term_up = _solo_term_up;
729 tc->term_down = _solo_term_down;
730 tc->term_left = _solo_term_left;
731 tc->term_right = _solo_term_right;
732 tc->term_first = _solo_term_first;
733 tc->term_last = _solo_term_last;
734 tc->focused_term_get = _solo_focused_term_get;
735 tc->get_evas_object = _solo_get_evas_object;
736 tc->split = _solo_split;
737 tc->find_term_at_coords = _solo_find_term_at_coords;
738 tc->size_eval = _solo_size_eval;
739 tc->swallow = NULL;
740 tc->focus = _solo_focus;
741 tc->unfocus = _solo_unfocus;
742 tc->set_title = _solo_set_title;
743 tc->bell = _solo_bell;
744 tc->close = _solo_close;
745 tc->update = _solo_update;
746 tc->title = eina_stringshare_add("Terminology");
747 tc->is_visible = _solo_is_visible;
748 tc->type = TERM_CONTAINER_TYPE_SOLO;
749
750 tc->parent = NULL;
751 tc->wn = wn;
752
753 solo->term = term;
754
755 term->container = tc;
756
757 return tc;
758}
759
746/* }}} */ 760/* }}} */
747/* {{{ Win */ 761/* {{{ Win */
748 762