Permalink
Browse files

Improved App#style method a little bit to make a Link element without…

… underline.
  • Loading branch information...
1 parent fc0eb5b commit c9a78c1191ccf31b830f7a78f36e39bc69d738ba @ashbb committed Apr 6, 2012
Showing with 5 additions and 4 deletions.
  1. +1 −1 VERSION
  2. +1 −0 lib/purple_shoes.rb
  3. +1 −1 lib/shoes/helper_methods.rb
  4. +1 −1 lib/shoes/style.rb
  5. +1 −1 purple_shoes.gemspec
View
@@ -1 +1 @@
-0.0.123
+0.0.124
View
@@ -10,6 +10,7 @@
module Shoes
DIR = Pathname.new(__FILE__).realpath.dirname.to_s
FONTS = []
+ LINK_DEFAULT = {underline: true}
BANNER_DEFAULT, TITLE_DEFAULT, SUBTITLE_DEFAULT, TAGLINE_DEFAULT, CAPTION_DEFAULT, PARA_DEFAULT, INSCRIPTION_DEFAULT =
{}, {}, {}, {}, {}, {}, {}
SHOES_VERSION = IO.read(File.join(DIR, '../VERSION')).chomp
@@ -127,7 +127,7 @@ def set_styles s, args
when :code
font = "Lucida Console"
when :link
- cmds << "underline = true"
+ (cmds << "underline = true") if LINK_DEFAULT[:underline]
fg = Swt::Color.new Shoes.display, *blue
spos = tl.getLocation e[1].first, false
epos = tl.getLocation e[1].last, true
View
@@ -1,7 +1,7 @@
class Shoes
class App
def style klass, args={}
- if klass.superclass == Shoes::TextBlock
+ if klass.superclass == Shoes::TextBlock or klass == Shoes::Link
eval("#{klass.to_s[7..-1].upcase}_DEFAULT").clear.merge! args
end
end
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = "purple_shoes"
- s.version = "0.0.123"
+ s.version = "0.0.124"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["ashbb"]

0 comments on commit c9a78c1

Please sign in to comment.