Permalink
Browse files

Merge pull request #151 from ychatz/master

Two small UI changes
  • Loading branch information...
2 parents 813e09d + b993b54 commit edf6174934efc5377e7fbe9ff8218a5d0290b7d9 @jrgifford jrgifford committed Apr 15, 2012
Showing with 22 additions and 10 deletions.
  1. +3 −0 app/ui/mainwindow.rb
  2. +19 −10 app/ui/widgets.rb
View
3 app/ui/mainwindow.rb
@@ -127,5 +127,8 @@ def finalization
end
end
+ on_event :tab_opened, :Lessons do
+ @tour_notice.hide
+ end
end
View
29 app/ui/widgets.rb
@@ -93,8 +93,7 @@ def create_tooltip
slot = slot.parent
end
- @tooltip = slot.tooltip(@tooltip_text, x, y-20,
- :fill => red, :stroke => white)
+ @tooltip = slot.tooltip(@tooltip_text, x, y-20, "#f00", :stroke => white)
end
def arrow_right
@@ -123,18 +122,28 @@ def menu
end
module HH::Tooltip
- def tooltip str, x, y, opts={}
- f = nil
+ def tooltip str, x, y, bg="#f00", opts={}
+ s = nil
#opts[:wrap] = "trim"
slot = self
app do
- slot.append do
- f = flow :left => x, :top => y do
- para str, opts
- end
- end
+ slot.append do
+ s = stack :left => x, :top => y do
+ bg = background bg, :curve => 6, :height => 26, :width => 40
+ p1 = nil
+ flow :width => 300 do
+ p1 = para str, opts
+ end
+ timer 0 do
+ bg.width = p1.width
+ if slot.width < s.left + bg.width
+ s.left -= s.left + bg.width - slot.width
+ end
+ end
+ end
+ end
end
- f
+ s
end
end

0 comments on commit edf6174

Please sign in to comment.