background container: Deprecate shape_clip property

The previous commit removed the implementation of this property.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2019-01-28 14:55:53 +01:00
parent ba75da7976
commit 84eb175ccd
2 changed files with 6 additions and 45 deletions

View File

@ -268,20 +268,16 @@ function background:get_shape_border_color()
return self._private.shape_border_color return self._private.shape_border_color
end end
--- When a `shape` is set, make sure nothing is drawn outside of it.
--@DOC_wibox_container_background_clip_EXAMPLE@
-- @property shape_clip
-- @tparam boolean value If the shape clip is enable
function background:set_shape_clip(value) function background:set_shape_clip(value)
if self._private.shape_clip == value then return end if value then return end
require("gears.debug").print_warning("shape_clip property of background container was removed."
self._private.shape_clip = value .. " Use wibox.layout.stack instead if you want shape_clip=false.")
self:emit_signal("widget::redraw_needed")
end end
function background:get_shape_clip() function background:get_shape_clip()
return self._private.shape_clip or false require("gears.debug").print_warning("shape_clip property of background container was removed."
.. " Use wibox.layout.stack instead if you want shape_clip=false.")
return true
end end
--- The background image to use --- The background image to use

View File

@ -1,35 +0,0 @@
--DOC_GEN_IMAGE --DOC_HIDE
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local gears = {shape = require("gears.shape")} --DOC_HIDE
local beautiful = require("beautiful") --DOC_HIDE
parent : setup {
{
-- Some content may be outside of the shape
{
text = "Hello\nworld!",
widget = wibox.widget.textbox
},
shape = gears.shape.circle,
bg = beautiful.bg_normal,
shape_border_color = beautiful.border_color,
widget = wibox.container.background
},
{
-- To solve this, clip the content
{
text = "Hello\nworld!",
widget = wibox.widget.textbox
},
shape_clip = true,
shape = gears.shape.circle,
bg = beautiful.bg_normal,
shape_border_color = beautiful.border_color,
widget = wibox.container.background
},
spacing = 10,
layout = wibox.layout.fixed.vertical
}
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80