From 2c620468f01384d39215ce3b31872fc9dfffc920 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 23 Jul 2016 18:32:37 -0400 Subject: [PATCH] progressbar: Deprecate width, height and vertical properties. --- lib/wibox/widget/progressbar.lua | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/wibox/widget/progressbar.lua b/lib/wibox/widget/progressbar.lua index ddf1b151..e52e323a 100644 --- a/lib/wibox/widget/progressbar.lua +++ b/lib/wibox/widget/progressbar.lua @@ -11,6 +11,7 @@ local setmetatable = setmetatable local ipairs = ipairs local math = math +local util = require("awful.util") local base = require("wibox.widget.base") local color = require("gears.color") local beautiful = require("beautiful") @@ -40,7 +41,7 @@ local data = setmetatable({}, { __mode = "k" }) --- Set the progressbar to draw vertically. Default is false. -- --- @function set_vertical +-- @deprecated set_vertical -- @param progressbar The progressbar. -- @param vertical A boolean value. @@ -181,16 +182,24 @@ function progressbar:set_value(value) end --- Set the progressbar height. +-- This method is deprecated. +-- Use a `wibox.container.constraint` widget or `forced_height`. -- @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 self:emit_signal("widget::layout_changed") return self end --- Set the progressbar width. +-- This method is deprecated. +-- Use a `wibox.container.constraint` widget or `forced_width`. -- @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 self:emit_signal("widget::layout_changed") return self @@ -207,6 +216,13 @@ for _, prop in ipairs(properties) do 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. -- @param args Standard widget() arguments. You should add width and height -- key to set progressbar geometry.