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 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.
|
||||
-- @name set_color
|
||||
-- @class function
|
||||
|
@ -75,7 +67,7 @@ local data = setmetatable({}, { __mode = "k" })
|
|||
-- @param value The value.
|
||||
|
||||
local properties = { "width", "height", "border_color",
|
||||
"gradient_colors", "color", "background_color",
|
||||
"color", "background_color",
|
||||
"vertical", "value", "max_value",
|
||||
"ticks", "ticks_gap", "ticks_size" }
|
||||
|
||||
|
@ -114,17 +106,10 @@ local function update(pbar)
|
|||
angle = 180
|
||||
end
|
||||
|
||||
-- Draw full gradient
|
||||
if data[pbar].gradient_colors then
|
||||
img:draw_rectangle_gradient(border_width, border_width,
|
||||
over_drawn_width, over_drawn_height,
|
||||
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
|
||||
cr:rectangle(border_width, border_width,
|
||||
over_drawn_width, over_drawn_height)
|
||||
cr:set_source(color(data[pbar].color or "#ff0000"))
|
||||
cr:fill()
|
||||
|
||||
-- Cover the part that is not set with a rectangle
|
||||
if data[pbar].vertical then
|
||||
|
|
Loading…
Reference in New Issue