Add a font property to the item
This commit is contained in:
parent
7d8b5a0542
commit
9f81638643
|
@ -235,6 +235,7 @@ Multiple items can have multiple sets of options.
|
||||||
| margins | Read/Write table (left,right,top and bottom) | dynamic table |
|
| margins | Read/Write table (left,right,top and bottom) | dynamic table |
|
||||||
| infoshapes | See the infoshapes widget documentation | array of infoshapes|
|
| infoshapes | See the infoshapes widget documentation | array of infoshapes|
|
||||||
| overlay_draw | Draw a custom painter on top of the item | draw function |
|
| overlay_draw | Draw a custom painter on top of the item | draw function |
|
||||||
|
| font | Set a custom font | font_string |
|
||||||
|
|
||||||
### Colors options
|
### Colors options
|
||||||
|
|
||||||
|
|
|
@ -196,6 +196,11 @@ local function new_item(data,args)
|
||||||
item_style(item)
|
item_style(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function item:set_font(f)
|
||||||
|
local text_w = item._internal.text_w
|
||||||
|
text_w:set_font(f)
|
||||||
|
end
|
||||||
|
|
||||||
function item:set_text(text)
|
function item:set_text(text)
|
||||||
local text_w = item._internal.text_w
|
local text_w = item._internal.text_w
|
||||||
if not text_w then return end
|
if not text_w then return end
|
||||||
|
|
Loading…
Reference in New Issue