Skip to content

Commit

Permalink
Removed the well from the statement images and added the period as a …
Browse files Browse the repository at this point in the history
…label.
  • Loading branch information
cmkilger committed Aug 2, 2012
1 parent 8249618 commit bd40050
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Seuss for iPad/SSCommandView.m
Expand Up @@ -67,7 +67,7 @@ - (id)initWithCommand:(SSCommand *)command {
backgroundImage = [UIImage imageNamed:@"blue_sm_btn.png"];
else if ([command.signatureKey caseInsensitiveCompare:@"Read"] == NSOrderedSame)
backgroundImage = [UIImage imageNamed:@"green_btn_sm.png"];
backgroundImage = [backgroundImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 40)];
backgroundImage = [backgroundImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 12)];
UIImageView * backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage];
backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
backgroundImageView.frame = self.bounds;
Expand Down
32 changes: 25 additions & 7 deletions Seuss for iPad/SSStatementView.m
Expand Up @@ -21,8 +21,8 @@

#define DEFAULT_VARIABLE_WIDTH 100.0
#define LEFT_PADDING 15.0
#define MIDDLE_PADDING 10.0
#define RIGHT_PADDING 25.0
#define MIDDLE_PADDING 4.0
#define RIGHT_PADDING 15.0

#define PARAMETER_VERTICAL_PADDING 8.0

Expand Down Expand Up @@ -65,7 +65,7 @@ - (id)initWithStatement:(SSStatement *)statement {
backgroundImage = [UIImage imageNamed:@"blue_sm_btn.png"];
else if ([statement.command.signatureKey caseInsensitiveCompare:@"Read"] == NSOrderedSame)
backgroundImage = [UIImage imageNamed:@"green_btn_sm.png"];
backgroundImage = [backgroundImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 40)];
backgroundImage = [backgroundImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 12)];
UIImageView * backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage];
backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
backgroundImageView.frame = self.bounds;
Expand Down Expand Up @@ -128,7 +128,19 @@ - (id)initWithStatement:(SSStatement *)statement {
index++;
}

self.bounds = CGRectMake(0, 0, x - MIDDLE_PADDING + RIGHT_PADDING, DEFAULT_HEIGHT);
CGFloat periodWidth = [@"." sizeWithFont:font].width;
UILabel * periodLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, PARAMETER_VERTICAL_PADDING, periodWidth, DEFAULT_HEIGHT - PARAMETER_VERTICAL_PADDING)];
periodLabel.text = @".";
periodLabel.font = font;
periodLabel.backgroundColor = [UIColor clearColor];
periodLabel.textColor = [UIColor whiteColor];
periodLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;

x += periodWidth + RIGHT_PADDING;

self.frame = CGRectMake(0, 0, x, DEFAULT_HEIGHT);

[self addSubview:periodLabel];
}
return self;
}
Expand Down Expand Up @@ -186,7 +198,9 @@ - (void)prepareForParameterView:(SSVariableView *)variableView atPoint:(CGPoint)
width += parameterWidth + MIDDLE_PADDING;
}
}
width += RIGHT_PADDING - MIDDLE_PADDING;

CGFloat periodWidth = [@"." sizeWithFont:SSStatementFont()].width;
width += periodWidth + RIGHT_PADDING;

CGRect frame = self.frame;
frame.size.width = width;
Expand Down Expand Up @@ -232,7 +246,9 @@ - (BOOL)addParameterView:(UIView *)newParameterView atPoint:(CGPoint)point {
width += parameterWidth + MIDDLE_PADDING;
}
}
width += RIGHT_PADDING - MIDDLE_PADDING;

CGFloat periodWidth = [@"." sizeWithFont:SSStatementFont()].width;
width += periodWidth + RIGHT_PADDING;

CGRect frame = self.frame;
frame.size.width = width;
Expand Down Expand Up @@ -262,7 +278,9 @@ - (void)unprepare {
}
width += parameterWidth + MIDDLE_PADDING;
}
width += RIGHT_PADDING - MIDDLE_PADDING;

CGFloat periodWidth = [@"." sizeWithFont:SSStatementFont()].width;
width += periodWidth + RIGHT_PADDING;

CGRect frame = self.frame;
frame.size.width = width;
Expand Down
Binary file modified Seuss for iPad/blue_sm_btn.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Seuss for iPad/green_btn_sm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd40050

Please sign in to comment.