From b0e86d5370bcaad3441c85f4f2af1a2b876a37cc Mon Sep 17 00:00:00 2001 From: gryf Date: Wed, 23 Feb 2022 18:27:03 +0100 Subject: [PATCH] Hide tab even if there is "new" button. It doesn't make sense to distinguish between state when there is only one tab with "new" button visible or not. Let's keep it simple. --- README.rst | 8 ++------ tabbedalt | 8 +++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index 22d0da1..9006044 100644 --- a/README.rst +++ b/README.rst @@ -130,15 +130,11 @@ space:: Autohide ~~~~~~~~ -To hide tab bar, when there is a single tab, the following resource need to be -set to true:: +By default tab bar would be visible even with only one tab. To hide tab bar, +when there is a single tab, the following resource need to be set to true:: URxvt.tabbedalt.autohide: true -By default tab bar would be visible even with only one tab. Note, that it will -be visible regardless of this option, when ``new-button`` is set. So to make -that option work, you'll need to also disable new-button. - Actions ~~~~~~~ diff --git a/tabbedalt b/tabbedalt index 8413be9..c6c1f7c 100644 --- a/tabbedalt +++ b/tabbedalt @@ -245,14 +245,14 @@ sub refresh { my ($self) = @_; my $tabs_no = (@{$self->{tabs}}); - if (! $self->{new_button} && $self->{autohide} && $tabs_no == 1 && + if ($self->{autohide} && $tabs_no == 1 && ! $self->{cur}->{is_being_renamed}) { $self->{tabheight} = 0; $self->configure; $self->copy_properties; return; } else { - $self->{tabheight} = $self->{_tab_height_if_visible}; + $self->{tabheight} = $self->{_tabheight}; $self->configure; $self->copy_properties; } @@ -564,9 +564,7 @@ sub init { _on start => sub { my ($self) = @_; - $self->{_tab_height_if_visible} = $self->int_bwidth + $self->fheight + - $self->lineSpace; - $self->{tabheight} = $self->{autohide}? 0 : $self->{_tab_height_if_visible}; + $self->{_tabheight} = $self->int_bwidth + $self->fheight + $self->lineSpace; $self->cmd_parse ("\033[?25l");