From c1596f0b4e323fcfe73a9ef5264bd33d0160f032 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Fri, 5 Apr 2019 17:03:12 -0400 Subject: [PATCH] background: Deprecate `shape_border_(width|color)`. In favor of `border_width` and `border_color`. --- lib/wibox/container/background.lua | 31 ++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/wibox/container/background.lua b/lib/wibox/container/background.lua index 5815b35f7..a88d9dd77 100644 --- a/lib/wibox/container/background.lua +++ b/lib/wibox/container/background.lua @@ -15,6 +15,7 @@ local beautiful = require("beautiful") local cairo = require("lgi").cairo local gtable = require("gears.table") local gshape = require("gears.shape") +local gdebug = require("gears.debug") local setmetatable = setmetatable local type = type local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1) @@ -282,8 +283,19 @@ function background:get_border_width() return self._private.shape_border_width end -background.get_shape_border_width = background.get_border_width -background.set_shape_border_width = background.set_border_width +function background.get_shape_border_width(...) + gdebug.deprecate("Use `border_width` instead of `shape_border_width`", + {deprecated_in=5}) + + return background.get_border_width(...) +end + +function background.set_shape_border_width(...) + gdebug.deprecate("Use `border_width` instead of `shape_border_width`", + {deprecated_in=5}) + + background.set_border_width(...) +end --- When a `shape` is set, also draw a border. -- @@ -312,8 +324,19 @@ function background:get_border_color() return self._private.shape_border_color end -background.get_shape_border_color = background.get_border_color -background.set_shape_border_color = background.set_border_color +function background.get_shape_border_color(...) + gdebug.deprecate("Use `border_color` instead of `shape_border_color`", + {deprecated_in=5}) + + return background.get_border_color(...) +end + +function background.set_shape_border_color(...) + gdebug.deprecate("Use `border_color` instead of `shape_border_color`", + {deprecated_in=5}) + + background.set_border_color(...) +end function background:set_shape_clip(value) if value then return end