class Tiling::HorizontalLayout
Public: Met en place un layout horizontal.
Private Instance Methods
calculate_master()
click to toggle source
# File lib/tiling/horizontal_layout.rb, line 9 def calculate_master @master[:height_exterior] = (@workspace.height - @workspace.y) / 2 ext = FrameExtents.new(@master[:frame_extents]) @master[:height] = @master[:height_exterior] - ext.top - ext.bottom @master[:width] = @workspace.width - ext.left - ext.right end
get_win_height()
click to toggle source
# File lib/tiling/horizontal_layout.rb, line 35 def get_win_height tmp = @workspace.y + @master[:height_exterior] @workspace.height - tmp - @ext.top - @ext.bottom end
get_win_width()
click to toggle source
# File lib/tiling/horizontal_layout.rb, line 31 def get_win_width @real_width - @ext.left- @ext.right end
move_resize_window(win, width, height)
click to toggle source
# File lib/tiling/horizontal_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/horizontal_layout.rb, line 16 def position_remaining_windows @real_width = @workspace.width / @windows.count @x = @workspace.x @y = @workspace.y + @master[:height_exterior] @windows.each { |win| position_window win } end
position_window(win)
click to toggle source
# File lib/tiling/horizontal_layout.rb, line 23 def position_window win @ext = FrameExtents.new(win[:frame_extents]) width = get_win_width height = get_win_height move_resize_window win, width, height @x += @real_width end