Module: Uh::Layout::Registrant

Defined in:
lib/uh/layout/registrant.rb

Class Method Summary collapse

Class Method Details

.register(layout, display) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/uh/layout/registrant.rb', line 5

def register layout, display
  display.screens.each do |screen|
    layout.screens << scr = Screen.new(screen.id, screen.geo)
    bar = Bar.new(display, scr, layout.colors).tap do |b|
      layout.widgets << b.show.focus
      b.on_update do
        bar.active = layout.current_screen? scr
        bar.status = layout.bar_status.call if layout.bar_status
      end
    end
    scr.height = scr.height - bar.height
  end
  layout.update_widgets
end