From e1ba234a764d9d2bacd5009942eabf113e907e6a Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Wed, 9 Jan 2013 16:01:18 -0800 Subject: [PATCH] Fixed bug about the position of closable buttons. Fixed bug about theme attribute for sheet window --- AppKit/CPWindow/_CPStandardWindowView.j | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AppKit/CPWindow/_CPStandardWindowView.j b/AppKit/CPWindow/_CPStandardWindowView.j index 48bb5d858..5d3223473 100644 --- a/AppKit/CPWindow/_CPStandardWindowView.j +++ b/AppKit/CPWindow/_CPStandardWindowView.j @@ -190,6 +190,7 @@ var _CPStandardWindowViewBodyBackgroundColor = nil, if (_styleMask & CPMiniaturizableWindowMask && ![CPPlatform isBrowser]) { _minimizeButton = [[CPButton alloc] initWithFrame:CGRectMake(27.0, 7.0, 16.0, 16.0)]; + [_minimizeButton setButtonType:CPMomentaryChangeButton]; [_minimizeButton setBordered:NO]; [self addSubview:_minimizeButton]; @@ -280,6 +281,9 @@ var _CPStandardWindowViewBodyBackgroundColor = nil, - (void)_updateCloseButton { + [_closeButton setFrameSize:[self valueForThemeAttribute:@"close-image-size"]]; + [_closeButton setFrameOrigin:[self valueForThemeAttribute:@"close-image-origin"]]; + if (_isDocumentEdited) { [_closeButton setImage:[self valueForThemeAttribute:@"unsaved-image-button"]]; @@ -317,8 +321,9 @@ var _CPStandardWindowViewBodyBackgroundColor = nil, [_minimizeButton setHidden:enable]; [_titleField setHidden:enable]; + // Alloc a new class to get a theme attribute if (enable) - [_bodyView setBackgroundColor:[_CPDocModalWindowView bodyBackgroundColor]]; + [_bodyView setBackgroundColor:[[_CPDocModalWindowView new] valueForThemeAttribute:@"body-color"]]; else [_bodyView setBackgroundColor:[self valueForThemeAttribute:@"body-color"]];