progressbar: Remove gradients
gears.color can do the same in better and they are currently broken anyway. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
d8dce35269
commit
c8b93cec76
|
@ -24,14 +24,6 @@ local data = setmetatable({}, { __mode = "k" })
|
||||||
-- @param progressbar The progressbar.
|
-- @param progressbar The progressbar.
|
||||||
-- @param color The border color to set.
|
-- @param color The border color to set.
|
||||||
|
|
||||||
--- Set the progressbar foreground color as a gradient.
|
|
||||||
-- @name set_gradient_colors
|
|
||||||
-- @class function
|
|
||||||
-- @param progressbar The progressbar.
|
|
||||||
-- @param gradient_colors A table with gradients colors. The distance between each color
|
|
||||||
-- can also be specified. Example: { "#ff0000", "#0000ff" } or { "#ff0000", "#00ff00",
|
|
||||||
-- "#0000ff", ["#0000ff"] = 10 } to specify blue distance from other colors.
|
|
||||||
|
|
||||||
--- Set the progressbar foreground color.
|
--- Set the progressbar foreground color.
|
||||||
-- @name set_color
|
-- @name set_color
|
||||||
-- @class function
|
-- @class function
|
||||||
|
@ -75,7 +67,7 @@ local data = setmetatable({}, { __mode = "k" })
|
||||||
-- @param value The value.
|
-- @param value The value.
|
||||||
|
|
||||||
local properties = { "width", "height", "border_color",
|
local properties = { "width", "height", "border_color",
|
||||||
"gradient_colors", "color", "background_color",
|
"color", "background_color",
|
||||||
"vertical", "value", "max_value",
|
"vertical", "value", "max_value",
|
||||||
"ticks", "ticks_gap", "ticks_size" }
|
"ticks", "ticks_gap", "ticks_size" }
|
||||||
|
|
||||||
|
@ -114,17 +106,10 @@ local function update(pbar)
|
||||||
angle = 180
|
angle = 180
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Draw full gradient
|
cr:rectangle(border_width, border_width,
|
||||||
if data[pbar].gradient_colors then
|
over_drawn_width, over_drawn_height)
|
||||||
img:draw_rectangle_gradient(border_width, border_width,
|
cr:set_source(color(data[pbar].color or "#ff0000"))
|
||||||
over_drawn_width, over_drawn_height,
|
cr:fill()
|
||||||
data[pbar].gradient_colors, angle)
|
|
||||||
else
|
|
||||||
cr:rectangle(border_width, border_width,
|
|
||||||
over_drawn_width, over_drawn_height)
|
|
||||||
cr:set_source(color(data[pbar].color or "#ff0000"))
|
|
||||||
cr:fill()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Cover the part that is not set with a rectangle
|
-- Cover the part that is not set with a rectangle
|
||||||
if data[pbar].vertical then
|
if data[pbar].vertical then
|
||||||
|
|
Loading…
Reference in New Issue