class Dedalus::PatternLibrary::ApplicationScreen

Public Class Methods

new(template) click to toggle source
# File lib/dedalus/pattern_library/screens/app_screen.rb, line 4
def initialize(template)
  @template = template
end

Public Instance Methods

background_image() click to toggle source
# File lib/dedalus/pattern_library/screens/app_screen.rb, line 20
def background_image
  @bg_image ||= Elements::Image.new(path: "media/images/cosmos.jpg", z_order: -1)
end
cursor() click to toggle source
# File lib/dedalus/pattern_library/screens/app_screen.rb, line 24
def cursor
  @cursor ||= Elements::Icon.for :arrow_cursor
end
hydrate(mouse_position:, library_section_tabs:, current_entry_name:, library_sections:, library_items:) click to toggle source
# File lib/dedalus/pattern_library/screens/app_screen.rb, line 28
def hydrate(mouse_position:, library_section_tabs:, current_entry_name:, library_sections:, library_items:)
  @template.library_name = "Dedalus Pattern Library"
  @template.library_section_tabs = library_section_tabs
  @template.library_sections = library_sections
  @template.library_items = library_items
  @template.current_entry_name = current_entry_name

  cursor.position = mouse_position

  self
end
layers() click to toggle source
# File lib/dedalus/pattern_library/screens/app_screen.rb, line 12
def layers
  layer_stack = Dedalus::LayerStack.new
  layer_stack.push(Dedalus::Layer.new(background_image))
  layer_stack.push(Dedalus::Layer.new(@template))
  layer_stack.push(Dedalus::Layer.new(cursor, freeform: true))
  layer_stack
end
show() click to toggle source
# File lib/dedalus/pattern_library/screens/app_screen.rb, line 8
def show
  layers
end