added config.tab_close_button option to hide X on tabs
This commit is contained in:
parent
eed5b79030
commit
e1d85af69b
|
@ -24,6 +24,7 @@ config.animation_rate = 1.0
|
||||||
config.blink_period = 0.8
|
config.blink_period = 0.8
|
||||||
config.draw_whitespace = false
|
config.draw_whitespace = false
|
||||||
config.borderless = false
|
config.borderless = false
|
||||||
|
config.tab_close_button = true
|
||||||
|
|
||||||
-- Disable plugin loading setting to false the config entry
|
-- Disable plugin loading setting to false the config entry
|
||||||
-- of the same name.
|
-- of the same name.
|
||||||
|
|
|
@ -529,7 +529,7 @@ function Node:draw_tabs()
|
||||||
renderer.draw_rect(x - ds, y, ds, h, style.divider)
|
renderer.draw_rect(x - ds, y, ds, h, style.divider)
|
||||||
end
|
end
|
||||||
local cx, cw, cspace = close_button_location(x, w)
|
local cx, cw, cspace = close_button_location(x, w)
|
||||||
local show_close_button = (view == self.active_view or i == self.hovered_tab)
|
local show_close_button = ((view == self.active_view or i == self.hovered_tab) and config.tab_close_button)
|
||||||
if show_close_button then
|
if show_close_button then
|
||||||
local close_style = self.hovered_close == i and style.text or style.dim
|
local close_style = self.hovered_close == i and style.text or style.dim
|
||||||
common.draw_text(style.icon_font, close_style, "C", nil, cx, y, 0, h)
|
common.draw_text(style.icon_font, close_style, "C", nil, cx, y, 0, h)
|
||||||
|
|
Loading…
Reference in New Issue