diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 9467e5788..36ee9b3b8 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -684,8 +684,8 @@ CPTextFieldStatePlaceholder = 1 << 13; - (CGRect)bezelRectForBounds:(CFRect)bounds { var bezelInset = [self currentValueForThemedAttributeName:@"bezel-inset"]; - - if (!_CGInsetIsEmpty(bezelInset)) + + if (_CGInsetIsEmpty(bezelInset)) return bounds; bounds.origin.x += bezelInset.left; diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-center.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-center.png new file mode 100644 index 000000000..2b08c2e66 Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-center.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-left.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-left.png new file mode 100644 index 000000000..c1bd09bce Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-left.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-right.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-right.png new file mode 100644 index 000000000..96bf93333 Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-rounded-focused-right.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-0.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-0.png new file mode 100644 index 000000000..09f9e4f4a Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-0.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-1.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-1.png new file mode 100644 index 000000000..882311730 Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-1.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-2.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-2.png new file mode 100644 index 000000000..e058f2d53 Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-2.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-3.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-3.png new file mode 100644 index 000000000..50ef3a0cb Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-3.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-4.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-4.png new file mode 100644 index 000000000..9432d30c9 Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-4.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-5.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-5.png new file mode 100644 index 000000000..63d4a0c83 Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-5.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-6.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-6.png new file mode 100644 index 000000000..fe528459f Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-6.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-7.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-7.png new file mode 100644 index 000000000..c78b5f1fb Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-7.png differ diff --git a/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-8.png b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-8.png new file mode 100644 index 000000000..bda038c4c Binary files /dev/null and b/AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-8.png differ diff --git a/AppKit/Themes/Aristo/ThemeDescriptors.j b/AppKit/Themes/Aristo/ThemeDescriptors.j index 9f2e1cf36..990e018da 100644 --- a/AppKit/Themes/Aristo/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo/ThemeDescriptors.j @@ -110,7 +110,7 @@ + (CPTextField)themedStandardTextField { - var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 22.0)], + var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 29.0)], bezelColor = [CPColor colorWithPatternImage:[[CPNinePartImage alloc] initWithImageSlices: [ [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-0.png" size:CGSizeMake(2.0, 3.0)], @@ -122,15 +122,35 @@ [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-6.png" size:CGSizeMake(2.0, 2.0)], [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-7.png" size:CGSizeMake(1.0, 2.0)], [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-8.png" size:CGSizeMake(2.0, 2.0)] + ]]], + + bezelFocusedColor = [CPColor colorWithPatternImage:[[CPNinePartImage alloc] initWithImageSlices: + [ + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-0.png" size:CGSizeMake(6.0, 7.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-1.png" size:CGSizeMake(1.0, 7.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-2.png" size:CGSizeMake(6.0, 7.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-3.png" size:CGSizeMake(6.0, 1.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-4.png" size:CGSizeMake(1.0, 1.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-5.png" size:CGSizeMake(6.0, 1.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-6.png" size:CGSizeMake(6.0, 5.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-7.png" size:CGSizeMake(1.0, 5.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-square-focused-8.png" size:CGSizeMake(6.0, 5.0)] ]]]; [textfield setBezeled:YES]; + [textfield setValue:bezelColor forThemedAttributeName:@"bezel-color" inControlState:CPControlStateBezeled]; + [textfield setValue:bezelFocusedColor forThemedAttributeName:@"bezel-color" inControlState:CPControlStateBezeled|CPControlStateEditing]; + [textfield setValue:[CPFont systemFontOfSize:12.0] forThemedAttributeName:@"font"]; - [textfield setValue:CGInsetMake(5.0, 4.0, 2.0, 3.0) forThemedAttributeName:@"content-inset" inControlState:CPControlStateBezeled]; - + + [textfield setValue:CGInsetMake(9.0, 8.0, 5.0, 7.0) forThemedAttributeName:@"content-inset" inControlState:CPControlStateBezeled]; + + [textfield setValue:CGInsetMake(4.0, 4.0, 3.0, 4.0) forThemedAttributeName:@"bezel-inset" inControlState:CPControlStateBezeled]; + [textfield setValue:CGInsetMake(0.0, 0.0, 0.0, 0.0) forThemedAttributeName:@"bezel-inset" inControlState:CPControlStateBezeled|CPControlStateEditing]; + [textfield setValue:[CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0] forThemedAttributeName:@"text-color" inControlState:CPTextFieldStatePlaceholder]; - + [textfield setPlaceholderString:"cheese cheese"]; [textfield setStringValue:""]; [textfield setEditable:YES]; @@ -140,22 +160,35 @@ + (CPTextField)themedRoundedTextField { - var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 22.0)], + var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 30.0)], bezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices: [ [_CPCibCustomResource imageResourceWithName:"textfield-bezel-rounded-left.png" size:CGSizeMake(13.0, 22.0)], [_CPCibCustomResource imageResourceWithName:"textfield-bezel-rounded-center.png" size:CGSizeMake(1.0, 22.0)], [_CPCibCustomResource imageResourceWithName:"textfield-bezel-rounded-right.png" size:CGSizeMake(13.0, 22.0)] + ] isVertical:NO]], + + bezelFocusedColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices: + [ + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-rounded-focused-left.png" size:CGSizeMake(17.0, 30.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-rounded-focused-center.png" size:CGSizeMake(1.0, 30.0)], + [_CPCibCustomResource imageResourceWithName:"textfield-bezel-rounded-focused-right.png" size:CGSizeMake(17.0, 30.0)] ] isVertical:NO]]; [textfield setBezeled:YES]; [textfield setBezelStyle:CPTextFieldRoundedBezel]; + [textfield setValue:bezelColor forThemedAttributeName:@"bezel-color" inControlState:CPControlStateBezeled | CPTextFieldStateRounded]; + [textfield setValue:bezelFocusedColor forThemedAttributeName:@"bezel-color" inControlState:CPControlStateBezeled | CPTextFieldStateRounded | CPControlStateEditing]; + [textfield setValue:[CPFont systemFontOfSize:12.0] forThemedAttributeName:@"font"]; - [textfield setValue:CGInsetMake(5.0, 10.0, 2.0, 10.0) forThemedAttributeName:@"content-inset" inControlState:CPControlStateBezeled | CPTextFieldStateRounded]; - + [textfield setValue:CGInsetMake(9.0, 14.0, 6.0, 14.0) forThemedAttributeName:@"content-inset" inControlState:CPControlStateBezeled | CPTextFieldStateRounded]; + + [textfield setValue:CGInsetMake(4.0, 4.0, 4.0, 4.0) forThemedAttributeName:@"bezel-inset" inControlState:CPControlStateBezeled|CPTextFieldStateRounded]; + [textfield setValue:CGInsetMake(0.0, 0.0, 0.0, 0.0) forThemedAttributeName:@"bezel-inset" inControlState:CPControlStateBezeled|CPTextFieldStateRounded|CPControlStateEditing]; + [textfield setValue:[CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0] forThemedAttributeName:@"text-color" inControlState:CPTextFieldStatePlaceholder]; - + [textfield setPlaceholderString:"cheese cheese"]; [textfield setStringValue:""]; [textfield setEditable:YES];