Merge branch 'master' into dev

This commit is contained in:
jgmdev 2021-06-18 10:56:03 -04:00
commit dcf8a91db5
3 changed files with 10 additions and 6 deletions

View File

@ -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.

View File

@ -295,7 +295,7 @@ function Node:tab_hovered_update(px, py)
if tab_index then if tab_index then
local x, y, w, h = self:get_tab_rect(tab_index) local x, y, w, h = self:get_tab_rect(tab_index)
local cx, cw = close_button_location(x, w) local cx, cw = close_button_location(x, w)
if px >= cx and px < cx + cw and py >= y and py < y + h then if px >= cx and px < cx + cw and py >= y and py < y + h and config.tab_close_button then
self.hovered_close = tab_index self.hovered_close = tab_index
end end
else else
@ -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)

View File

@ -32,6 +32,9 @@ local function set_scale(scale)
local s = scale / current_scale local s = scale / current_scale
current_scale = scale current_scale = scale
-- we set scale_level in case this was called by user
scale_level = (scale - default_scale) / scale_steps
if config.scale_mode == "ui" then if config.scale_mode == "ui" then
SCALE = scale SCALE = scale