Module: VER::TilingLayout::CommonTiling
- Included in:
- HorizontalTiling, VerticalTiling
- Defined in:
- lib/ver/layout/tiling/common.rb,
config/plugin/animated_tiling.rb
Constant Summary collapse
- DEFAULT =
{ master: 1, stacking: 3, center: 0.5 }
Instance Method Summary collapse
- #apply(layout, given_options = {}) ⇒ Object
-
#apply_hidden(*windows) ⇒ Object
animates hiding the given
windows
. -
#evolve(window, target) ⇒ Object
animates movement of an
window
to the position given astarget
. - #prepare(layout, given_options) ⇒ Object
Instance Method Details
#apply(layout, given_options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/ver/layout/tiling/common.rb', line 15 def apply(layout, = {}) masters, stacked, hidden, = prepare(layout, ) center = stacked.size == 0 ? 1.0 : [:center] apply_hidden(hidden) if hidden apply_masters(masters, center) if masters apply_stacked(stacked, center) if stacked end |
#apply_hidden(*windows) ⇒ Object
animates hiding the given windows
20 21 22 |
# File 'config/plugin/animated_tiling.rb', line 20 def apply_hidden(windows) windows.each(&:place_forget) end |
#evolve(window, target) ⇒ Object
animates movement of an window
to the position given as target
29 30 31 |
# File 'config/plugin/animated_tiling.rb', line 29 def evolve(window, target) window.place(target) end |
#prepare(layout, given_options) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/ver/layout/tiling/common.rb', line 6 def prepare(layout, ) = DEFAULT.merge() slaves = layout.stack master, stacking = .values_at(:master, :stacking) .merge!() head, tail, hidden = slaves[0...master], slaves[master..stacking], slaves[(stacking + 1)..-1] return head, tail, hidden, end |