widget.button: Release the button when the mouse leave
This isn't correct, but it avoid a bug where the button stay pressed forever if the mouse leave while it's pressed.
This commit is contained in:
parent
c1d9e58f94
commit
ca02ec1bbe
|
@ -39,6 +39,9 @@ function button.new(args)
|
|||
end
|
||||
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:connect_signal("mouse::leave", function(self) orig_set_image(self, img_release) end)
|
||||
|
||||
return w
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue