diff --git a/AppKit/CPWindow/_CPStandardWindowView.j b/AppKit/CPWindow/_CPStandardWindowView.j index b2c68ef6a..c9d981880 100644 --- a/AppKit/CPWindow/_CPStandardWindowView.j +++ b/AppKit/CPWindow/_CPStandardWindowView.j @@ -29,6 +29,8 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; @implementation _CPTexturedWindowHeadView : CPView { + BOOL _isSheet @accessors(setter=setSheet:); + _CPWindowView _parentView; CPView _gradientView; CPView _solidView; @@ -69,7 +71,11 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; bounds = [self bounds]; [_gradientView setFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), gradientHeight)]; - [_gradientView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"bezel-head-color" inState:[_parentView themeState] forClass:_CPStandardWindowView]]; + + if (_isSheet) + [_gradientView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"bezel-head-sheet-color" inState:[_parentView themeState] forClass:_CPStandardWindowView]]; + else + [_gradientView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"bezel-head-color" inState:[_parentView themeState] forClass:_CPStandardWindowView]]; [_solidView setFrame:CGRectMake(0.0, gradientHeight, CGRectGetWidth(bounds), CGRectGetHeight(bounds) - gradientHeight)]; [_solidView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"solid-color" forClass:_CPStandardWindowView]]; @@ -97,6 +103,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; CPButton _minimizeButton; BOOL _isDocumentEdited; + BOOL _isSheet; } + (CPString)defaultThemeClass @@ -110,6 +117,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; @"gradient-height": [CPNull null], @"solid-color": [CPNull null], @"bezel-head-color": [CPNull null], + @"bezel-head-sheet-color": [CPNull null], @"divider-color": [CPColor blackColor], @"body-color": [CPColor whiteColor], @"title-bar-height": 32, @@ -224,7 +232,14 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; width = CGRectGetWidth(bounds), headHeight = [self toolbarMaxY]; + if (_isSheet && _toolbarView && [self showsToolbar]) + { + headHeight = [_toolbarView frameSize].height; + [_toolbarView setFrameOrigin:CGPointMake(0.0, 0.0)]; + } + [_headView setFrameSize:CGSizeMake(width, headHeight)]; + [_dividerView setFrame:CGRectMake(0.0, headHeight, width, _CPStandardWindowViewDividerViewHeight)]; var dividerMinY = 0, @@ -312,12 +327,26 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; { [super _enableSheet:enable inWindow:parentWindow]; - [_headView setHidden:enable]; - [_dividerView setHidden:enable]; + _isSheet = enable; + [_headView setSheet:enable]; + + if (_toolbarView && [self showsToolbar]) + { + [_headView setHidden:NO]; + [_dividerView setHidden:NO]; + } + else + { + [_headView setHidden:enable]; + [_dividerView setHidden:enable]; + } + [_closeButton setHidden:enable]; [_minimizeButton setHidden:enable]; [_titleField setHidden:enable]; + [[self window] setMovable:!enable]; + if (enable) { [_bodyView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"body-color" forClass:_CPDocModalWindowView]]; @@ -333,12 +362,13 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; var theWindow = [self window], frame = [theWindow frame], dividerHeight = [_dividerView frame].size.height, - dy; + dy = [self toolbarMaxY] + dividerHeight; + + if (_toolbarView && [self showsToolbar]) + dy = [[CPTheme defaultTheme] valueForAttributeWithName:@"gradient-height" forClass:_CPStandardWindowView]; if (enable) - dy = -[_headView frame].size.height; - else - dy = [self toolbarMaxY] + dividerHeight; + dy = -dy; var newHeight = CGRectGetHeight(frame) + dy, newWidth = CGRectGetWidth(frame); diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-center.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-center.png new file mode 100644 index 000000000..1a86f0428 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-left.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-left.png new file mode 100644 index 000000000..93aad32e6 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-right.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-right.png new file mode 100644 index 000000000..201e8fd64 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-bottom-right.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-center.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-center.png new file mode 100644 index 000000000..1a86f0428 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-left.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-left.png new file mode 100644 index 000000000..93aad32e6 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-right.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-right.png new file mode 100644 index 000000000..201e8fd64 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-center-right.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-center.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-center.png new file mode 100644 index 000000000..408bbde49 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-left.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-left.png new file mode 100644 index 000000000..87ccfb2a6 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-right.png b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-right.png new file mode 100644 index 000000000..a772da252 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/window-standard-head-sheet-solid-top-right.png differ diff --git a/AppKit/Themes/Aristo2/ThemeDescriptors.j b/AppKit/Themes/Aristo2/ThemeDescriptors.j index 6b663393a..384c61f57 100644 --- a/AppKit/Themes/Aristo2/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo2/ThemeDescriptors.j @@ -2070,6 +2070,14 @@ var themedButtonValues = nil, height: 1.0 }), + bezelSheetHeadColor = PatternColor( + "window-standard-head-sheet-solid{position}.png", + { + positions: "full", + width: 5.0, + height: 1.0 + }), + bezelColor = PatternColor( "window-standard{position}.png", { @@ -2104,6 +2112,7 @@ var themedButtonValues = nil, [@"bezel-head-color", bezelHeadColor["inactive"], CPThemeStateNormal], [@"bezel-head-color", bezelHeadColor["@"], CPThemeStateKeyWindow], [@"bezel-head-color", bezelHeadColor["@"], CPThemeStateMainWindow], + [@"bezel-head-sheet-color", bezelSheetHeadColor], [@"solid-color", solidColor], [@"title-font", [CPFont boldSystemFontOfSize:CPFontCurrentSystemSize]],