widget: Move 'widget_buttons' into _private

This commit is contained in:
Emmanuel Lepage Vallee 2016-05-26 14:05:49 -04:00
parent c828e56b57
commit afa17fd8f9
1 changed files with 4 additions and 4 deletions

View File

@ -27,10 +27,10 @@ base.widget = {}
-- @function buttons -- @function buttons
function base.widget:buttons(_buttons) function base.widget:buttons(_buttons)
if _buttons then if _buttons then
self.widget_buttons = _buttons self._private.widget_buttons = _buttons
end end
return self.widget_buttons return self._private.widget_buttons
end end
--- Set a widget's visible property --- Set a widget's visible property
@ -302,7 +302,7 @@ function base.handle_button(event, widget, x, y, button, modifiers, geometry)
-- Find all matching button objects -- Find all matching button objects
local matches = {} local matches = {}
for _, v in pairs(widget.widget_buttons) do for _, v in pairs(widget._private.widget_buttons) do
local match = true local match = true
-- Is it the right button? -- Is it the right button?
if v.button ~= 0 and v.button ~= button then match = false end if v.button ~= 0 and v.button ~= button then match = false end
@ -536,7 +536,7 @@ function base.make_widget(proxy, widget_name, args)
rawset(ret, "_private", {}) rawset(ret, "_private", {})
-- No buttons yet -- No buttons yet
ret.widget_buttons = {} ret._private.widget_buttons = {}
-- Widget is visible -- Widget is visible
ret.visible = true ret.visible = true