Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix FIELD_BUFFER behavior

  • Loading branch information...
commit a8c049b8049c2f0c52f2112f518b2048beb1e6ee 1 parent 41b5f5c
@clayallsopp authored
View
8 CHANGELOG.md
@@ -1,3 +1,11 @@
+## 1.2 - ??
+
+- Added `:picker_mode` row property which lets you choose what type of date picker you're using (i.e. `:date`, `:time`, `:date_time`, or `:countdown`)
+
+### Bug Fixes
+
+- Fixed size issue with iPhone apps running @2x on an iPad (see `row_type/base.rb#field_buffer`)
+
## 1.1.5 - November 9, 2012
### Features
View
8 lib/formotion/row_type/base.rb
@@ -3,7 +3,13 @@ module RowType
class Base
attr_accessor :row, :tableView
- FIELD_BUFFER = Device.iphone? ? 20 : 64
+ def self.field_buffer
+ if Device.iphone? or App.window.size.width <= 320
+ 20
+ else
+ 64
+ end
+ end
def tableView
@tableView ||= self.row.form.table
View
4 lib/formotion/row_type/button.rb
@@ -17,8 +17,8 @@ def layoutSubviews
((self.frame.size.send(dimen) - frame.size.send(dimen)) / 2.0)
}
- self.textLabel.center = CGPointMake(self.frame.size.width / 2 - (FIELD_BUFFER / 2), self.textLabel.center.y)
- self.detailTextLabel.center = CGPointMake(self.frame.size.width / 2 - (FIELD_BUFFER / 2), self.detailTextLabel.center.y)
+ self.textLabel.center = CGPointMake(self.frame.size.width / 2 - (Formotion::RowType::Base.field_buffer / 2), self.textLabel.center.y)
+ self.detailTextLabel.center = CGPointMake(self.frame.size.width / 2 - (Formotion::RowType::Base.field_buffer / 2), self.detailTextLabel.center.y)
end
end
nil
View
6 lib/formotion/row_type/image_row.rb
@@ -36,9 +36,9 @@ def layoutSubviews
field_frame = formotion_field.frame
field_frame.origin.y = 10
- field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + FIELD_BUFFER
- field_frame.size.width = self.frame.size.width - field_frame.origin.x - FIELD_BUFFER
- field_frame.size.height = self.frame.size.height - FIELD_BUFFER
+ field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + Formotion::RowType::Base.field_buffer
+ field_frame.size.width = self.frame.size.width - field_frame.origin.x - Formotion::RowType::Base.field_buffer
+ field_frame.size.height = self.frame.size.height - Formotion::RowType::Base.field_buffer
formotion_field.frame = field_frame
end
end
View
6 lib/formotion/row_type/slider_row.rb
@@ -38,9 +38,9 @@ def layoutSubviews
field_frame = formotion_field.frame
field_frame.origin.y = 10
- field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + FIELD_BUFFER
- field_frame.size.width = self.frame.size.width - field_frame.origin.x - FIELD_BUFFER
- field_frame.size.height = self.frame.size.height - FIELD_BUFFER
+ field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + Formotion::RowType::Base.field_buffer
+ field_frame.size.width = self.frame.size.width - field_frame.origin.x - Formotion::RowType::Base.field_buffer
+ field_frame.size.height = self.frame.size.height - Formotion::RowType::Base.field_buffer
formotion_field.frame = field_frame
end
end
View
4 lib/formotion/row_type/string_row.rb
@@ -51,9 +51,9 @@ def layoutSubviews
formotion_field.sizeToFit
field_frame = formotion_field.frame
- field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + FIELD_BUFFER
+ field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + Formotion::RowType::Base.field_buffer
field_frame.origin.y = ((self.frame.size.height - field_frame.size.height) / 2.0).round
- field_frame.size.width = self.frame.size.width - field_frame.origin.x - FIELD_BUFFER
+ field_frame.size.width = self.frame.size.width - field_frame.origin.x - Formotion::RowType::Base.field_buffer
formotion_field.frame = field_frame
end
end
View
6 lib/formotion/row_type/text_row.rb
@@ -60,9 +60,9 @@ def layoutSubviews
field_frame = formotion_field.frame
field_frame.origin.y = 10
- field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + FIELD_BUFFER
- field_frame.size.width = self.frame.size.width - field_frame.origin.x - FIELD_BUFFER
- field_frame.size.height = self.frame.size.height - FIELD_BUFFER
+ field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + Formotion::RowType::Base.field_buffer
+ field_frame.size.width = self.frame.size.width - field_frame.origin.x - Formotion::RowType::Base.field_buffer
+ field_frame.size.height = self.frame.size.height - Formotion::RowType::Base.field_buffer
formotion_field.frame = field_frame
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.