class Tiling::VerticalLayout
Public: Met en place un layout vertical.
Private Instance Methods
calculate_master()
click to toggle source
# File lib/tiling/vertical_layout.rb, line 9 def calculate_master @master[:width_exterior] = (@workspace.width - @workspace.x) / 2 ext = FrameExtents.new(@master[:frame_extents]) @master[:width] = @master[:width_exterior] - ext.left - ext.right @master[:height] = @workspace.height - ext.top - ext.bottom end
get_win_height()
click to toggle source
# File lib/tiling/vertical_layout.rb, line 31 def get_win_height @real_height - @ext.top - @ext.bottom end
get_win_width()
click to toggle source
# File lib/tiling/vertical_layout.rb, line 35 def get_win_width tmp = @workspace.x + @master[:width_exterior] @workspace.width - tmp - @ext.left - @ext.right end
move_resize_window(win, width, height)
click to toggle source
# File lib/tiling/vertical_layout.rb, line 40 def move_resize_window win, width, height Mover.move(win[:id], @x, @y, width, height) end
position_remaining_windows()
click to toggle source
# File lib/tiling/vertical_layout.rb, line 16 def position_remaining_windows @real_height = @workspace.height / @windows.count @y = @workspace.y @x = @workspace.x + @master[:width_exterior] @windows.each { |win| position_window win } end
position_window(win)
click to toggle source
# File lib/tiling/vertical_layout.rb, line 23 def position_window win @ext = FrameExtents.new(win[:frame_extents]) height = get_win_height width = get_win_width move_resize_window win, width, height @y += @real_height end