mirror of
https://github.com/airstruck/luigi.git
synced 2025-11-18 12:25:06 +00:00
Emit Show/Hide events when a layout is shown or hidden. (#63)
This commit is contained in:
@@ -47,6 +47,8 @@ Event.names = {
|
||||
'Press', -- A pointer button was pressed and released on the same widget.
|
||||
'Change', -- A widget's value changed.
|
||||
'WheelMove', -- The scroll wheel on the mouse moved.
|
||||
'Show', -- A layout is shown.
|
||||
'Hide', -- A layout is hidden.
|
||||
}
|
||||
|
||||
local weakKeyMeta = { __mode = 'k' }
|
||||
|
||||
@@ -195,6 +195,7 @@ function Layout:show ()
|
||||
Backend.show(self)
|
||||
self.root:reshape()
|
||||
|
||||
Event.Show:emit(self, self)
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -213,6 +214,7 @@ function Layout:hide ()
|
||||
self.isShown = nil
|
||||
Backend.hide(self)
|
||||
|
||||
Event.Hide:emit(self, self)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user