background: Avoid some redraw
This commit is contained in:
parent
00ee99851b
commit
f517538b6a
|
@ -185,6 +185,10 @@ end
|
||||||
-- @see gears.shape
|
-- @see gears.shape
|
||||||
-- @see shape
|
-- @see shape
|
||||||
function background:set_shape(shape, ...)
|
function background:set_shape(shape, ...)
|
||||||
|
local args = {...}
|
||||||
|
|
||||||
|
if shape == self._private.shape and #args == 0 then return end
|
||||||
|
|
||||||
self._private.shape = shape
|
self._private.shape = shape
|
||||||
self._private.shape_args = {...}
|
self._private.shape_args = {...}
|
||||||
self:emit_signal("widget::redraw_needed")
|
self:emit_signal("widget::redraw_needed")
|
||||||
|
@ -201,6 +205,8 @@ end
|
||||||
-- @tparam number width The border width
|
-- @tparam number width The border width
|
||||||
|
|
||||||
function background:set_shape_border_width(width)
|
function background:set_shape_border_width(width)
|
||||||
|
if self._private.shape_border_width == width then return end
|
||||||
|
|
||||||
self._private.shape_border_width = width
|
self._private.shape_border_width = width
|
||||||
self:emit_signal("widget::redraw_needed")
|
self:emit_signal("widget::redraw_needed")
|
||||||
end
|
end
|
||||||
|
@ -217,6 +223,8 @@ end
|
||||||
-- @see gears.color
|
-- @see gears.color
|
||||||
|
|
||||||
function background:set_shape_border_color(fg)
|
function background:set_shape_border_color(fg)
|
||||||
|
if self._private.shape_border_color == fg then return end
|
||||||
|
|
||||||
self._private.shape_border_color = fg
|
self._private.shape_border_color = fg
|
||||||
self:emit_signal("widget::redraw_needed")
|
self:emit_signal("widget::redraw_needed")
|
||||||
end
|
end
|
||||||
|
@ -231,6 +239,8 @@ end
|
||||||
-- @tparam boolean value If the shape clip is enable
|
-- @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
|
||||||
|
|
||||||
self._private.shape_clip = value
|
self._private.shape_clip = value
|
||||||
self:emit_signal("widget::redraw_needed")
|
self:emit_signal("widget::redraw_needed")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue