Skip to content

SplashApp.md

Noah Gibbs edited this page Nov 10, 2023 · 1 revision

Classic Shoes had an app that would open when you first ran it locally, allowing you to run an app, package an app, start an interactive shoes-irb session and more. It'd be cool to have a splash screen of our own.

Here's the code for the old Shoes splash screen, extracted from Shoes3:

  def self.splash
    #font "#{DIR}/fonts/Lacuna.ttf" unless Shoes::FONTS.include? "Lacuna"
    font "#{DIR}/fonts/DejaVuSans.ttf" unless Shoes::FONTS.include? "DejaVu Sans"
    Shoes.app width: 598, height: 520, resizable: false do
      background "#{DIR}/static/splash.png"
      #style(Para, align: 'center', weight: 'bold', font: 'Lacuna Regular', size: 13)
      style(Para, align: 'center', weight: 'bold', font: 'DejaVu Sans', size: 13)
      style(Link, stroke: khaki, underline: nil)
      style(LinkHover, stroke: yellow, fill: nil)

      require 'shoes/search'
      require 'shoes/help'

      stack margin: 18 do
        para 'Welcome to', stroke: ivory, size: 18, margin: 0
        para 'SHOES', size: 24, stroke: ivory, margin: 0
        para Shoes::VERSION_NAME, stroke: ivory, size: 14, margin: 0, weight: 'bold'
        para "build #{Shoes::VERSION_NUMBER} r#{Shoes::VERSION_REVISION}", size: 14, stroke: ivory, margin_top: 0
        stack do
          background black(0.3), :curve => 8
          para link(strong("Run an App")) { Shoes.show_selector and close }, :margin => 10, :margin_bottom => 4
          para link(strong("Read the Manual")) { Shoes.show_manual and close }, :margin => 10, :margin_bottom => 4
          para link(strong("Maintain Shoes")) {Shoes.cobbler and close}, :margin => 10, :margin_bottom => 4
          #para link(strong("Debug an App (remote)")) {Shoes.remote_debug and close}, :margin => 10, :margin_bottom => 4
          #para link(strong("Profile an App")) {Shoes.profiler and close}, :margin => 10, :margin_bottom => 4
          para link(strong("Bundle an App (shy)")) { Shoes.package_app and close }, :margin => 10, :margin_bottom => 4
          para link(strong("Package an App with Shoes")) {Shoes.app_package and close }, :margin => 10, :margin_bottom => 4
          #para link("Obsolete: Package") { Shoes.make_pack and close }, :margin => 10, :margin_bottom => 4
        end
        para 'Alt-Slash opens the console', stroke: '#00', align: 'center'
      end
    end
  end