Remove the instances of :buttons(awful.button()).

Having buttons without an awful.util.table.join/gears.table.join
has never been officially documented to be supported. I hope there
isn't too many of those and they wont try to mix the new and old
API syntax, because that will totally break.
This commit is contained in:
Emmanuel Lepage Vallee 2019-10-06 03:04:51 -04:00
parent cf0385af80
commit ab1e62a332
3 changed files with 21 additions and 12 deletions

View File

@ -730,16 +730,20 @@ function titlebar.widget.button(c, name, selector, action)
end end
ret.state = "" ret.state = ""
if action then if action then
ret:buttons(abutton({ }, 1, nil, function() ret.buttons = {
ret.state = "" abutton({ }, 1, nil, function()
update() ret.state = ""
action(c, selector(c)) update()
end)) action(c, selector(c))
end)
}
else else
ret:buttons(abutton({ }, 1, nil, function() ret.buttons = {
ret.state = "" abutton({ }, 1, nil, function()
update() ret.state = ""
end)) update()
end)
}
end end
ret:connect_signal("mouse::enter", function() ret:connect_signal("mouse::enter", function()
ret.state = "hover" ret.state = "hover"

View File

@ -212,7 +212,9 @@ function tooltip:get_wibox()
-- Close the tooltip when clicking it. This gets done on release, to not -- Close the tooltip when clicking it. This gets done on release, to not
-- emit the release event on an underlying object, e.g. the titlebar icon. -- emit the release event on an underlying object, e.g. the titlebar icon.
wb:buttons(a_button({}, 1, nil, self.hide)) wb.buttons = {
a_button({}, 1, nil, self.hide)
}
self._private.wibox = wb self._private.wibox = wb

View File

@ -46,8 +46,11 @@ function button.new(args)
orig_set_image(self, img_release) orig_set_image(self, img_release)
end end
w:set_image(args.image) w:set_image(args.image)
w:buttons(abutton({}, 1, function () orig_set_image(w, img_press) end,
function () orig_set_image(w, img_release) end)) w.buttons = {
abutton({}, 1, function () orig_set_image(w, img_press) end,
function () orig_set_image(w, img_release) end)
}
w:connect_signal("mouse::leave", function(self) orig_set_image(self, img_release) end) w:connect_signal("mouse::leave", function(self) orig_set_image(self, img_release) end)