From 8b7675baee3c35e88d5d9cbe106e1d05b38ad496 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 14 Mar 2017 13:57:39 -0700 Subject: [PATCH] Add more forward declarations for scrubber APIs --- atom/browser/ui/cocoa/atom_touch_bar.mm | 8 ++++---- .../ui/cocoa/touch_bar_forward_declarations.h | 13 ++++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/atom/browser/ui/cocoa/atom_touch_bar.mm b/atom/browser/ui/cocoa/atom_touch_bar.mm index 67e7265bbe7..4a8ee3bc3ef 100644 --- a/atom/browser/ui/cocoa/atom_touch_bar.mm +++ b/atom/browser/ui/cocoa/atom_touch_bar.mm @@ -536,17 +536,17 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item"; settings.Get("overlayStyle", &overlayStyle); if (selectedStyle == "outline") { - scrubber.selectionBackgroundStyle = [NSScrubberSelectionStyle outlineOverlayStyle]; + scrubber.selectionBackgroundStyle = [NSClassFromString(@"NSScrubberSelectionStyle") outlineOverlayStyle]; } else if (selectedStyle == "background") { - scrubber.selectionBackgroundStyle = [NSScrubberSelectionStyle roundedBackgroundStyle]; + scrubber.selectionBackgroundStyle = [NSClassFromString(@"NSScrubberSelectionStyle") roundedBackgroundStyle]; } else { scrubber.selectionBackgroundStyle = nil; } if (overlayStyle == "outline") { - scrubber.selectionOverlayStyle = [NSScrubberSelectionStyle outlineOverlayStyle]; + scrubber.selectionOverlayStyle = [NSClassFromString(@"NSScrubberSelectionStyle") outlineOverlayStyle]; } else if (overlayStyle == "background") { - scrubber.selectionOverlayStyle = [NSScrubberSelectionStyle roundedBackgroundStyle]; + scrubber.selectionOverlayStyle = [NSClassFromString(@"NSScrubberSelectionStyle") roundedBackgroundStyle]; } else { scrubber.selectionOverlayStyle = nil; } diff --git a/atom/browser/ui/cocoa/touch_bar_forward_declarations.h b/atom/browser/ui/cocoa/touch_bar_forward_declarations.h index 9246379cf5a..9f2be3091e7 100644 --- a/atom/browser/ui/cocoa/touch_bar_forward_declarations.h +++ b/atom/browser/ui/cocoa/touch_bar_forward_declarations.h @@ -14,7 +14,7 @@ #pragma clang assume_nonnull begin @class NSTouchBar, NSTouchBarItem; -@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView; +@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle; @protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource; typedef float NSTouchBarItemPriority; @@ -134,6 +134,10 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy = @property(weak) id delegate; @property(weak) id dataSource; @property NSScrubberMode mode; +@property BOOL showsArrowButtons; +@property(getter=isContinuous) BOOL continuous; +@property(strong, nullable) NSScrubberSelectionStyle* selectionBackgroundStyle; +@property(strong, nullable) NSScrubberSelectionStyle* selectionOverlayStyle; - (void)registerClass:(Class)itemViewClass forItemIdentifier:(NSString*)itemIdentifier; @@ -144,6 +148,13 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy = @end +@interface NSScrubberSelectionStyle : NSObject + +@property(class, strong, readonly) NSScrubberSelectionStyle* outlineOverlayStyle; +@property(class, strong, readonly) NSScrubberSelectionStyle* roundedBackgroundStyle; + +@end + @interface NSScrubberArrangedView : NSView @end