Closing a view with middle button no longer changes the active view.

This commit is contained in:
Petri Hakkinen 2020-05-11 22:23:58 +03:00
parent af36658e68
commit 33ed9be1a7
1 changed files with 5 additions and 0 deletions

View File

@ -408,9 +408,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
if node.active_view.focusable then