How can I get vertical alignment in flow slot in Shoes?
-
03-07-2019 - |
Question
The default vertical alignment in a flow
slot is apparently to top-align the elements. Here's a sample:
Shoes.app (:title => "Vertical Alignment", :width => 300, :height => 150) do
background "#DFA"
flow :margin => 30 do
title "BIG"
tagline "MEDIUM"
inscription "SMALL"
end
end
How do I get the flow
slot to center-align its elements short of calculating a :rise
value for each element? I would have expected a vertical-alignment style for flow
slots and a horizontal-alignment style for stack
slots, but I don't see anything like that. What did I miss?
Solution
To my knowledge, there's no style for vertical alignment. There is horizontal alignment which is useful in stacks:
Shoes.app (:title => "Horizontal Alignment", :width => 300, :height => 150) do
background "#DFA"
stack :margin => 30 do
title "BIG", :align => 'center'
tagline "MEDIUM", :align => 'center'
inscription "SMALL", :align => 'center'
end
end
Keep in mind that Shoes is very much still a work in progress, so _why will probably get around to it eventually.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow