progressbar: Deprecate width, height and vertical properties.
This commit is contained in:
parent
749980bf33
commit
2c620468f0
|
@ -11,6 +11,7 @@
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local math = math
|
local math = math
|
||||||
|
local util = require("awful.util")
|
||||||
local base = require("wibox.widget.base")
|
local base = require("wibox.widget.base")
|
||||||
local color = require("gears.color")
|
local color = require("gears.color")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
@ -40,7 +41,7 @@ local data = setmetatable({}, { __mode = "k" })
|
||||||
|
|
||||||
--- Set the progressbar to draw vertically. Default is false.
|
--- Set the progressbar to draw vertically. Default is false.
|
||||||
--
|
--
|
||||||
-- @function set_vertical
|
-- @deprecated set_vertical
|
||||||
-- @param progressbar The progressbar.
|
-- @param progressbar The progressbar.
|
||||||
-- @param vertical A boolean value.
|
-- @param vertical A boolean value.
|
||||||
|
|
||||||
|
@ -181,16 +182,24 @@ function progressbar:set_value(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set the progressbar height.
|
--- Set the progressbar height.
|
||||||
|
-- This method is deprecated.
|
||||||
|
-- Use a `wibox.container.constraint` widget or `forced_height`.
|
||||||
-- @param height The height to set.
|
-- @param height The height to set.
|
||||||
function progressbar:set_height(height)
|
-- @deprecated set_height
|
||||||
|
function progressbar:set_height(height) --luacheck: no unused_args
|
||||||
|
util.deprecate("Use a `wibox.container.constraint` widget or forced_height")
|
||||||
data[self].height = height
|
data[self].height = height
|
||||||
self:emit_signal("widget::layout_changed")
|
self:emit_signal("widget::layout_changed")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set the progressbar width.
|
--- Set the progressbar width.
|
||||||
|
-- This method is deprecated.
|
||||||
|
-- Use a `wibox.container.constraint` widget or `forced_width`.
|
||||||
-- @param width The width to set.
|
-- @param width The width to set.
|
||||||
function progressbar:set_width(width)
|
-- @deprecated set_width
|
||||||
|
function progressbar:set_width(width) --luacheck: no unused_args
|
||||||
|
util.deprecate("Use a `wibox.container.constraint` widget or forced_width")
|
||||||
data[self].width = width
|
data[self].width = width
|
||||||
self:emit_signal("widget::layout_changed")
|
self:emit_signal("widget::layout_changed")
|
||||||
return self
|
return self
|
||||||
|
@ -207,6 +216,13 @@ for _, prop in ipairs(properties) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local set_vertical = progressbar.set_vertical
|
||||||
|
function progressbar:set_vertical(value) --luacheck: no unused_args
|
||||||
|
util.deprecate("Use a `wibox.container.rotate` widget")
|
||||||
|
set_vertical(self, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Create a progressbar widget.
|
--- Create a progressbar widget.
|
||||||
-- @param args Standard widget() arguments. You should add width and height
|
-- @param args Standard widget() arguments. You should add width and height
|
||||||
-- key to set progressbar geometry.
|
-- key to set progressbar geometry.
|
||||||
|
|
Loading…
Reference in New Issue