rootview.lua: Refactor Node:draw_tab
This commit is contained in:
@@ -254,7 +254,7 @@ function RootView:on_mouse_moved(x, y, dx, dy)
|
||||
self.root_node:on_mouse_moved(x, y, dx, dy)
|
||||
|
||||
self.overlapping_node = self.root_node:get_child_overlapping_point(x, y)
|
||||
|
||||
|
||||
local div = self.root_node:get_divider_overlapping_point(x, y)
|
||||
local tab_index = self.overlapping_node and self.overlapping_node:get_tab_overlapping_point(x, y)
|
||||
if self.overlapping_node and self.overlapping_node:get_scroll_button_index(x, y) then
|
||||
@@ -381,8 +381,8 @@ function RootView:draw_grabbed_tab()
|
||||
local _,_, w, h = dn.node:get_tab_rect(dn.idx)
|
||||
local x = self.mouse.x - w / 2
|
||||
local y = self.mouse.y - h / 2
|
||||
local text = dn.node.views[dn.idx] and dn.node.views[dn.idx]:get_name() or ""
|
||||
self.root_node:draw_tab(text, true, true, false, x, y, w, h, true)
|
||||
local view = dn.node.views[dn.idx]
|
||||
self.root_node:draw_tab(view, true, true, false, x, y, w, h, true)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user