From fad0f93e4aabd7baec920ec448bb58cd0cec3337 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 29 Jul 2014 14:33:34 -0400 Subject: [PATCH] Custom layouts now support ALL options! --- lib/squib/input_helpers.rb | 4 ++-- samples/custom-layout.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/squib/input_helpers.rb b/lib/squib/input_helpers.rb index d4479c5..3234407 100644 --- a/lib/squib/input_helpers.rb +++ b/lib/squib/input_helpers.rb @@ -29,8 +29,8 @@ module Squib unless opts[:layout].nil? entry = @layout[opts[:layout].to_s] unless entry.nil? - %w(x y width height).each do |p| - opts[p.to_sym] ||= entry[p] + entry.each do |key, value| + opts[key.to_sym] ||= entry[key] end else logger.warn "Layout entry #{opts[:layout]} does not exist." diff --git a/samples/custom-layout.yml b/samples/custom-layout.yml index 6914dbf..7ab2ae4 100644 --- a/samples/custom-layout.yml +++ b/samples/custom-layout.yml @@ -8,6 +8,8 @@ title: y: 50 width: 625 height: 150 + align: !ruby/symbol center + hint: !ruby/symbol cyan subtitle: x: 125 y: 150