Fix compatibility with LGI 0.9
Also add a 1px padding for checkboxes
This commit is contained in:
parent
55fb74c709
commit
1e6d66f8ec
|
@ -47,11 +47,14 @@ local function init()
|
|||
end
|
||||
|
||||
local function holo()
|
||||
local size = beautiful.menu_height or 16
|
||||
local size = beautiful.menu_height - 2 or 16
|
||||
notcheckedI = cairo.ImageSurface(cairo.Format.ARGB32, size,size)
|
||||
checkedI = cairo.ImageSurface(cairo.Format.ARGB32, size,size)
|
||||
local cr2 = cairo.Context(notcheckedI)
|
||||
local cr = cairo.Context(checkedI)
|
||||
cr:translate(1,1)
|
||||
cr2:translate(1,1)
|
||||
size = size - 2
|
||||
cr:set_operator(cairo.Operator.CLEAR)
|
||||
cr2:set_operator(cairo.Operator.CLEAR)
|
||||
cr:paint()
|
||||
|
|
|
@ -13,7 +13,8 @@ local function draw_label(cr,angle,radius,center_x,center_y,text)
|
|||
cr:line_to(center_x+(1.5*radius)*math.cos(angle),center_y+(1.5*radius)*math.sin(angle))
|
||||
local x,y = cr:get_current_point()
|
||||
cr:line_to(x+(x>center_x and radius/2 or -radius/2),y)
|
||||
cr:move_to(x+(x>center_x and radius/2 + 5 or (-radius/2 - cr:text_extents(text).width - 5)),y+(cr.font_extents.height/4))
|
||||
local extents = cr:font_extents()
|
||||
cr:move_to(x+(x>center_x and radius/2 + 5 or (-radius/2 - cr:text_extents(text).width - 5)),y+(extents.height/4))
|
||||
cr:show_text(text)
|
||||
cr:stroke()
|
||||
cr:arc(center_x+(radius/2)*math.cos(angle),center_y+(radius/2)*math.sin(angle),2,0,2*math.pi)
|
||||
|
|
Loading…
Reference in New Issue