Various changes to radiobutton drawing

This commit is contained in:
Kenny Shields 2014-07-14 01:59:09 -04:00
parent be4f6d2510
commit 3b51130cb3
4 changed files with 20 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

View File

@ -104,9 +104,10 @@ skin.controls.checkbox_check_color = {128, 204, 255, 255}
skin.controls.checkbox_text_font = smallfont
-- radiobutton
skin.controls.radiobutton_body_color = {255, 255, 255, 255}
skin.controls.radiobutton_check_color = {128, 204, 255, 255}
skin.controls.radiobutton_text_font = smallfont
skin.controls.radiobutton_body_color = {255, 255, 255, 255}
skin.controls.radiobutton_check_color = {128, 204, 255, 255}
skin.controls.radiobutton_inner_border_color = {77, 184, 255, 255}
skin.controls.radiobutton_text_font = smallfont
-- collapsiblecategory
skin.controls.collapsiblecategory_text_color = {255, 255, 255, 255}
@ -1335,27 +1336,23 @@ function skin.DrawRadioButton(object)
local hover = object:GetHover()
local bodycolor = skin.controls.radiobutton_body_color
local checkcolor = skin.controls.radiobutton_check_color
local inner_border = skin.controls.radiobutton_inner_border_color
--~ love.graphics.setColor(bodycolor)
love.graphics.setColor(bordercolor)
--~ love.graphics.rectangle("fill", x, y, width, height)
love.graphics.circle("line", x + 10, y + 9, 10, 15)
--~ love.graphics.setColor(bordercolor)
--~ skin.OutlinedRectangle(x, y, width, height)
love.graphics.setLineStyle("smooth")
love.graphics.setLineWidth(1)
love.graphics.circle("line", x + 10, y + 10, 8, 15)
if checked then
local image = skin.images["circle-fill.png"]
love.graphics.setColor(255, 255, 255, 255)
-- FIXME: This does not blend as intended.
-- There are gray pixels on a white background.
love.graphics.setBlendMode("alpha")
love.graphics.draw(image, x + 4, y + 4)
love.graphics.setColor(checkcolor)
love.graphics.circle("fill", x + 10, y + 10, 5, 360)
love.graphics.setColor(inner_border)
love.graphics.circle("line", x + 10, y + 10, 5, 360)
end
if hover then
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x + 4, y + 4, width - 8, height - 8)
love.graphics.circle("line", x + 10, y + 10, 5, 360)
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

View File

@ -24,6 +24,13 @@ skin.controls.slider_bar_outline_color = {220, 220, 220, 255}
-- checkbox
skin.controls.checkbox_check_color = {255, 153, 0, 255}
-- radiobutton
skin.controls.radiobutton_body_color = {255, 255, 255, 255}
skin.controls.radiobutton_check_color = {255, 153, 0, 255}
skin.controls.radiobutton_inner_border_color = {204, 122, 0, 255}
skin.controls.radiobutton_text_font = smallfont
-- columnlistrow
skin.controls.columnlistrow_body_selected_color = {255, 153, 0, 255}
skin.controls.columnlistrow_body_hover_color = {255, 173, 51, 255}