Makie - how to align text in a Button

How do you align text in a Button? I didn’t see any way to do it in the docs. Only using valign and halign to align the button in its bbox. In a related question, I tried to change the padding, but didn’t notice an effect.

f = Figure()
b = Button(f, label="hello", 
    height=400, width=400,
    padding=(0.0f0, 0.0f0, 10.0f0, 10.0f0))
f

looks the same to me as

f = Figure()
b = Button(f, label="hello", 
    height=400, width=400,
    padding=(10.0f0, 10.0f0, 10.0f0, 10.0f0))
f

Am I missing something basic?

Align is not implemented for Button because it’s usually as large as the text needs it to be. Padding should work unless it has regressed…

If you have multiple buttons next to each other, wouldn’t you want them to be the same size, independent of label size? E.g. “OK” and “Cancel”.

you can change the size, but not the alignment within I think. could be added of course

Thanks for the info! I think that is here:

    labeltext = text!(subscene, textpos, text = b.label, fontsize = b.fontsize, font = b.font,
        color = lcolor, align = (:center, :center), markerspace = :data, inspectable = false)

If I can figure out how where the Button struct is defined, I could drop a PR. :grin: