Changeset 181403 in webkit
- Timestamp:
- Mar 11, 2015, 1:27:42 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181400 r181403 1 2015-03-11 Jer Noble <jer.noble@apple.com> 2 3 [Mac] Update fullscreen placeholder UI to use Vibrancy. 4 https://bugs.webkit.org/show_bug.cgi?id=142586 5 6 Reviewed by Eric Carlson. 7 8 Update the fullscreen placeholder with a translucent vibrant appearance 9 using NSVisualEffectView. Since NSVisuaEffectView is only available for 10 OS X 10.10 and above, wrap the new implementation in a version check and 11 retain the old implementation. 12 13 Drive-by: Update the strings for the placeholder view with new HI guidance 14 as well. 15 16 * English.lproj/Localizable.strings: 17 * platform/LocalizedStrings.cpp: 18 (WebCore::clickToExitFullScreenText): 19 * platform/mac/WebCoreFullScreenPlaceholderView.h: 20 * platform/mac/WebCoreFullScreenPlaceholderView.mm: 21 (-[WebCoreFullScreenPlaceholderView setExitWarningVisible:]): 22 1 23 2015-03-11 Timothy Horton <timothy_horton@apple.com> 2 24 -
trunk/Source/WebCore/English.lproj/Localizable.strings
r180946 r181403 168 168 169 169 /* Message to display in browser window when in webkit full screen mode. */ 170 "Click to exit full screen mode" = "Click to exit full screen mode";170 "Click to Exit Full Screen" = "Click to Exit Full Screen"; 171 171 172 172 /* Subtitle of the label to show on a snapshotted plug-in */ -
trunk/Source/WebCore/platform/LocalizedStrings.cpp
r174402 r181403 1057 1057 String clickToExitFullScreenText() 1058 1058 { 1059 return WEB_UI_STRING("Click to exit full screen mode", "Message to display in browser window when in webkit full screen mode.");1059 return WEB_UI_STRING("Click to Exit Full Screen", "Message to display in browser window when in webkit full screen mode."); 1060 1060 } 1061 1061 -
trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.h
r173176 r181403 32 32 33 33 WEBCORE_EXPORT @interface WebCoreFullScreenPlaceholderView : NSView { 34 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 35 RetainPtr<NSVisualEffectView> _effectView; 36 RetainPtr<NSTextField> _exitWarning; 37 #else 34 38 RetainPtr<NSView> _exitWarning; 39 #endif 35 40 NSObject* _target; 36 41 SEL _action; -
trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.mm
r161589 r181403 46 46 return nil; 47 47 48 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 49 self.wantsLayer = YES; 50 self.autoresizesSubviews = YES; 51 self.layerContentsPlacement = NSViewLayerContentsPlacementTopLeft; 52 self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawNever; 53 54 _effectView = adoptNS([[NSVisualEffectView alloc] initWithFrame:frameRect]); 55 _effectView.get().wantsLayer = YES; 56 _effectView.get().autoresizesSubviews = YES; 57 _effectView.get().autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; 58 _effectView.get().blendingMode = NSVisualEffectBlendingModeWithinWindow; 59 _effectView.get().hidden = YES; 60 _effectView.get().material = NSVisualEffectMaterialLight; 61 _effectView.get().state = NSVisualEffectStateActive; 62 [self addSubview:_effectView.get()]; 63 64 _exitWarning = adoptNS([[NSTextField alloc] initWithFrame:NSZeroRect]); 65 _exitWarning.get().autoresizingMask = NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin; 66 _exitWarning.get().bordered = NO; 67 _exitWarning.get().drawsBackground = NO; 68 _exitWarning.get().editable = NO; 69 _exitWarning.get().font = [NSFont systemFontOfSize:27]; 70 _exitWarning.get().selectable = NO; 71 _exitWarning.get().stringValue = clickToExitFullScreenText(); 72 _exitWarning.get().textColor = [NSColor tertiaryLabelColor]; 73 [_exitWarning sizeToFit]; 74 75 NSRect warningFrame = [_exitWarning.get() frame]; 76 warningFrame.origin = NSMakePoint((frameRect.size.width - warningFrame.size.width) / 2, frameRect.size.height / 2); 77 _exitWarning.get().frame = warningFrame; 78 [_effectView addSubview:_exitWarning.get()]; 79 #else 48 80 [self setLayer:[CALayer layer]]; 49 81 [self setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawNever]; … … 56 88 [_exitWarning.get() setHidden:YES]; 57 89 [self addSubview:_exitWarning.get()]; 90 #endif 58 91 59 92 return self; … … 76 109 - (void)setExitWarningVisible:(BOOL)visible 77 110 { 111 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 112 [_effectView setHidden:!visible]; 113 #else 78 114 [_exitWarning.get() setHidden:!visible]; 79 115 if (visible) { … … 84 120 } else 85 121 [[self layer] setFilters:nil]; 122 #endif 86 123 } 87 124
Note:
See TracChangeset
for help on using the changeset viewer.