views:

148

answers:

1

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?

+3  A: 

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.

Pesto
Thanks, @Pesto. Let's hope _why reads this, and I'll try to be more patient.
Ken Paul