From 68bfde45e152468e160684d0334d258bee1cba90 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Fri, 21 Dec 2018 21:31:26 -0500 Subject: [PATCH] tooltip: Cleanup the margin API. Make it closer to other APIs across Awesome. --- lib/awful/tooltip.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/awful/tooltip.lua b/lib/awful/tooltip.lua index df0a35db..af5ae373 100644 --- a/lib/awful/tooltip.lua +++ b/lib/awful/tooltip.lua @@ -398,8 +398,13 @@ end -- @tparam number New margins value function tooltip:set_margin_leftright(val) - self.marginbox.left = val - self.marginbox.right = val + self.marginbox:set_left(val) + self.marginbox:set_right(val) +end + +--TODO v5 deprecate this +function tooltip:set_margins_leftright(val) + self:set_margin_leftright(val) end --- Set the margins around the top and bottom of the tooltip textbox @@ -409,8 +414,13 @@ end -- @tparam number New margins value function tooltip:set_margin_topbottom(val) - self.marginbox.top = val - self.marginbox.bottom = val + self.marginbox:set_top(val) + self.marginbox:set_bottom(val) +end + +--TODO v5 deprecate this +function tooltip:set_margins_topbottom(val) + self:set_margin_topbottom(val) end --- Add tooltip to an object.