more stylish tabs (#95)

This commit is contained in:
liquidev 2021-03-09 14:24:14 +01:00 committed by GitHub
parent b612357371
commit 3af6af654b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -403,11 +403,13 @@ function Node:draw_tabs()
local x, y, w, h = self:get_tab_rect(i) local x, y, w, h = self:get_tab_rect(i)
local text = view:get_name() local text = view:get_name()
local color = style.dim local color = style.dim
renderer.draw_rect(x + w, y, ds, h, style.divider) local padding_y = style.padding.y
renderer.draw_rect(x - ds, y, ds, h, style.divider) renderer.draw_rect(x + w, y + padding_y, ds, h - padding_y * 2, style.dim)
if view == self.active_view then if view == self.active_view then
color = style.text color = style.text
renderer.draw_rect(x, y, w, h, style.background) renderer.draw_rect(x, y, w, h, style.background)
renderer.draw_rect(x + w, 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)