Changeset 233945 in webkit
- Timestamp:
- Jul 18, 2018 6:19:40 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r233940 r233945 1 2018-07-18 Ricky Mondello <rmondello@apple.com> 2 3 Let clients override _WKThumbnailView's background color 4 5 https://bugs.webkit.org/show_bug.cgi?id=187788 6 7 Reviewed by Tim Horton. 8 9 * UIProcess/API/Cocoa/_WKThumbnailView.h: Declare a property. 10 * UIProcess/API/Cocoa/_WKThumbnailView.mm: Define an ivar. 11 (-[_WKThumbnailView updateLayer]): Consult the background color. 12 (-[_WKThumbnailView setOverrideBackgroundColor:]): Notably, call -updateLayer. 13 (-[_WKThumbnailView overrideBackgroundColor]): Added. 14 1 15 2018-07-18 Jer Noble <jer.noble@apple.com> 2 16 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.h
r223439 r233945 49 49 @property (nonatomic) BOOL shouldKeepSnapshotWhenRemovedFromSuperview; 50 50 51 @property (strong, nonatomic) NSColor *overrideBackgroundColor; 52 51 53 // This should be removed when all clients go away; it is always YES now. 52 54 @property (nonatomic) BOOL usesSnapshot; -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm
r233181 r233945 58 58 CGFloat _lastSnapshotScale; 59 59 CGSize _lastSnapshotMaximumSize; 60 61 RetainPtr<NSColor *> _overrideBackgroundColor; 60 62 } 61 63 … … 112 114 [super updateLayer]; 113 115 114 self.layer.backgroundColor = [NSColor quaternaryLabelColor].CGColor; 116 NSColor *backgroundColor = self.overrideBackgroundColor ?: [NSColor quaternaryLabelColor]; 117 self.layer.backgroundColor = backgroundColor.CGColor; 115 118 } 116 119 … … 146 149 [thumbnailView _didTakeSnapshot:cgImage.get()]; 147 150 }); 151 } 152 153 - (void)setOverrideBackgroundColor:(NSColor *)overrideBackgroundColor 154 { 155 if ([_overrideBackgroundColor isEqual:overrideBackgroundColor]) 156 return; 157 158 _overrideBackgroundColor = overrideBackgroundColor; 159 [self setNeedsDisplay:YES]; 160 } 161 162 - (NSColor *)overrideBackgroundColor 163 { 164 return _overrideBackgroundColor.get(); 148 165 } 149 166
Note: See TracChangeset
for help on using the changeset viewer.