diff --git a/kitty/config.py b/kitty/config.py index b1fee586d..17e156bb1 100644 --- a/kitty/config.py +++ b/kitty/config.py @@ -389,6 +389,7 @@ type_map = { 'close_on_child_death': to_bool, 'window_border_width': positive_float, 'window_margin_width': positive_float, + 'tab_bar_margin_width': positive_float, 'window_padding_width': positive_float, 'wheel_scroll_multiplier': float, 'visual_bell_duration': positive_float, diff --git a/kitty/kitty.conf b/kitty/kitty.conf index b3730e9d1..362616559 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -223,6 +223,9 @@ inactive_text_alpha 1.0 # Which edge to show the tab bar on, top or bottom tab_bar_edge bottom +# The margin to the left and right of the tab bar (in pts) +tab_bar_margin_width 0 + # The separator between tabs in the tab bar tab_separator " ┇" diff --git a/kitty/tabs.py b/kitty/tabs.py index d731fa52c..4e44f3f81 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -307,6 +307,7 @@ class TabBar: # {{{ self.os_window_id = os_window_id self.opts = opts self.num_tabs = 1 + self.margin_width = pt_to_px(self.opts.tab_bar_margin_width, self.os_window_id) self.cell_width, cell_height = cell_size_for_window(self.os_window_id) self.data_buffer_size = 0 self.laid_out_once = False @@ -353,12 +354,12 @@ class TabBar: # {{{ return self.cell_width = cell_width s = self.screen - viewport_width = tab_bar.width + viewport_width = tab_bar.width - 2 * self.margin_width ncells = viewport_width // cell_width s.resize(1, ncells) s.reset_mode(DECAWM) self.laid_out_once = True - margin = (viewport_width - ncells * cell_width) // 2 + margin = (viewport_width - ncells * cell_width) // 2 + self.margin_width self.window_geometry = g = WindowGeometry( margin, tab_bar.top, viewport_width - margin, tab_bar.bottom, s.columns, s.lines) if margin > 0: