Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* lib/shoes.rb: new splash window, opening with the modal file dialo…

…g was weird.
  • Loading branch information...
commit 79e4258c3bad7bad32d1d7ca928b4f7593f9a632 1 parent 457aef9
_why authored
View
1  COPYING
@@ -1,6 +1,7 @@
Copyright (c) 2008 why the lucky stiff
Except:
fonts/Coolvetica.ttf (c) 1999 Ray Larabie
+ fonts/Lacuna.ttf (c) 2003 Glashaus, designed by Peter Hoffman
samples/expert-minesweeper.rb (c) 2008 que
samples/expert-othello.rb (c) 2008 Tieg Zaharia
samples/expert-tankspank.rb (c) 2008 Kevin C.
View
BIN  fonts/Lacuna.ttf
Binary file not shown
View
60 lib/shoes.rb
@@ -114,6 +114,55 @@ def self.show_selector
Shoes.visit(fname) if fname
end
+ def self.splash
+ font "#{DIR}/fonts/Lacuna.ttf"
+ Shoes.app :width => 400, :height => 300, :resizable => false do
+ style(Para, :align => "center", :weight => "bold", :font => "Lacuna Regular")
+ style(Link, :stroke => yellow, :underline => nil)
+ style(LinkHover, :stroke => yellow, :fill => nil)
+
+ x1 = 77; y1 = 122
+ x2 = 148; y2 = -122
+ x3 = 245; y3 = 0
+
+ nofill
+ strokewidth 40.0
+
+ @waves = stack :top => 0, :left => 0
+
+ stack :margin => 22 do
+ para "Welcome to", :stroke => "#DFA", :margin => 0
+ para "SHOES", :size => 48, :stroke => "#DFA", :margin_top => 0
+ stack do
+ background black(0.2), :curve => 8
+ para link("Open an App.") { Shoes.show_selector and close }, :margin => 12, :margin_bottom => 4
+ para link("Read the Manual.") { Shoes.show_manual and close }, :margin => 12
+ end
+ inscription "Alt-Slash opens the console.", :stroke => "#DFA", :align => "center"
+ end
+
+ animate(10) do |ani|
+ a = Math.sin(ani * 0.02) * 20
+ @waves.clear do
+ background white
+ y = -30
+ 16.times do |i|
+ shape do
+ move_to x = (-300 - (i*(a*0.8))), y
+ c = (a + 14) * 0.01
+ stroke rgb(i * 0.06, c + 0.1, 0.1, 1.0 - (ani * 0.0003))
+ 4.times do
+ curve_to x1 + x, (y1-(i*a)) + y, x2 + x, (y2+(i*a)) + y, x3 + x, y3 + y
+ x += x3
+ end
+ end
+ y += 30
+ end
+ end
+ end
+ end
+ end
+
def self.make_pack
require 'shoes/pack'
Shoes.app(:width => 500, :height => 380, :resizable => false, &PackMake)
@@ -296,15 +345,8 @@ def self.run(path)
end
def self.args!
- if PLATFORM !~ /darwin/
- if ARGV.empty?
- fname = ask_open_file
- if fname
- ARGV << fname
- else
- return false
- end
- end
+ if PLATFORM !~ /darwin/ and ARGV.empty?
+ Shoes.splash
end
OPTS.parse! ARGV
ARGV[0] or true
View
2  shoes/native/cocoa.m
@@ -34,7 +34,7 @@ - (void)idle: (NSTimer *)t
{
count++;
if (count == 100 && RARRAY_LEN(shoes_world->apps) == 0)
- rb_eval_string("Shoes.show_selector");
+ rb_eval_string("Shoes.splash");
}
rb_eval_string("sleep(0.001)");
}
Please sign in to comment.
Something went wrong with that request. Please try again.