This commit is contained in:
petrihakkinen 2021-01-31 15:08:19 +01:00 committed by GitHub
commit 40d6ec7e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -427,9 +427,14 @@ function RootView:on_mouse_pressed(button, x, y, clicks)
local node = self.root_node:get_child_overlapping_point(x, y)
local idx = node:get_tab_overlapping_point(x, y)
if idx then
local old_view = core.active_view
if old_view == node.views[idx] then old_view = nil end
node:set_active_view(node.views[idx])
if button == "middle" then
node:close_active_view(self.root_node)
if old_view then
node:set_active_view(old_view)
end
end
else
core.set_active_view(node.active_view)