Fix textfield in rules croped

This commit is contained in:
cacaodev
2013-01-19 17:08:34 +01:00
parent c023a38544
commit eca5ef6f84
@@ -128,15 +128,16 @@ var CONTROL_HEIGHT = 16.,
- (_CPRuleEditorTextField)_createStaticTextFieldWithStringValue:(CPString)text
{
var textField = [[_CPRuleEditorTextField alloc] initWithFrame:CPMakeRect(0, 0, 200, CONTROL_HEIGHT)],
refont = [_ruleEditor font],
font = [CPFont fontWithName:[refont familyName] size:[refont size] + 2],
var textField = [[_CPRuleEditorTextField alloc] initWithFrame:CGRectMakeZero()],
ruleEditorFont = [_ruleEditor font],
font = [CPFont fontWithName:[ruleEditorFont familyName] size:[ruleEditorFont size] + 2],
localizedText = [[_ruleEditor standardLocalizer] localizedStringForString:text],
size = [localizedText sizeWithFont:font];
localizedText = [[_ruleEditor standardLocalizer] localizedStringForString:text];
[textField setFrameSize:CGSizeMake(size.width + 4, CONTROL_HEIGHT + 2)];
[textField setValue:font forThemeAttribute:@"font"];
[textField setStringValue:localizedText];
[textField sizeToFit];
return textField;
}
@@ -358,14 +359,6 @@ var CONTROL_HEIGHT = 16.,
optionFrame.origin.y = (rowHeight - CGRectGetHeight(optionFrame)) / 2 - 2;
// small positioning fix
if ([ruleOptionView isKindOfClass:CPTextField])
{
optionFrame.origin.y += 2;
[_ruleOptionViews[i] setValue:CGInsetMake(7, 7, 7, 8) forThemeAttribute:@"content-inset"];
}
if (widthChanged)
{
optionFrame.origin.x = optionViewOriginX;
@@ -485,13 +478,6 @@ var CONTROL_HEIGHT = 16.,
return NO;
}
- (BOOL)_isRuleStaticTextField:(CPView)view
{
if ([view isKindOfClass:[_CPRuleEditorTextField class]])
return YES;
return NO;
}
- (void)_sendRuleAction:(id)sender
{
[_ruleEditor _updatePredicate];
@@ -513,10 +499,8 @@ var CONTROL_HEIGHT = 16.,
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self != nil)
if (self)
{
[self setBordered:NO];
[self setEditable:NO];
[self setDrawsBackground:NO];
}