mirror of
https://github.com/airstruck/luigi.git
synced 2025-11-18 12:25:06 +00:00
move reflow to widgets
This commit is contained in:
@@ -144,10 +144,7 @@ end
|
||||
function Input:handleReshape (width, height)
|
||||
local layout = self.layout
|
||||
local root = layout.root
|
||||
for i, widget in ipairs(layout.widgets) do
|
||||
widget.position = {}
|
||||
widget.dimensions = {}
|
||||
end
|
||||
layout.root:reflow()
|
||||
root.width = width
|
||||
root.height = height
|
||||
Event.Reshape:emit(root, {
|
||||
|
||||
@@ -61,14 +61,6 @@ function Layout:hide ()
|
||||
self:unhook()
|
||||
end
|
||||
|
||||
-- Reflow the layout. Call this after you change widget positions/dimensions.
|
||||
function Layout:reflow (reshape)
|
||||
for i, widget in ipairs(self.widgets) do
|
||||
widget.position = {}
|
||||
widget.dimensions = {}
|
||||
end
|
||||
end
|
||||
|
||||
-- Get the innermost widget at a position, within a root widget.
|
||||
-- Should always return a widget since all positions are within
|
||||
-- the layout's root widget.
|
||||
|
||||
@@ -232,12 +232,12 @@ function Widget:getAncestors (includeSelf)
|
||||
end
|
||||
end
|
||||
|
||||
-- Reflow the widget. Call this after changing position/dimensions.
|
||||
function Widget:reflow ()
|
||||
self.position = {}
|
||||
self.dimensions = {}
|
||||
for i, widget in ipairs(self.children) do
|
||||
widget.position = {}
|
||||
widget.dimensions = {}
|
||||
widget:reflow()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user