├── .gitignore ├── Configurations ├── Base.xcconfig ├── Debug.xcconfig ├── MMTabBarViewDemo-Base.xcconfig ├── MMTabBarViewDemo-Debug.xcconfig ├── MMTabBarViewDemo-Release.xcconfig ├── MMTabBarViewFramework-Base.xcconfig ├── MMTabBarViewFramework-Debug.xcconfig ├── MMTabBarViewFramework-Release.xcconfig └── Release.xcconfig ├── MMTabBarView Demo ├── MMTabBarView Demo.xcodeproj │ └── project.pbxproj └── MMTabBarView Demo │ ├── DemoFakeModel.h │ ├── DemoFakeModel.m │ ├── DemoWindowController.h │ ├── DemoWindowController.m │ ├── Images │ └── largeImage.png │ ├── MMAppDelegate.h │ ├── MMAppDelegate.m │ ├── MMTabBarView Demo-Info.plist │ ├── MMTabBarView Demo-Prefix.pch │ ├── en.lproj │ ├── Credits.rtf │ ├── DemoWindow.xib │ ├── InfoPlist.strings │ └── MainMenu.xib │ └── main.m ├── MMTabBarView ├── MMTabBarView.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── MMTabBarView.xcscheme └── MMTabBarView │ ├── Images.xcassets │ ├── AdiumGradient.imageset │ │ ├── AdiumGradient.png │ │ └── Contents.json │ ├── AquaTabCloseDirty_Front.imageset │ │ ├── AquaTabCloseDirty_Front.png │ │ └── Contents.json │ ├── AquaTabCloseDirty_Front_Pressed.imageset │ │ ├── AquaTabCloseDirty_Front_Pressed.png │ │ └── Contents.json │ ├── AquaTabCloseDirty_Front_Rollover.imageset │ │ ├── AquaTabCloseDirty_Front_Rollover.png │ │ └── Contents.json │ ├── AquaTabClose_Front.imageset │ │ ├── AquaTabClose_Front.png │ │ ├── AquaTabClose_Front@2x.png │ │ └── Contents.json │ ├── AquaTabClose_Front_Pressed.imageset │ │ ├── AquaTabClose_Front_Pressed.png │ │ ├── AquaTabClose_Front_Pressed@2x.png │ │ └── Contents.json │ ├── AquaTabClose_Front_Rollover.imageset │ │ ├── AquaTabClose_Front_Rollover.png │ │ ├── AquaTabClose_Front_Rollover@2x.png │ │ └── Contents.json │ ├── AquaTabNew.imageset │ │ ├── AquaTabNew.png │ │ ├── AquaTabNew@2x.png │ │ └── Contents.json │ ├── AquaTabNewPressed.imageset │ │ ├── AquaTabNewPressed.png │ │ ├── AquaTabNewPressed@2x.png │ │ └── Contents.json │ ├── AquaTabNewRollover.imageset │ │ ├── AquaTabNewRollover.png │ │ ├── AquaTabNewRollover@2x.png │ │ └── Contents.json │ ├── AquaTabsBackground.imageset │ │ ├── AquaTabsBackground.png │ │ └── Contents.json │ ├── AquaTabsDown.imageset │ │ ├── AquaTabsDown.png │ │ └── Contents.json │ ├── AquaTabsDownGraphite.imageset │ │ ├── AquaTabsDownGraphite.png │ │ └── Contents.json │ ├── AquaTabsDownNonKey.imageset │ │ ├── AquaTabsDownNonKey.png │ │ └── Contents.json │ ├── AquaTabsSeparator.imageset │ │ ├── AquaTabsSeparator.png │ │ └── Contents.json │ ├── AquaTabsSeparatorDown.imageset │ │ ├── AquaTabsSeparatorDown.png │ │ └── Contents.json │ ├── Contents.json │ ├── TabClose_Dirty.imageset │ │ ├── Contents.json │ │ ├── TabClose_Dirty.png │ │ └── TabClose_Dirty@2x.png │ ├── TabClose_Dirty_Pressed.imageset │ │ ├── Contents.json │ │ ├── TabClose_Dirty_Pressed.png │ │ └── TabClose_Dirty_Pressed@2x.png │ ├── TabClose_Dirty_Rollover.imageset │ │ ├── Contents.json │ │ ├── TabClose_Dirty_Rollover.png │ │ └── TabClose_Dirty_Rollover@2x.png │ ├── TabClose_Front.imageset │ │ ├── Contents.json │ │ ├── TabClose_Front.png │ │ └── TabClose_Front@2x.png │ ├── TabClose_Front_Pressed.imageset │ │ ├── Contents.json │ │ ├── TabClose_Front_Pressed.png │ │ └── TabClose_Front_Pressed@2x.png │ ├── TabClose_Front_Rollover.imageset │ │ ├── Contents.json │ │ ├── TabClose_Front_Rollover.png │ │ └── TabClose_Front_Rollover@2x.png │ ├── TabNewMetal.imageset │ │ ├── Contents.json │ │ └── TabNewMetal.png │ ├── TabNewMetalPressed.imageset │ │ ├── Contents.json │ │ └── TabNewMetalPressed.png │ ├── TabNewMetalRollover.imageset │ │ ├── Contents.json │ │ └── TabNewMetalRollover.png │ ├── overflowImage.imageset │ │ ├── Contents.json │ │ ├── overflowImage.png │ │ └── overflowImage@2x.png │ ├── overflowImagePressed.imageset │ │ ├── Contents.json │ │ ├── overflowImagePressed.png │ │ └── overflowImagePressed@2x.png │ └── pi.imageset │ │ ├── Contents.json │ │ └── pi.png │ ├── MMAttachedTabBarButton.h │ ├── MMAttachedTabBarButton.m │ ├── MMAttachedTabBarButtonCell.h │ ├── MMAttachedTabBarButtonCell.m │ ├── MMOverflowPopUpButton.h │ ├── MMOverflowPopUpButton.m │ ├── MMOverflowPopUpButtonCell.h │ ├── MMOverflowPopUpButtonCell.m │ ├── MMProgressIndicator.h │ ├── MMProgressIndicator.m │ ├── MMRolloverButton.h │ ├── MMRolloverButton.m │ ├── MMRolloverButtonCell.h │ ├── MMRolloverButtonCell.m │ ├── MMSlideButtonsAnimation.h │ ├── MMSlideButtonsAnimation.m │ ├── MMTabBarButton.Common.h │ ├── MMTabBarButton.Private.h │ ├── MMTabBarButton.h │ ├── MMTabBarButton.m │ ├── MMTabBarButtonCell.Private.h │ ├── MMTabBarButtonCell.h │ ├── MMTabBarButtonCell.m │ ├── MMTabBarController.h │ ├── MMTabBarController.m │ ├── MMTabBarItem.h │ ├── MMTabBarView-Info.plist │ ├── MMTabBarView-Prefix.pch │ ├── MMTabBarView.Globals.h │ ├── MMTabBarView.Private.h │ ├── MMTabBarView.h │ ├── MMTabBarView.m │ ├── MMTabDragAssistant.h │ ├── MMTabDragAssistant.m │ ├── MMTabDragView.h │ ├── MMTabDragView.m │ ├── MMTabDragWindow.h │ ├── MMTabDragWindow.m │ ├── MMTabDragWindowController.h │ ├── MMTabDragWindowController.m │ ├── MMTabPasteboardItem.h │ ├── MMTabPasteboardItem.m │ ├── MMTabStyle.h │ ├── NSAffineTransform+MMTabBarViewExtensions.h │ ├── NSAffineTransform+MMTabBarViewExtensions.m │ ├── NSBezierPath+MMTabBarViewExtensions.h │ ├── NSBezierPath+MMTabBarViewExtensions.m │ ├── NSCell+MMTabBarViewExtensions.h │ ├── NSCell+MMTabBarViewExtensions.m │ ├── NSString+MMTabBarViewExtensions.h │ ├── NSString+MMTabBarViewExtensions.m │ ├── NSTabViewItem+MMTabBarViewExtensions.h │ ├── NSTabViewItem+MMTabBarViewExtensions.m │ ├── NSView+MMTabBarViewExtensions.h │ ├── NSView+MMTabBarViewExtensions.m │ ├── Styles │ ├── MMAdiumTabStyle.h │ ├── MMAdiumTabStyle.m │ ├── MMAquaTabStyle.h │ ├── MMAquaTabStyle.m │ ├── MMCardTabStyle.h │ ├── MMCardTabStyle.m │ ├── MMLiveChatTabStyle.h │ ├── MMLiveChatTabStyle.m │ ├── MMMetalTabStyle.h │ ├── MMMetalTabStyle.m │ ├── MMUnifiedTabStyle.h │ ├── MMUnifiedTabStyle.m │ ├── Mojave Tab Style │ │ ├── MMMojaveTabStyle+Assets.h │ │ ├── MMMojaveTabStyle+Assets.m │ │ ├── MMMojaveTabStyle.h │ │ └── MMMojaveTabStyle.m │ ├── Safari Tab Style │ │ ├── MMSafariTabStyle.h │ │ ├── MMSafariTabStyle.m │ │ └── Safari.xcassets │ │ │ ├── Contents.json │ │ │ ├── SafariAWATClose.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWATClose.png │ │ │ └── SafariAWATClose@2x.png │ │ │ ├── SafariAWATClosePressed.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWATClosePressed.png │ │ │ └── SafariAWATClosePressed@2x.png │ │ │ ├── SafariAWATCloseRollover.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWATCloseRollover.png │ │ │ └── SafariAWATCloseRollover@2x.png │ │ │ ├── SafariAWATFill.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWATFill.png │ │ │ └── SafariAWATFill@2x.png │ │ │ ├── SafariAWATLeftCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWATLeftCap.png │ │ │ └── SafariAWATLeftCap@2x.png │ │ │ ├── SafariAWATRightCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWATRightCap.png │ │ │ └── SafariAWATRightCap@2x.png │ │ │ ├── SafariAWAddTabButton.imageset │ │ │ ├── Contents.json │ │ │ └── SafariAWAddTabButton.png │ │ │ ├── SafariAWAddTabButtonPushed.imageset │ │ │ ├── Contents.json │ │ │ └── SafariAWAddTabButtonPushed.png │ │ │ ├── SafariAWAddTabButtonRolloverPlus.imageset │ │ │ ├── Contents.json │ │ │ └── SafariAWAddTabButtonRolloverPlus.png │ │ │ ├── SafariAWBG.imageset │ │ │ ├── Contents.json │ │ │ └── SafariAWBG.png │ │ │ ├── SafariAWITClose.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWITClose.png │ │ │ └── SafariAWITClose@2x.png │ │ │ ├── SafariAWITClosePressed.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWITClosePressed.png │ │ │ └── SafariAWITClosePressed@2x.png │ │ │ ├── SafariAWITCloseRollover.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWITCloseRollover.png │ │ │ └── SafariAWITCloseRollover@2x.png │ │ │ ├── SafariAWITLeftCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWITLeftCap.png │ │ │ └── SafariAWITLeftCap@2x.png │ │ │ ├── SafariAWITRightCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariAWITRightCap.png │ │ │ └── SafariAWITRightCap@2x.png │ │ │ ├── SafariIWATClose.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWATClose.png │ │ │ └── SafariIWATClose@2x.png │ │ │ ├── SafariIWATClosePressed.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWATClosePressed.png │ │ │ └── SafariIWATClosePressed@2x.png │ │ │ ├── SafariIWATCloseRollover.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWATCloseRollover.png │ │ │ └── SafariIWATCloseRollover@2x.png │ │ │ ├── SafariIWATFill.imageset │ │ │ ├── Contents.json │ │ │ └── SafariIWATFill.png │ │ │ ├── SafariIWATLeftCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWATLeftCap.png │ │ │ └── SafariIWATLeftCap@2x.png │ │ │ ├── SafariIWATRightCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWATRightCap.png │ │ │ └── SafariIWATRightCap@2x.png │ │ │ ├── SafariIWAddTabButton.imageset │ │ │ ├── Contents.json │ │ │ └── SafariIWAddTabButton.png │ │ │ ├── SafariIWBG.imageset │ │ │ ├── Contents.json │ │ │ └── SafariIWBG.png │ │ │ ├── SafariIWITClose.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWITClose.png │ │ │ └── SafariIWITClose@2x.png │ │ │ ├── SafariIWITClosePressed.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWITClosePressed.png │ │ │ └── SafariIWITClosePressed@2x.png │ │ │ ├── SafariIWITCloseRollover.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWITCloseRollover.png │ │ │ └── SafariIWITCloseRollover@2x.png │ │ │ ├── SafariIWITLeftCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWITLeftCap.png │ │ │ └── SafariIWITLeftCap@2x.png │ │ │ └── SafariIWITRightCap.imageset │ │ │ ├── Contents.json │ │ │ ├── SafariIWITRightCap.png │ │ │ └── SafariIWITRightCap@2x.png │ └── Yosemite Tab Style │ │ ├── Images │ │ ├── YosemiteTabNewPressed.png │ │ └── YosemiteTabNewPressed@2x.png │ │ ├── MMYosemiteTabStyle.h │ │ ├── MMYosemiteTabStyle.m │ │ └── Yosemite.xcassets │ │ ├── Contents.json │ │ ├── YosemiteTabClose_Front.imageset │ │ ├── Contents.json │ │ ├── YosemiteTabClose_Front.png │ │ └── YosemiteTabClose_Front@2x.png │ │ ├── YosemiteTabClose_Front_Pressed.imageset │ │ ├── Contents.json │ │ ├── YosemiteTabClose_Front_Pressed.png │ │ └── YosemiteTabClose_Front_Pressed@2x.png │ │ ├── YosemiteTabClose_Front_Rollover.imageset │ │ ├── Contents.json │ │ ├── YosemiteTabClose_Front_Rollover.png │ │ └── YosemiteTabClose_Front_Rollover@2x.png │ │ ├── YosemiteTabNew.imageset │ │ ├── Contents.json │ │ ├── YosemiteTabNew.png │ │ └── YosemiteTabNew@2x.png │ │ └── YosemiteTabNewPressed.imageset │ │ ├── Contents.json │ │ ├── YosemiteTabNewPressed.png │ │ └── YosemiteTabNewPressed@2x.png │ └── en.lproj │ └── InfoPlist.strings ├── OriginalGraphics ├── AquaTabNew.psd ├── AquaTabNewPressed.psd └── AquaTabNewRollover.psd ├── README.md └── default.xcworkspace ├── contents.xcworkspacedata └── xcshareddata ├── IDEWorkspaceChecks.plist ├── default.xccheckout └── xcschemes ├── MMTabBarView Demo.xcscheme └── MMTabBarView.xcscheme /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata 14 | profile 15 | *.moved-aside 16 | 17 | # OSX 18 | .DS_Store 19 | -------------------------------------------------------------------------------- /Configurations/Base.xcconfig: -------------------------------------------------------------------------------- 1 | ARCHS = $(ARCHS_STANDARD) 2 | GCC_C_LANGUAGE_STANDARD = gnu99 3 | MACOSX_DEPLOYMENT_TARGET = 10.9 4 | SDKROOT = macosx 5 | COMBINE_HIDPI_IMAGES = NO 6 | WARNING_CFLAGS = -Wmost -Wno-four-char-constants -Wno-unknown-pragmas 7 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0 8 | GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h 9 | GCC_PRECOMPILE_PREFIX_HEADER = YES 10 | CLANG_ENABLE_MODULES = YES 11 | WARNING_CFLAGS = -Weverything -Wno-custom-atomic-properties -Wno-direct-ivar-access -Wno-float-equal -Wno-gnu -Wno-objc-missing-property-synthesis 12 | -------------------------------------------------------------------------------- /Configurations/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Base.xcconfig" 2 | ONLY_ACTIVE_ARCH = YES 3 | COPY_PHASE_STRIP = NO 4 | GCC_OPTIMIZATION_LEVEL = 0 5 | GCC_DYNAMIC_NO_PIC = NO 6 | GCC_MODEL_TUNING = G5 7 | -------------------------------------------------------------------------------- /Configurations/MMTabBarViewDemo-Base.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Base.xcconfig" 2 | OTHER_LDFLAGS = -framework Foundation -framework AppKit 3 | PRODUCT_NAME = MMTabBarViewDemo 4 | INSTALL_PATH = $(HOME)/Applications 5 | INFOPLIST_FILE = MMTabBarViewDemo/MMTabBarViewDemo/MMTabBarView Demo-Info.plist 6 | ALWAYS_SEARCH_USER_PATHS = NO 7 | //:configuration = Debug 8 | LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks 9 | 10 | //:configuration = Release 11 | LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks 12 | 13 | -------------------------------------------------------------------------------- /Configurations/MMTabBarViewDemo-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Debug.xcconfig" 2 | #include "MMTabBarViewDemo-Base.xcconfig" 3 | -------------------------------------------------------------------------------- /Configurations/MMTabBarViewDemo-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Release.xcconfig" 2 | #include "MMTabBarViewDemo-Base.xcconfig" 3 | 4 | COPY_PHASE_STRIP = YES 5 | ZERO_LINK = NO 6 | -------------------------------------------------------------------------------- /Configurations/MMTabBarViewFramework-Base.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Base.xcconfig" 2 | PRODUCT_NAME = MMTabBarView 3 | DYLIB_CURRENT_VERSION = 1 4 | SKIP_INSTALL = YES 5 | GCC_ENABLE_OBJC_GC = unsupported 6 | FRAMEWORK_VERSION = A 7 | INFOPLIST_FILE = MMTabBarView/MMTabBarView/MMTabBarView-Info.plist 8 | DYLIB_COMPATIBILITY_VERSION = 1 9 | DYLIB_INSTALL_NAME_BASE = @rpath 10 | DEFINES_MODULE = YES -------------------------------------------------------------------------------- /Configurations/MMTabBarViewFramework-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Debug.xcconfig" 2 | #include "MMTabBarViewFramework-Base.xcconfig" 3 | -------------------------------------------------------------------------------- /Configurations/MMTabBarViewFramework-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Release.xcconfig" 2 | #include "MMTabBarViewFramework-Base.xcconfig" 3 | INSTALL_MODE_FLAG = go-w,a+rX 4 | -------------------------------------------------------------------------------- /Configurations/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Base.xcconfig" 2 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 3 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/DemoFakeModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // FakeModel.h 3 | // MMTabBarView Demo 4 | // 5 | // Created by John Pannell on 12/19/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | #if __has_feature(modules) 16 | @import MMTabBarView; 17 | #else 18 | #import 19 | #endif 20 | 21 | @interface DemoFakeModel : NSObject 22 | 23 | @property (copy) NSString *title; 24 | @property (strong) NSImage *largeImage; 25 | @property (strong) NSImage *icon; 26 | @property (strong) NSString *iconName; 27 | 28 | @property (assign) BOOL isProcessing; 29 | @property (assign) NSInteger objectCount; 30 | @property (strong) NSColor *objectCountColor; 31 | @property (assign) BOOL showObjectCount; 32 | @property (assign) BOOL isEdited; 33 | @property (assign) BOOL hasCloseButton; 34 | 35 | // designated initializer 36 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/DemoFakeModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // FakeModel.m 3 | // MMTabBarView Demo 4 | // 5 | // Created by John Pannell on 12/19/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import "DemoFakeModel.h" 10 | 11 | @implementation DemoFakeModel 12 | 13 | - (instancetype)init { 14 | if ((self = [super init]) != nil) { 15 | _isProcessing = NO; 16 | _icon = nil; 17 | _iconName = nil; 18 | _largeImage = nil; 19 | _objectCount = 2; 20 | _isEdited = NO; 21 | _hasCloseButton = YES; 22 | _title = @"Untitled"; 23 | _objectCountColor = nil; 24 | _showObjectCount = YES; 25 | } 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/DemoWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WindowController.h 3 | // MMTabBarView Demo 4 | // 5 | // Created by John Pannell on 4/6/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | #if __has_feature(modules) 16 | @import MMTabBarView; 17 | #else 18 | #import 19 | #endif 20 | 21 | @interface DemoWindowController : NSWindowController { 22 | IBOutlet NSTabView *tabView; 23 | IBOutlet NSTextField *tabField; 24 | IBOutlet NSDrawer *drawer; 25 | 26 | IBOutlet MMTabBarView *tabBar; 27 | 28 | IBOutlet NSButton *isProcessingButton; 29 | IBOutlet NSButton *isEditedButton; 30 | IBOutlet NSButton *hasLargeImageButton; 31 | IBOutlet NSTextField *objectCounterField; 32 | IBOutlet NSColorWell *objectCounterColorWell; 33 | IBOutlet NSPopUpButton *iconButton; 34 | IBOutlet NSButton *hasCloserButton; 35 | IBOutlet NSButton *showObjectCountButton; 36 | 37 | IBOutlet NSPopUpButton *popUp_style; 38 | IBOutlet NSPopUpButton *popUp_orientation; 39 | IBOutlet NSPopUpButton *popUp_tearOff; 40 | IBOutlet NSButton *button_onlyShowCloseOnHover; 41 | IBOutlet NSButton *button_canCloseOnlyTab; 42 | IBOutlet NSButton *button_disableTabClosing; 43 | IBOutlet NSButton *button_allowBackgroundClosing; 44 | IBOutlet NSButton *button_hideForSingleTab; 45 | IBOutlet NSButton *button_showAddTab; 46 | IBOutlet NSButton *button_useOverflow; 47 | IBOutlet NSButton *button_automaticallyAnimate; 48 | IBOutlet NSButton *button_allowScrubbing; 49 | IBOutlet NSButton *button_sizeToFit; 50 | IBOutlet NSTextField *textField_minWidth; 51 | IBOutlet NSTextField *textField_maxWidth; 52 | IBOutlet NSTextField *textField_optimumWidth; 53 | } 54 | 55 | - (void)addDefaultTabs; 56 | 57 | - (void)addNewTabWithTitle:(NSString *)aTitle; 58 | 59 | - (MMTabBarView *)tabBar; 60 | 61 | // Actions 62 | - (IBAction)addNewTab:(id)sender; 63 | - (IBAction)closeTab:(id)sender; 64 | 65 | - (IBAction)setIconNamed:(id)sender; 66 | - (IBAction)setObjectCount:(id)sender; 67 | - (IBAction)setObjectCountColor:(id)sender; 68 | - (IBAction)setTabLabel:(id)sender; 69 | 70 | - (IBAction)showObjectCountAction:(id)sender; 71 | - (IBAction)isProcessingAction:(id)sender; 72 | - (IBAction)isEditedAction:(id)sender; 73 | - (IBAction)hasCloseButtonAction:(id)sender; 74 | - (IBAction)hasLargeImageAction:(id)sender; 75 | 76 | // Toolbar 77 | - (IBAction)toggleToolbar:(id)sender; 78 | - (BOOL)validateToolbarItem:(NSToolbarItem *)theItem; 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/Images/largeImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView Demo/MMTabBarView Demo/Images/largeImage.png -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/MMAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.h 3 | // MMTabBarView Demo 4 | // 5 | // Created by Michael Monscheuer on 9/19/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | @interface MMAppDelegate : NSObject 16 | 17 | - (IBAction)newWindow:(id)pSender; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/MMAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.m 3 | // MMTabBarView Demo 4 | // 5 | // Created by Michael Monscheuer on 9/19/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "MMAppDelegate.h" 10 | 11 | #import "DemoWindowController.h" 12 | 13 | @implementation MMAppDelegate 14 | 15 | 16 | - (void)applicationDidFinishLaunching:(NSNotification *)pNotification { 17 | [NSColorPanel.sharedColorPanel setShowsAlpha:YES]; 18 | 19 | [self newWindow:self]; 20 | } 21 | - (IBAction)newWindow:(id)sender { 22 | // create window controller 23 | DemoWindowController *newWindowController = [[DemoWindowController alloc] initWithWindowNibName:@"DemoWindow"]; 24 | // load window (as we need the nib file to be loaded before we can proceed 25 | [newWindowController loadWindow]; 26 | // add the default tabs 27 | [newWindowController addDefaultTabs]; 28 | // finally show the window 29 | [newWindowController showWindow:self]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/MMTabBarView Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2012-2016 Michael Monscheuer. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/MMTabBarView Demo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MMTabBarView Demo' target in the 'MMTabBarView Demo' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #if __has_feature(modules) 7 | @import Cocoa; 8 | #else 9 | #import 10 | #endif 11 | #endif 12 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MMTabBarView Demo/MMTabBarView Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MMTabBarView Demo 4 | // 5 | // Created by Michael Monscheuer on 9/19/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | int main(int argc, char const* __nonnull argv[__nonnull]) 16 | { 17 | return NSApplicationMain(argc, argv); 18 | } 19 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView.xcodeproj/xcshareddata/xcschemes/MMTabBarView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AdiumGradient.imageset/AdiumGradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AdiumGradient.imageset/AdiumGradient.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AdiumGradient.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AdiumGradient.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front.imageset/AquaTabCloseDirty_Front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front.imageset/AquaTabCloseDirty_Front.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabCloseDirty_Front.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front_Pressed.imageset/AquaTabCloseDirty_Front_Pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front_Pressed.imageset/AquaTabCloseDirty_Front_Pressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front_Pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabCloseDirty_Front_Pressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front_Rollover.imageset/AquaTabCloseDirty_Front_Rollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front_Rollover.imageset/AquaTabCloseDirty_Front_Rollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabCloseDirty_Front_Rollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabCloseDirty_Front_Rollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front.imageset/AquaTabClose_Front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front.imageset/AquaTabClose_Front.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front.imageset/AquaTabClose_Front@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front.imageset/AquaTabClose_Front@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabClose_Front.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AquaTabClose_Front@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Pressed.imageset/AquaTabClose_Front_Pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Pressed.imageset/AquaTabClose_Front_Pressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Pressed.imageset/AquaTabClose_Front_Pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Pressed.imageset/AquaTabClose_Front_Pressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabClose_Front_Pressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AquaTabClose_Front_Pressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Rollover.imageset/AquaTabClose_Front_Rollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Rollover.imageset/AquaTabClose_Front_Rollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Rollover.imageset/AquaTabClose_Front_Rollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Rollover.imageset/AquaTabClose_Front_Rollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabClose_Front_Rollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabClose_Front_Rollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AquaTabClose_Front_Rollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNew.imageset/AquaTabNew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNew.imageset/AquaTabNew.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNew.imageset/AquaTabNew@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNew.imageset/AquaTabNew@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNew.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabNew.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AquaTabNew@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewPressed.imageset/AquaTabNewPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewPressed.imageset/AquaTabNewPressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewPressed.imageset/AquaTabNewPressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewPressed.imageset/AquaTabNewPressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewPressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabNewPressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AquaTabNewPressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewRollover.imageset/AquaTabNewRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewRollover.imageset/AquaTabNewRollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewRollover.imageset/AquaTabNewRollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewRollover.imageset/AquaTabNewRollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabNewRollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabNewRollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AquaTabNewRollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsBackground.imageset/AquaTabsBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsBackground.imageset/AquaTabsBackground.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabsBackground.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDown.imageset/AquaTabsDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDown.imageset/AquaTabsDown.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDown.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabsDown.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDownGraphite.imageset/AquaTabsDownGraphite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDownGraphite.imageset/AquaTabsDownGraphite.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDownGraphite.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabsDownGraphite.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDownNonKey.imageset/AquaTabsDownNonKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDownNonKey.imageset/AquaTabsDownNonKey.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsDownNonKey.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabsDownNonKey.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsSeparator.imageset/AquaTabsSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsSeparator.imageset/AquaTabsSeparator.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsSeparator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabsSeparator.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsSeparatorDown.imageset/AquaTabsSeparatorDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsSeparatorDown.imageset/AquaTabsSeparatorDown.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/AquaTabsSeparatorDown.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AquaTabsSeparatorDown.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabClose_Dirty.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TabClose_Dirty@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty.imageset/TabClose_Dirty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty.imageset/TabClose_Dirty.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty.imageset/TabClose_Dirty@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty.imageset/TabClose_Dirty@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabClose_Dirty_Pressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TabClose_Dirty_Pressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Pressed.imageset/TabClose_Dirty_Pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Pressed.imageset/TabClose_Dirty_Pressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Pressed.imageset/TabClose_Dirty_Pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Pressed.imageset/TabClose_Dirty_Pressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Rollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabClose_Dirty_Rollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TabClose_Dirty_Rollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Rollover.imageset/TabClose_Dirty_Rollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Rollover.imageset/TabClose_Dirty_Rollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Rollover.imageset/TabClose_Dirty_Rollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Dirty_Rollover.imageset/TabClose_Dirty_Rollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabClose_Front.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TabClose_Front@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front.imageset/TabClose_Front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front.imageset/TabClose_Front.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front.imageset/TabClose_Front@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front.imageset/TabClose_Front@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabClose_Front_Pressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TabClose_Front_Pressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Pressed.imageset/TabClose_Front_Pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Pressed.imageset/TabClose_Front_Pressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Pressed.imageset/TabClose_Front_Pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Pressed.imageset/TabClose_Front_Pressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Rollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabClose_Front_Rollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TabClose_Front_Rollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Rollover.imageset/TabClose_Front_Rollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Rollover.imageset/TabClose_Front_Rollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Rollover.imageset/TabClose_Front_Rollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabClose_Front_Rollover.imageset/TabClose_Front_Rollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabNewMetal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetal.imageset/TabNewMetal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetal.imageset/TabNewMetal.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetalPressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabNewMetalPressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetalPressed.imageset/TabNewMetalPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetalPressed.imageset/TabNewMetalPressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetalRollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TabNewMetalRollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetalRollover.imageset/TabNewMetalRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/TabNewMetalRollover.imageset/TabNewMetalRollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/overflowImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "overflowImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "overflowImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/overflowImage.imageset/overflowImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/overflowImage.imageset/overflowImage.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/overflowImage.imageset/overflowImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/overflowImage.imageset/overflowImage@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/overflowImagePressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "overflowImagePressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "overflowImagePressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/overflowImagePressed.imageset/overflowImagePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/overflowImagePressed.imageset/overflowImagePressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/overflowImagePressed.imageset/overflowImagePressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/overflowImagePressed.imageset/overflowImagePressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/pi.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pi.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Images.xcassets/pi.imageset/pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Images.xcassets/pi.imageset/pi.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMAttachedTabBarButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAttachedTabBarButton.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/5/12. 6 | // 7 | // 8 | 9 | #import "MMTabBarButton.h" 10 | 11 | #import "MMAttachedTabBarButtonCell.h" 12 | #import "MMProgressIndicator.h" 13 | #import "MMTabBarView.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class MMAttachedTabBarButtonCell; 18 | 19 | @protocol MMTabStyle; 20 | 21 | @interface MMAttachedTabBarButton : MMTabBarButton 22 | 23 | // designated initializer 24 | - (instancetype)initWithFrame:(NSRect)frame tabViewItem:(NSTabViewItem *)anItem NS_DESIGNATED_INITIALIZER; 25 | - (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; 26 | 27 | - (instancetype)initWithFrame:(NSRect)frame NS_UNAVAILABLE; 28 | 29 | // overidden accessors (casting) 30 | @property (nullable, strong) __kindof MMAttachedTabBarButtonCell *cell; 31 | 32 | #pragma mark Properties 33 | 34 | @property (strong) NSTabViewItem *tabViewItem; 35 | @property (assign) NSRect slidingFrame; 36 | @property (readonly) BOOL isInAnimatedSlide; 37 | @property (assign) BOOL isInDraggedSlide; 38 | @property (readonly) BOOL isSliding; 39 | @property (assign) BOOL isOverflowButton; 40 | 41 | #pragma mark Drag Support 42 | 43 | @property (readonly) NSRect draggingRect; 44 | @property (readonly) NSImage *dragImage; 45 | 46 | #pragma mark - 47 | #pragma mark Animation Support 48 | 49 | - (void)slideAnimationWillStart; 50 | - (void)slideAnimationDidEnd; 51 | 52 | @end 53 | 54 | NS_ASSUME_NONNULL_END 55 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMAttachedTabBarButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMAttachedTabBarButton.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/5/12. 6 | // 7 | // 8 | 9 | #import "MMAttachedTabBarButton.h" 10 | 11 | #import "MMAttachedTabBarButtonCell.h" 12 | #import "MMTabDragAssistant.h" 13 | #import "MMTabStyle.h" 14 | #import "NSView+MMTabBarViewExtensions.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMAttachedTabBarButton () 19 | @end 20 | 21 | @implementation MMAttachedTabBarButton 22 | 23 | + (void)initialize { 24 | [super initialize]; 25 | } 26 | 27 | + (nullable Class)cellClass { 28 | return MMAttachedTabBarButtonCell.class; 29 | } 30 | 31 | - (instancetype)initWithFrame:(NSRect)frame tabViewItem:(NSTabViewItem *)anItem { 32 | 33 | self = [super initWithFrame:frame]; 34 | if (self) { 35 | _tabViewItem = anItem; 36 | _isInAnimatedSlide = NO; 37 | _isInDraggedSlide = NO; 38 | } 39 | 40 | return self; 41 | } 42 | 43 | - (instancetype)initWithFrame:(NSRect)frame { 44 | 45 | NSAssert(FALSE,@"please use designated initializer -initWithFrame:tabViewItem:"); 46 | 47 | return nil; 48 | } 49 | 50 | - (void)drawRect:(NSRect)dirtyRect { 51 | [super drawRect:dirtyRect]; 52 | } 53 | 54 | - (nullable MMAttachedTabBarButtonCell *)cell { 55 | return (MMAttachedTabBarButtonCell *)[super cell]; 56 | } 57 | 58 | - (void)setCell:(nullable MMAttachedTabBarButtonCell *)aCell { 59 | [super setCell:aCell]; 60 | } 61 | 62 | -(void)viewWillDraw { 63 | 64 | NSView *superview = self.superview; 65 | [superview setNeedsDisplayInRect:superview.bounds]; 66 | 67 | [super viewWillDraw]; 68 | } 69 | 70 | #pragma mark - 71 | #pragma mark Properties 72 | 73 | - (NSRect)slidingFrame { 74 | @synchronized(self) { 75 | return self.frame; 76 | } 77 | } 78 | 79 | - (void)setSlidingFrame:(NSRect)aRect { 80 | @synchronized(self) { 81 | aRect.origin.y = self.frame.origin.y; 82 | [self setFrame:aRect]; 83 | } 84 | } 85 | 86 | - (BOOL)isSliding { 87 | return _isInDraggedSlide || _isInAnimatedSlide; 88 | } 89 | 90 | - (void)setTitle:(NSString *)aString { 91 | [super setTitle:aString]; 92 | 93 | // additionally synchronize label of tab view item if appropriate 94 | if (_tabViewItem && [_tabViewItem respondsToSelector:@selector(label)]) { 95 | if (![_tabViewItem.label isEqualToString:aString]) { 96 | [_tabViewItem setLabel:aString]; 97 | } 98 | } 99 | } 100 | 101 | #pragma mark - 102 | #pragma mark Dividers 103 | 104 | - (BOOL)shouldDisplayLeftDivider { 105 | 106 | if (self.isSliding || (self.tabState & MMTab_PlaceholderOnLeft)) 107 | return YES; 108 | 109 | return super.shouldDisplayLeftDivider; 110 | } 111 | 112 | - (BOOL)shouldDisplayRightDivider { 113 | 114 | if (self.isOverflowButton) 115 | return NO; 116 | 117 | return YES; 118 | } 119 | 120 | #pragma mark - 121 | #pragma mark Interfacing Cell 122 | 123 | - (BOOL)isOverflowButton { 124 | return self.cell.isOverflowButton; 125 | } 126 | 127 | - (void)setIsOverflowButton:(BOOL)value { 128 | [self.cell setIsOverflowButton:value]; 129 | } 130 | 131 | #pragma mark - 132 | #pragma mark Event Handling 133 | 134 | - (void)mouseDown:(NSEvent *)theEvent { 135 | 136 | MMAttachedTabBarButton *previousSelectedButton = self._selectedAttachedTabBarButton; 137 | 138 | MMTabBarView *tabBarView = self.tabBarView; 139 | 140 | // select immediately 141 | if (tabBarView.selectsTabsOnMouseDown) { 142 | if (self != previousSelectedButton) { 143 | [previousSelectedButton setState:NSOffState]; 144 | [self setState:NSOnState]; 145 | [self sendAction:self.action to:self.target]; 146 | } 147 | } 148 | 149 | // eventually begin dragging of button 150 | if ([tabBarView shouldStartDraggingAttachedTabBarButton:self withMouseDownEvent:theEvent]) { 151 | [tabBarView startDraggingAttachedTabBarButton:self withMouseDownEvent:theEvent]; 152 | } 153 | } 154 | 155 | - (void)mouseUp:(NSEvent *)theEvent { 156 | 157 | MMTabBarView *tabBarView = self.tabBarView; 158 | 159 | NSPoint mouseUpPoint = theEvent.locationInWindow; 160 | NSPoint mousePt = [self convertPoint:mouseUpPoint fromView:nil]; 161 | 162 | if (NSMouseInRect(mousePt, self.bounds, self.isFlipped)) { 163 | if (!tabBarView.selectsTabsOnMouseDown) { 164 | MMAttachedTabBarButton *previousSelectedButton = self._selectedAttachedTabBarButton; 165 | [previousSelectedButton setState:NSOffState]; 166 | [self setState:NSOnState]; 167 | [self sendAction:self.action to:self.target]; 168 | } 169 | } 170 | } 171 | 172 | #pragma mark - 173 | #pragma mark Drag Support 174 | 175 | - (NSRect)draggingRect { 176 | 177 | id style = self.style; 178 | MMTabBarView *tabBarView = self.tabBarView; 179 | 180 | NSRect draggingRect = NSZeroRect; 181 | 182 | if (style && [style respondsToSelector:@selector(draggingRectForTabButton:ofTabBarView:)]) { 183 | draggingRect = [style draggingRectForTabButton:self ofTabBarView:tabBarView]; 184 | } else { 185 | draggingRect = self._draggingRect; 186 | } 187 | 188 | return draggingRect; 189 | } 190 | 191 | inline static NSBitmapImageRep* imageForView(NSView* const inView, NSRect const inBounds) { 192 | if (@available(macOS 10.14, *)) { 193 | NSBitmapImageRep* const imageRep = [inView bitmapImageRepForCachingDisplayInRect:inView.visibleRect]; 194 | [inView cacheDisplayInRect:inBounds toBitmapImageRep:imageRep]; 195 | return imageRep; 196 | } 197 | [inView lockFocus]; 198 | [inView display]; // forces update to ensure that we get current state 199 | NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:inBounds]; 200 | [inView unlockFocus]; 201 | return imageRep; 202 | } 203 | 204 | - (NSImage *)dragImage { 205 | 206 | // assure that we will draw the tab bar contents correctly 207 | [self setFrame:self.stackingFrame]; 208 | 209 | NSBitmapImageRep* const imageRep = imageForView(self.tabBarView, self.draggingRect); 210 | NSImage* image = [[NSImage alloc] initWithSize:imageRep.size]; 211 | [image addRepresentation:imageRep]; 212 | NSImage* returnImage = [[NSImage alloc] initWithSize:imageRep.size]; 213 | [returnImage lockFocus]; 214 | [image drawAtPoint:NSMakePoint(0.0, 0.0) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; 215 | [returnImage unlockFocus]; 216 | if (!self.indicator.isHidden) { 217 | NSImage *pi = [MMTabBarView.bundle imageForResource:@"pi"]; 218 | [returnImage lockFocus]; 219 | NSPoint indicatorPoint = NSMakePoint(self.frame.size.width - MARGIN_X - kMMTabBarIndicatorWidth, MARGIN_Y); 220 | [pi drawAtPoint:indicatorPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; 221 | [returnImage unlockFocus]; 222 | } 223 | return returnImage; 224 | } 225 | 226 | #pragma mark - 227 | #pragma mark Animation Support 228 | 229 | - (void)slideAnimationWillStart { 230 | _isInAnimatedSlide = YES; 231 | } 232 | 233 | - (void)slideAnimationDidEnd { 234 | _isInAnimatedSlide = NO; 235 | } 236 | 237 | #pragma mark - 238 | #pragma mark NSCoding 239 | 240 | - (instancetype)initWithCoder:(NSCoder *)coder { 241 | 242 | self = [super initWithCoder:coder]; 243 | if (self) { 244 | _tabViewItem = nil; 245 | _isInAnimatedSlide = NO; 246 | _isInDraggedSlide = NO; 247 | } 248 | 249 | return self; 250 | } 251 | 252 | - (void)encodeWithCoder:(NSCoder *)aCoder 253 | { 254 | [super encodeWithCoder:aCoder]; 255 | } 256 | 257 | #pragma mark - 258 | #pragma mark Private Methods 259 | 260 | - (MMAttachedTabBarButton *)_selectedAttachedTabBarButton { 261 | 262 | MMTabBarView *tabBarView = self.enclosingTabBarView; 263 | return tabBarView.selectedAttachedButton; 264 | } 265 | 266 | - (NSRect)_draggingRect { 267 | return self.frame; 268 | } 269 | 270 | @end 271 | 272 | NS_ASSUME_NONNULL_END 273 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMAttachedTabBarButtonCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAttachedTabBarButtonCell.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/5/12. 6 | // 7 | // 8 | 9 | #import "MMTabBarButtonCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class MMAttachedTabBarButton; 14 | 15 | @interface MMAttachedTabBarButtonCell : MMTabBarButtonCell 16 | 17 | @property (assign) BOOL isOverflowButton; 18 | 19 | /** 20 | * The control view 21 | */ 22 | @property (nullable, weak) MMAttachedTabBarButton *attachedTabBarButton; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMAttachedTabBarButtonCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMAttachedTabBarButtonCell.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/5/12. 6 | // 7 | // 8 | 9 | #import "MMAttachedTabBarButtonCell.h" 10 | 11 | #import "MMAttachedTabBarButton.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @implementation MMAttachedTabBarButtonCell 16 | 17 | - (instancetype)init { 18 | if ((self = [super init])) { 19 | _isOverflowButton = NO; 20 | } 21 | return self; 22 | } 23 | 24 | #pragma mark - 25 | #pragma mark Properties 26 | 27 | - (nullable MMAttachedTabBarButton *)controlView { 28 | // return (MMAttachedTabBarButton *)[super controlView]; 29 | return _attachedTabBarButton; 30 | } 31 | 32 | - (void) setControlView:(nullable NSView *)aView 33 | { 34 | [super setControlView:aView]; 35 | _attachedTabBarButton = (MMAttachedTabBarButton*)aView; 36 | } 37 | 38 | #pragma mark - 39 | #pragma mark NSCopying 40 | 41 | - (instancetype)copyWithZone:(nullable NSZone *)zone { 42 | 43 | MMAttachedTabBarButtonCell *cellCopy = [super copyWithZone:zone]; 44 | if (cellCopy) { 45 | cellCopy->_isOverflowButton = _isOverflowButton; 46 | } 47 | 48 | return cellCopy; 49 | } 50 | 51 | #pragma mark - 52 | #pragma mark Archiving 53 | 54 | - (void)encodeWithCoder:(NSCoder *)aCoder { 55 | [super encodeWithCoder:aCoder]; 56 | 57 | if (aCoder.allowsKeyedCoding) { 58 | [aCoder encodeBool:_isOverflowButton forKey:@"MMAttachedTabBarButtonCellIsOverflowButton"]; 59 | } 60 | } 61 | 62 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 63 | if ((self = [super initWithCoder:aDecoder])) { 64 | if (aDecoder.allowsKeyedCoding) { 65 | 66 | _isOverflowButton = [aDecoder decodeBoolForKey:@"MMAttachedTabBarButtonCellIsOverflowButton"]; 67 | } 68 | } 69 | return self; 70 | } 71 | 72 | @end 73 | 74 | NS_ASSUME_NONNULL_END 75 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMOverflowPopUpButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMOverflowPopUpButton.h 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 11/4/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | @import QuartzCore; 12 | #else 13 | #import 14 | #import 15 | #endif 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | typedef void (^MMCellBezelDrawingBlock)(NSCell *cell, NSRect frame, NSView *controlView); 20 | 21 | @interface MMOverflowPopUpButton : NSPopUpButton 22 | 23 | /** 24 | * Second image 25 | */ 26 | @property (nullable, strong) NSImage *secondImage; 27 | 28 | /** 29 | * Block to be used for drawing the bezel 30 | */ 31 | @property (nullable, copy) MMCellBezelDrawingBlock bezelDrawingBlock; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMOverflowPopUpButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMOverflowPopUpButton.m 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 11/4/05. 6 | // Copyright 2005 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import "MMOverflowPopUpButton.h" 10 | 11 | #import "MMOverflowPopUpButtonCell.h" 12 | // #import "MMTabBarView.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | #define StaticImage(name) \ 17 | static NSImage* _static##name##Image() \ 18 | { \ 19 | static NSImage* image = nil; \ 20 | if (!image) \ 21 | image = [[NSBundle bundleForClass:MMOverflowPopUpButtonCell.class] imageForResource:@#name]; \ 22 | return image; \ 23 | } 24 | 25 | @interface MMOverflowPopUpButton () 26 | 27 | @property (assign) CGFloat secondImageAlpha; 28 | 29 | @property (assign) BOOL isAnimating; // pulsating animation of image and second image 30 | 31 | @end 32 | 33 | @implementation MMOverflowPopUpButton 34 | 35 | StaticImage(overflowImage) 36 | StaticImage(overflowImagePressed) 37 | 38 | @dynamic secondImageAlpha; 39 | 40 | + (nullable Class)cellClass { 41 | return MMOverflowPopUpButtonCell.class; 42 | } 43 | 44 | - (instancetype)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag { 45 | if ((self = [super initWithFrame:frameRect pullsDown:YES]) != nil) { 46 | 47 | _isAnimating = NO; 48 | 49 | [self setBezelStyle:NSRegularSquareBezelStyle]; 50 | [self setBordered:NO]; 51 | [self setTitle:@""]; 52 | [self setPreferredEdge:NSMaxYEdge]; 53 | 54 | [self setImage:_staticoverflowImageImage()]; 55 | // [self setSecondImage:_staticoverflowImagePressedImage()]; 56 | [self setAlternateImage:_staticoverflowImagePressedImage()]; 57 | 58 | [self _startCellAnimationIfNeeded]; 59 | } 60 | return self; 61 | } 62 | 63 | 64 | - (void)viewWillMoveToSuperview:(nullable NSView *)newSuperview { 65 | [super viewWillMoveToSuperview:newSuperview]; 66 | 67 | [self _stopCellAnimationIfNeeded]; 68 | } 69 | 70 | - (void)viewDidMoveToSuperview { 71 | 72 | [super viewDidMoveToSuperview]; 73 | 74 | [self _startCellAnimationIfNeeded]; 75 | } 76 | 77 | - (void)viewWillMoveToWindow:(nullable NSWindow *)newWindow { 78 | 79 | [super viewWillMoveToWindow:newWindow]; 80 | 81 | [self _stopCellAnimationIfNeeded]; 82 | } 83 | 84 | - (void)viewDidMoveToWindow { 85 | [super viewDidMoveToWindow]; 86 | 87 | [self _startCellAnimationIfNeeded]; 88 | } 89 | 90 | #pragma mark - 91 | #pragma mark Accessors 92 | 93 | - (void)setHidden:(BOOL)flag { 94 | 95 | [super setHidden:flag]; 96 | 97 | @synchronized (self) { 98 | if (flag) 99 | [self _stopCellAnimationIfNeeded]; 100 | else 101 | [self _startCellAnimationIfNeeded]; 102 | } 103 | } 104 | 105 | - (void)setFrame:(NSRect)frameRect { 106 | 107 | [super setFrame:frameRect]; 108 | 109 | @synchronized (self) { 110 | if (NSEqualRects(NSZeroRect, frameRect)) 111 | [self _stopCellAnimationIfNeeded]; 112 | else 113 | [self _startCellAnimationIfNeeded]; 114 | } 115 | } 116 | 117 | #pragma mark - 118 | #pragma mark Interfacing Cell 119 | 120 | - (nullable NSImage *)secondImage { 121 | return [self.cell secondImage]; 122 | } 123 | 124 | - (void)setSecondImage:(nullable NSImage *)anImage { 125 | 126 | [self.cell setSecondImage:anImage]; 127 | 128 | if (!anImage) { 129 | [self _stopCellAnimationIfNeeded]; 130 | } else { 131 | [self _startCellAnimationIfNeeded]; 132 | } 133 | } 134 | 135 | #pragma mark - 136 | #pragma mark Animation 137 | 138 | + (nullable id)defaultAnimationForKey:(NSString *)key { 139 | 140 | if ([key isEqualToString:@"isAnimating"]) { 141 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"secondImageAlpha"]; 142 | animation.fromValue = [NSNumber numberWithFloat:0.0]; 143 | animation.toValue = [NSNumber numberWithFloat:1.0]; 144 | animation.duration = 1.0; 145 | animation.autoreverses = YES; 146 | animation.repeatCount = CGFLOAT_MAX; 147 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 148 | return animation; 149 | } else { 150 | return [super defaultAnimationForKey:key]; 151 | } 152 | } 153 | 154 | /* currently unused 155 | - (void)mouseDown:(NSEvent *)event { 156 | 157 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationReceived:) name:NSMenuDidEndTrackingNotification object:[self menu]]; 158 | [self setNeedsDisplay:YES]; 159 | [super mouseDown:event]; 160 | } 161 | 162 | - (void)notificationReceived:(NSNotification *)notification { 163 | 164 | [self setNeedsDisplay:YES]; 165 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 166 | } 167 | */ 168 | 169 | #pragma mark - 170 | #pragma mark Bezel Drawing 171 | 172 | - (nullable MMCellBezelDrawingBlock)bezelDrawingBlock { 173 | return [self.cell bezelDrawingBlock]; 174 | } 175 | 176 | - (void)setBezelDrawingBlock:(nullable MMCellBezelDrawingBlock)aBlock { 177 | [self.cell setBezelDrawingBlock:aBlock]; 178 | } 179 | 180 | #pragma mark - 181 | #pragma mark Archiving 182 | 183 | - (void)encodeWithCoder:(NSCoder *)aCoder { 184 | [super encodeWithCoder:aCoder]; 185 | } 186 | 187 | - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder { 188 | if ((self = [super initWithCoder:aDecoder])) { 189 | } 190 | return self; 191 | } 192 | 193 | #pragma mark - 194 | #pragma mark Private Methods 195 | 196 | - (void)_startCellAnimationIfNeeded { 197 | 198 | if (self.window == nil || self.isHidden || NSEqualRects(NSZeroRect, self.frame)) 199 | return; 200 | 201 | if ([self.cell secondImage] == nil) 202 | return; 203 | 204 | [self _startCellAnimation]; 205 | } 206 | 207 | - (void)_startCellAnimation { 208 | [self.animator setIsAnimating:YES]; 209 | } 210 | 211 | - (void)_stopCellAnimationIfNeeded { 212 | 213 | if (_isAnimating) 214 | [self _stopCellAnimation]; 215 | } 216 | 217 | - (void)_stopCellAnimation { 218 | 219 | [self setIsAnimating:NO]; 220 | } 221 | 222 | - (CGFloat)secondImageAlpha { 223 | return [self.cell secondImageAlpha]; 224 | } 225 | 226 | - (void)setSecondImageAlpha:(CGFloat)value { 227 | MMOverflowPopUpButtonCell* const cell = self.cell; 228 | if (cell == nil) { 229 | return; 230 | } 231 | [cell setSecondImageAlpha:value]; 232 | [self updateCell:cell]; 233 | } 234 | 235 | @end 236 | 237 | NS_ASSUME_NONNULL_END 238 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMOverflowPopUpButtonCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMOverflowPopUpButtonCell.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/24/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "MMOverflowPopUpButton.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @class MMImageTransitionAnimation; 20 | 21 | @interface MMOverflowPopUpButtonCell : NSPopUpButtonCell 22 | 23 | @property (nullable, copy) MMCellBezelDrawingBlock bezelDrawingBlock; 24 | @property (strong) NSImage *image; 25 | @property (nullable, strong) NSImage *secondImage; 26 | @property (assign) CGFloat secondImageAlpha; 27 | 28 | - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView alpha:(CGFloat)alpha; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMOverflowPopUpButtonCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMOverflowPopUpButtonCell.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/24/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "MMOverflowPopUpButtonCell.h" 10 | #import "NSCell+MMTabBarViewExtensions.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface MMOverflowPopUpButtonCell () 15 | 16 | @end 17 | 18 | @implementation MMOverflowPopUpButtonCell 19 | { 20 | NSImage *_image; 21 | } 22 | 23 | - (instancetype)initTextCell:(NSString *)stringValue pullsDown:(BOOL)pullDown { 24 | self = [super initTextCell:stringValue pullsDown:pullDown]; 25 | if (self) { 26 | _bezelDrawingBlock = nil; 27 | _image = nil; 28 | _secondImage = nil; 29 | _secondImageAlpha = 0.0; 30 | } 31 | 32 | return self; 33 | } 34 | 35 | #pragma mark - 36 | #pragma mark Accessors 37 | 38 | - (NSImage *)image { 39 | return _image; 40 | } 41 | 42 | - (void)setImage:(NSImage *)image { 43 | 44 | // as super class ignores setting image, we store it separately. 45 | if (_image) { 46 | _image = nil; 47 | } 48 | 49 | _image = image; 50 | } 51 | 52 | #pragma mark - 53 | #pragma mark Drawing 54 | 55 | - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { 56 | 57 | [self drawBezelWithFrame:cellFrame inView:controlView]; 58 | [self drawInteriorWithFrame:cellFrame inView:controlView]; 59 | } 60 | 61 | - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { 62 | [self drawImageWithFrame:cellFrame inView:controlView]; 63 | } 64 | 65 | - (void)drawImageWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { 66 | 67 | if (self.isHighlighted) { 68 | NSImage* const image = self.alternateImage; 69 | if (image != nil) { 70 | [self drawImage:image withFrame:cellFrame inView:controlView]; 71 | } 72 | } else { 73 | [self drawImage:self.image withFrame:cellFrame inView:controlView]; 74 | 75 | NSImage* const image = _secondImage; 76 | if (image != nil) { 77 | [self drawImage:image withFrame:cellFrame inView:controlView alpha:_secondImageAlpha]; 78 | } 79 | } 80 | } 81 | 82 | - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView { 83 | [self drawImage:image withFrame:frame inView:controlView alpha:1.0]; 84 | } 85 | 86 | - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView alpha:(CGFloat)alpha { 87 | 88 | NSRect theRect = [self _imageRectForBounds:frame forImage:image]; 89 | 90 | [image drawInRect:theRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:alpha respectFlipped:YES hints:nil]; 91 | } 92 | 93 | - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView { 94 | if (_bezelDrawingBlock) { 95 | _bezelDrawingBlock(self,frame,controlView); 96 | } 97 | } 98 | 99 | #pragma mark - 100 | #pragma mark Copying 101 | 102 | - (id)copyWithZone:(nullable NSZone *)zone { 103 | 104 | MMOverflowPopUpButtonCell *cellCopy = [super copyWithZone:zone]; 105 | if (cellCopy) { 106 | 107 | cellCopy->_image = [_image copyWithZone:zone]; 108 | cellCopy->_secondImage = [_secondImage copyWithZone:zone]; 109 | } 110 | 111 | return cellCopy; 112 | } 113 | 114 | #pragma mark - 115 | #pragma mark Archiving 116 | 117 | - (void)encodeWithCoder:(NSCoder *)aCoder { 118 | [super encodeWithCoder:aCoder]; 119 | 120 | if (aCoder.allowsKeyedCoding) { 121 | [aCoder encodeObject:_image forKey:@"MMTabBarOverflowPopUpImage"]; 122 | [aCoder encodeObject:_secondImage forKey:@"MMTabBarOverflowPopUpSecondImage"]; 123 | } 124 | } 125 | 126 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 127 | if ((self = [super initWithCoder:aDecoder])) { 128 | if (aDecoder.allowsKeyedCoding) { 129 | 130 | _image = [aDecoder decodeObjectForKey:@"MMTabBarOverflowPopUpImage"]; 131 | _secondImage = [aDecoder decodeObjectForKey:@"MMTabBarOverflowPopUpSecondImage"]; 132 | } 133 | } 134 | return self; 135 | } 136 | 137 | #pragma mark - 138 | #pragma mark Private Methods 139 | 140 | -(NSRect)_imageRectForBounds:(NSRect)theRect forImage:(NSImage *)anImage { 141 | 142 | // calculate rect 143 | NSRect drawingRect = [self drawingRectForBounds:theRect]; 144 | 145 | NSSize imageSize = anImage.size; 146 | 147 | NSSize scaledImageSize = [self mm_scaleImageWithSize:imageSize toFitInSize:NSMakeSize(imageSize.width, drawingRect.size.height) scalingType:NSImageScaleProportionallyDown]; 148 | 149 | NSRect result = NSMakeRect(NSMaxX(drawingRect)-scaledImageSize.width, drawingRect.origin.y, scaledImageSize.width, scaledImageSize.height); 150 | 151 | if (scaledImageSize.height < drawingRect.size.height) { 152 | result.origin.y += ceil((drawingRect.size.height - scaledImageSize.height) / 2.0); 153 | } 154 | 155 | return NSIntegralRect(result); 156 | } 157 | @end 158 | 159 | NS_ASSUME_NONNULL_END 160 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMProgressIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressIndicator.h 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 2/23/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface MMProgressIndicator : NSProgressIndicator 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMProgressIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMProgressIndicator.m 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 2/23/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #import "MMProgressIndicator.h" 10 | #import "MMTabBarView.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface MMTabBarView (MMProgressIndicatorExtensions) 15 | 16 | - (void)update; 17 | 18 | @end 19 | 20 | @implementation MMProgressIndicator 21 | 22 | /* 23 | // overrides to make tab bar control re-layout things if status changes 24 | - (void)setHidden:(BOOL)flag { 25 | [super setHidden:flag]; 26 | [(MMTabBarView *)[self superview] update]; 27 | } 28 | */ 29 | 30 | - (void)stopAnimation:(nullable id)sender { 31 | [NSObject cancelPreviousPerformRequestsWithTarget:self 32 | selector:@selector(startAnimation:) 33 | object:nil]; 34 | [super stopAnimation:sender]; 35 | } 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMRolloverButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMRolloverButton.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/8/12. 6 | // 7 | 8 | #if __has_feature(modules) 9 | @import Cocoa; 10 | #else 11 | #import 12 | #endif 13 | 14 | #import "MMRolloverButtonCell.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMRolloverButton : NSButton 19 | 20 | #pragma mark Cell Interface 21 | 22 | @property (nullable, strong) NSImage *rolloverImage; 23 | @property (assign) MMRolloverButtonType rolloverButtonType; 24 | 25 | @property (readonly) BOOL mouseHovered; 26 | 27 | @property (assign) BOOL simulateClickOnMouseHovered; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMRolloverButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMOverflowPopUpButton.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/8/12. 6 | // 7 | 8 | #import "MMRolloverButton.h" 9 | 10 | #import "MMRolloverButtonCell.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @implementation MMRolloverButton 15 | 16 | + (nullable Class)cellClass { 17 | return MMRolloverButtonCell.class; 18 | } 19 | 20 | - (instancetype)initWithFrame:(NSRect)frameRect { 21 | 22 | self = [super initWithFrame:frameRect]; 23 | if (self) { 24 | self.focusRingType = NSFocusRingTypeNone; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | 31 | - (void)awakeFromNib { 32 | if ([self.superclass instancesRespondToSelector:@selector(awakeFromNib)]) { 33 | [super awakeFromNib]; 34 | } 35 | } 36 | 37 | - (nullable MMRolloverButtonCell *)cell { 38 | return (MMRolloverButtonCell *)super.cell; 39 | } 40 | 41 | - (void)setCell:(nullable MMRolloverButtonCell *)aCell { 42 | [super setCell:aCell]; 43 | } 44 | 45 | #pragma mark - 46 | #pragma mark Cell Interface 47 | 48 | - (nullable NSImage *)rolloverImage { 49 | return [self.cell rolloverImage]; 50 | } 51 | 52 | - (void)setRolloverImage:(nullable NSImage *)image { 53 | [self.cell setRolloverImage:image]; 54 | } 55 | 56 | - (MMRolloverButtonType)rolloverButtonType { 57 | return [self.cell rolloverButtonType]; 58 | } 59 | 60 | - (void)setRolloverButtonType:(MMRolloverButtonType)aType { 61 | [self.cell setRolloverButtonType:aType]; 62 | } 63 | 64 | - (BOOL)mouseHovered { 65 | return [self.cell mouseHovered]; 66 | } 67 | 68 | - (BOOL)simulateClickOnMouseHovered { 69 | return [self.cell simulateClickOnMouseHovered]; 70 | } 71 | 72 | - (void)setSimulateClickOnMouseHovered:(BOOL)flag { 73 | [self.cell setSimulateClickOnMouseHovered:flag]; 74 | } 75 | 76 | #pragma mark - 77 | #pragma mark Tracking Area Support 78 | 79 | -(void)updateTrackingAreas { 80 | 81 | [super updateTrackingAreas]; 82 | 83 | // remove all tracking rects 84 | for (NSTrackingArea *area in self.trackingAreas) { 85 | // We have to uniquely identify our own tracking areas 86 | if (area.owner == self) { 87 | [self removeTrackingArea:area]; 88 | } 89 | } 90 | // force reset of mouse hovered state 91 | if (self.mouseHovered) { 92 | NSEvent* const event = NSApp.currentEvent; 93 | if (event != nil) { 94 | [self.cell mouseExited:event]; 95 | } 96 | } 97 | 98 | // recreate tracking areas and tool tip rects 99 | 100 | NSPoint mouseLocationInScreenCoos = NSEvent.mouseLocation; 101 | 102 | NSPoint mouseLocationInWindowCoos = [self.window convertRectFromScreen:NSMakeRect(mouseLocationInScreenCoos.x, mouseLocationInScreenCoos.y, 0.0, 0.0)].origin; 103 | 104 | NSPoint mouseLocation = [self convertPoint:mouseLocationInWindowCoos fromView:nil]; 105 | 106 | [self.cell addTrackingAreasForView:self inRect:self.bounds withUserInfo:nil mouseLocation:mouseLocation]; 107 | } 108 | 109 | - (void)mouseEntered:(NSEvent *)theEvent { 110 | [self.cell mouseEntered:theEvent]; 111 | } 112 | 113 | - (void)mouseExited:(NSEvent *)theEvent { 114 | [self.cell mouseExited:theEvent]; 115 | } 116 | 117 | #pragma mark - 118 | #pragma mark Archiving 119 | 120 | - (void)encodeWithCoder:(NSCoder *)aCoder { 121 | [super encodeWithCoder:aCoder]; 122 | if (aCoder.allowsKeyedCoding) { 123 | // nothing yet 124 | } 125 | } 126 | 127 | - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder { 128 | self = [super initWithCoder:aDecoder]; 129 | if (self) { 130 | if (aDecoder.allowsKeyedCoding) { 131 | // nothing yet 132 | } 133 | } 134 | return self; 135 | } 136 | 137 | @end 138 | 139 | NS_ASSUME_NONNULL_END 140 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMRolloverButtonCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMRolloverButtonCell.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/8/12. 6 | // 7 | 8 | #if __has_feature(modules) 9 | @import Cocoa; 10 | #else 11 | #import 12 | #endif 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | typedef NS_ENUM(NSUInteger, MMRolloverButtonType) 17 | { 18 | MMRolloverActionButton = 0, 19 | MMRolloverSwitchButton 20 | }; 21 | 22 | @interface MMRolloverButtonCell : NSButtonCell 23 | 24 | @property (readonly) BOOL mouseHovered; 25 | @property (nullable, strong) NSImage *rolloverImage; 26 | @property (assign) MMRolloverButtonType rolloverButtonType; 27 | @property (assign) BOOL simulateClickOnMouseHovered; 28 | 29 | #pragma mark Tracking Area Support 30 | 31 | - (void)addTrackingAreasForView:(NSView *)controlView inRect:(NSRect)cellFrame withUserInfo:(nullable NSDictionary *)userInfo mouseLocation:(NSPoint)mouseLocation; 32 | - (void)mouseEntered:(NSEvent *)event; 33 | - (void)mouseExited:(NSEvent *)event; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMRolloverButtonCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMRolloverButtonCell.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/8/12. 6 | // 7 | 8 | #import "MMRolloverButtonCell.h" 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @implementation MMRolloverButtonCell 13 | { 14 | MMRolloverButtonType _rolloverButtonType; 15 | } 16 | 17 | @dynamic rolloverButtonType; 18 | 19 | - (instancetype)init 20 | { 21 | self = [super init]; 22 | if (self) { 23 | _rolloverImage = nil; 24 | _mouseHovered = NO; 25 | _simulateClickOnMouseHovered = NO; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)drawImage:(NSImage*) image withFrame:(NSRect)frame inView:(NSView*)controlView { 31 | if (_mouseHovered && !self.isHighlighted) { 32 | NSImage* const image = _rolloverImage; 33 | if (image != nil) { 34 | [super drawImage:image withFrame:frame inView:controlView]; 35 | return; 36 | } 37 | } 38 | 39 | [super drawImage:image withFrame:frame inView:controlView]; 40 | } 41 | 42 | #pragma mark - 43 | #pragma mark Accessors 44 | 45 | - (MMRolloverButtonType)rolloverButtonType { 46 | return _rolloverButtonType; 47 | } 48 | 49 | - (void)setRolloverButtonType:(MMRolloverButtonType)aType { 50 | 51 | _rolloverButtonType = aType; 52 | 53 | switch (_rolloverButtonType) { 54 | case MMRolloverActionButton: 55 | [self setButtonType:NSMomentaryChangeButton]; 56 | [self setShowsStateBy:NSNoCellMask]; 57 | [self setHighlightsBy:NSContentsCellMask]; 58 | [self setImageDimsWhenDisabled:YES]; 59 | break; 60 | case MMRolloverSwitchButton: 61 | break; 62 | } 63 | 64 | [(NSControl *)self.controlView updateCell:self]; 65 | } 66 | 67 | #pragma mark - 68 | #pragma mark Tracking Area Support 69 | 70 | - (void)addTrackingAreasForView:(NSView *)controlView inRect:(NSRect)cellFrame withUserInfo:(nullable NSDictionary *)userInfo mouseLocation:(NSPoint)mouseLocation { 71 | 72 | NSTrackingAreaOptions options = 0; 73 | BOOL mouseIsInside = NO; 74 | NSTrackingArea *area = nil; 75 | 76 | // ---- add tracking area for hover effect ---- 77 | 78 | options = NSTrackingEnabledDuringMouseDrag | NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways; 79 | 80 | mouseIsInside = [controlView mouse:mouseLocation inRect:cellFrame]; 81 | if (mouseIsInside) { 82 | options |= NSTrackingAssumeInside; 83 | _mouseHovered = YES; 84 | } 85 | 86 | // We make the view the owner, and it delegates the calls back to the cell after it is properly setup for the corresponding row/column in the outlineview 87 | area = [[NSTrackingArea alloc] initWithRect:cellFrame options:options owner:controlView userInfo:userInfo]; 88 | [controlView addTrackingArea:area]; 89 | area = nil; 90 | } 91 | 92 | - (void)mouseEntered:(NSEvent *)event { 93 | 94 | if (_simulateClickOnMouseHovered && event.modifierFlags & NSAlternateKeyMask) { 95 | [self performClick:self]; 96 | return; 97 | } 98 | 99 | _mouseHovered = YES; 100 | [(NSControl *)self.controlView updateCell:self]; 101 | } 102 | 103 | - (void)mouseExited:(NSEvent *)event { 104 | _mouseHovered = NO; 105 | // Call this later or else MacOS 12.3 throws exception 106 | [self.controlView performSelectorOnMainThread:@selector(updateCell:) withObject:self waitUntilDone:NO]; 107 | } 108 | 109 | #pragma mark - 110 | #pragma mark Archiving 111 | 112 | - (void)encodeWithCoder:(NSCoder *)aCoder { 113 | [super encodeWithCoder:aCoder]; 114 | if (aCoder.allowsKeyedCoding) { 115 | [aCoder encodeObject:_rolloverImage forKey:@"rolloverImage"]; 116 | [aCoder encodeInteger:_simulateClickOnMouseHovered forKey:@"simulateClickOnMouseHovered"]; 117 | [aCoder encodeInteger:_rolloverButtonType forKey:@"rolloverButtonType"]; 118 | 119 | } 120 | } 121 | 122 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 123 | self = [super initWithCoder:aDecoder]; 124 | if (self) { 125 | if (aDecoder.allowsKeyedCoding) { 126 | _rolloverImage = [aDecoder decodeObjectForKey:@"rolloverImage"]; 127 | _simulateClickOnMouseHovered = [aDecoder decodeIntegerForKey:@"simulateClickOnMouseHovered"]; 128 | _rolloverButtonType = [aDecoder decodeIntegerForKey:@"rolloverButtonType"]; 129 | } 130 | } 131 | return self; 132 | } 133 | 134 | #pragma mark - 135 | #pragma mark Copying 136 | 137 | - (id)copyWithZone:(nullable NSZone *)zone { 138 | 139 | MMRolloverButtonCell *cellCopy = [super copyWithZone:zone]; 140 | if (cellCopy) { 141 | cellCopy->_rolloverButtonType = _rolloverButtonType; 142 | cellCopy->_simulateClickOnMouseHovered = _simulateClickOnMouseHovered; 143 | cellCopy->_rolloverImage = _rolloverImage; 144 | } 145 | 146 | return cellCopy; 147 | } 148 | 149 | @end 150 | 151 | NS_ASSUME_NONNULL_END 152 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMSlideButtonsAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMSlideButtonsAnimation.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/12/12. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class MMTabBarButton; 18 | 19 | @interface MMSlideButtonsAnimation : NSViewAnimation 20 | 21 | - (instancetype)initWithTabBarButtons:(NSSet<__kindof MMTabBarButton *> *)buttons NS_DESIGNATED_INITIALIZER; 22 | 23 | - (void)addAnimationDictionary:(NSDictionary *)aDict; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMSlideButtonsAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMSlideButtonsAnimation.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/12/12. 6 | // 7 | // 8 | 9 | #import "MMSlideButtonsAnimation.h" 10 | 11 | #import "MMTabBarButton.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @implementation MMSlideButtonsAnimation 16 | 17 | - (instancetype)initWithTabBarButtons:(NSSet<__kindof MMTabBarButton *> *)buttons { 18 | 19 | NSArray *> *viewAnimations = [self _viewAnimationsForButtons:buttons]; 20 | 21 | self = [super initWithViewAnimations:viewAnimations]; 22 | if (self) 23 | { 24 | [self setDuration:0.3]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (void)addAnimationDictionary:(NSDictionary *)aDict { 31 | 32 | NSParameterAssert(aDict != nil); 33 | 34 | NSMutableArray *> *animations = [self.viewAnimations mutableCopy]; 35 | [animations addObject:aDict]; 36 | [self setViewAnimations:animations]; 37 | } 38 | 39 | #pragma mark - 40 | #pragma mark Private Methods 41 | 42 | - (NSArray *> *)_viewAnimationsForButtons:(NSSet<__kindof MMTabBarButton *> *)buttons { 43 | 44 | NSMutableArray *> *animations = [NSMutableArray arrayWithCapacity:buttons.count]; 45 | 46 | NSDictionary *animDict = nil; 47 | 48 | for (MMTabBarButton *aButton in buttons) { 49 | animDict = @{ 50 | NSViewAnimationTargetKey: aButton, 51 | NSViewAnimationStartFrameKey: [NSValue valueWithRect:aButton.frame], 52 | NSViewAnimationEndFrameKey: [NSValue valueWithRect:aButton.stackingFrame] 53 | }; 54 | [animations addObject:animDict]; 55 | } 56 | 57 | return animations; 58 | } 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarButton.Common.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarButton.Common.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 23/05/15. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | typedef NS_ENUM(NSUInteger, MMCloseButtonImageType) 12 | { 13 | MMCloseButtonImageTypeStandard = 0, 14 | MMCloseButtonImageTypeRollover, 15 | MMCloseButtonImageTypePressed, 16 | MMCloseButtonImageTypeDirty, 17 | MMCloseButtonImageTypeDirtyRollover, 18 | MMCloseButtonImageTypeDirtyPressed 19 | }; 20 | 21 | typedef NS_ENUM(NSUInteger,MMTabStateMask) 22 | { 23 | MMTab_LeftIsSelectedMask = 1 << 2, 24 | MMTab_RightIsSelectedMask = 1 << 3, 25 | 26 | MMTab_LeftIsSliding = 1 << 4, 27 | MMTab_RightIsSliding = 1 << 5, 28 | 29 | MMTab_PlaceholderOnLeft = 1 << 6, 30 | MMTab_PlaceholderOnRight = 1 << 7, 31 | 32 | MMTab_PositionLeftMask = 1 << 8, 33 | MMTab_PositionMiddleMask = 1 << 9, 34 | MMTab_PositionRightMask = 1 << 10, 35 | MMTab_PositionSingleMask = 1 << 11 36 | }; 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarButton.Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarButton.Private.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 23/05/15. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface MMTabBarButton(PrivateDrawing) 12 | 13 | - (NSRect)_indicatorRectForBounds:(NSRect)theRect; 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarButton.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/5/12. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "MMRolloverButton.h" 16 | 17 | #import "MMTabBarButton.Common.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | /* 22 | #import "MMTabBarView.h" 23 | #import "MMRolloverButton.h" 24 | #import "MMProgressIndicator.h" 25 | #import "MMTabBarButton.Common.h" 26 | */ 27 | @class MMTabBarView; 28 | @class MMTabBarButtonCell; 29 | @class MMProgressIndicator; 30 | 31 | @protocol MMTabStyle; 32 | 33 | @interface MMTabBarButton : MMRolloverButton 34 | 35 | - (instancetype)initWithFrame:(NSRect)frame; 36 | 37 | #pragma mark Properties 38 | 39 | @property (assign) NSRect stackingFrame; 40 | @property (strong) MMRolloverButton *closeButton; 41 | @property (nullable, assign) SEL closeButtonAction; 42 | @property (readonly, strong) MMProgressIndicator *indicator; 43 | 44 | @property (nullable, strong) __kindof MMTabBarButtonCell *cell; 45 | 46 | - (MMTabBarView *)tabBarView; 47 | 48 | #pragma mark Update Cell 49 | 50 | - (void)updateCell; 51 | - (void)updateImages; 52 | 53 | #pragma mark Dividers 54 | 55 | @property (readonly) BOOL shouldDisplayLeftDivider; 56 | @property (readonly) BOOL shouldDisplayRightDivider; 57 | 58 | #pragma mark Determine Sizes 59 | 60 | - (CGFloat)minimumWidth; 61 | - (CGFloat)desiredWidth; 62 | 63 | #pragma mark Interfacing Cell 64 | 65 | @property (nullable, strong) id style; 66 | @property (assign) MMTabStateMask tabState; 67 | 68 | @property (nullable, strong) NSImage *icon; 69 | @property (nullable, strong) NSImage *largeImage; 70 | 71 | @property (assign) BOOL showObjectCount; 72 | @property (assign) NSInteger objectCount; 73 | 74 | @property (nullable, strong) NSColor *objectCountColor; 75 | 76 | @property (assign) BOOL isEdited; 77 | @property (assign) BOOL isProcessing; 78 | 79 | #pragma mark Close Button Support 80 | 81 | @property (readonly) BOOL shouldDisplayCloseButton; 82 | @property (assign) BOOL hasCloseButton; 83 | @property (assign) BOOL suppressCloseButton; 84 | 85 | @end 86 | 87 | NS_ASSUME_NONNULL_END 88 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarButtonCell.Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarButtonCell.Private.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 23/05/15. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "MMTabBarButtonCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface MMTabBarButtonCell (PrivateDrawing) 14 | 15 | - (NSRect)_closeButtonRectForBounds:(NSRect)theRect; 16 | - (CGFloat)_leftMargin; 17 | - (CGFloat)_rightMargin; 18 | 19 | - (void)_drawObjectCounterWithFrame:(NSRect)frame inView:(NSView *)controlView; 20 | - (void)_drawIconWithFrame:(NSRect)frame inView:(NSView *)controlView; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarButtonCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarButtonCell.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/5/12. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "MMRolloverButtonCell.h" 16 | 17 | #import "MMTabBarButton.Common.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @class MMTabBarView; 22 | @class MMProgressIndicator; 23 | @class MMTabBarButton; 24 | @class MMRolloverButton; 25 | 26 | @protocol MMTabStyle; 27 | 28 | @interface MMTabBarButtonCell : MMRolloverButtonCell 29 | 30 | /** 31 | * Default color for object count display 32 | * 33 | * @return The default color 34 | */ 35 | + (NSColor *)defaultObjectCountColor; 36 | 37 | /** 38 | * The control view 39 | */ 40 | @property (nullable, weak) MMTabBarButton *tabBarButton; 41 | 42 | /** 43 | * Tab bar view the tab bar button belongs to 44 | */ 45 | @property (nullable, readonly) MMTabBarView *tabBarView; 46 | 47 | #pragma mark Update images 48 | 49 | /** 50 | * Update images 51 | */ 52 | - (void)updateImages; 53 | 54 | #pragma mark Additional Properties 55 | 56 | /** 57 | * Tab style 58 | */ 59 | @property (strong) id style; 60 | 61 | /** 62 | * Icon of receiver 63 | */ 64 | @property (nullable, strong) NSImage *icon; 65 | 66 | /** 67 | * Large image of receiver 68 | */ 69 | @property (nullable, strong) NSImage *largeImage; 70 | 71 | /** 72 | * Visibility of object count 73 | */ 74 | @property (assign) BOOL showObjectCount; 75 | 76 | /** 77 | * Current object count 78 | */ 79 | @property (assign) NSInteger objectCount; 80 | 81 | /** 82 | * Color of object count 83 | */ 84 | @property (nullable, strong) NSColor *objectCountColor; 85 | 86 | /** 87 | * Edited state 88 | */ 89 | @property (assign) BOOL isEdited; 90 | 91 | /** 92 | * Processing state 93 | */ 94 | @property (assign) BOOL isProcessing; 95 | 96 | /** 97 | * Visibility of close button 98 | */ 99 | @property (assign) BOOL hasCloseButton; 100 | 101 | /** 102 | * Check if close button should be suppressed 103 | */ 104 | @property (assign) BOOL suppressCloseButton; 105 | 106 | /** 107 | * Current tab state mask 108 | */ 109 | @property (assign) MMTabStateMask tabState; 110 | 111 | #pragma mark Progress Indicator Support 112 | 113 | /** 114 | * Get progress indicator 115 | */ 116 | @property (nullable, readonly) MMProgressIndicator *indicator; 117 | 118 | #pragma mark Close Button Support 119 | 120 | /** 121 | * The close button 122 | */ 123 | @property (nullable, readonly) MMRolloverButton *closeButton; 124 | 125 | /** 126 | * Check if receiver should display close button 127 | */ 128 | @property (readonly) BOOL shouldDisplayCloseButton; 129 | 130 | /** 131 | * Get close button image 132 | * 133 | * @param type Close button image type 134 | * 135 | * @return The image 136 | */ 137 | - (NSImage *)closeButtonImageOfType:(MMCloseButtonImageType)type; 138 | 139 | #pragma mark Cell Values 140 | 141 | /** 142 | * Attributed string value 143 | */ 144 | @property (readonly) NSAttributedString *attributedStringValue; 145 | 146 | /** 147 | * Object count string value 148 | */ 149 | @property (readonly) NSAttributedString *attributedObjectCountStringValue; 150 | 151 | #pragma mark Determining Cell Size 152 | 153 | - (NSRect)drawingRectForBounds:(NSRect)theRect; 154 | - (NSRect)titleRectForBounds:(NSRect)theRect ; 155 | - (NSRect)iconRectForBounds:(NSRect)theRect; 156 | - (NSRect)largeImageRectForBounds:(NSRect)theRect; 157 | - (NSRect)indicatorRectForBounds:(NSRect)theRect; 158 | - (NSSize)objectCounterSize; 159 | - (NSRect)objectCounterRectForBounds:(NSRect)theRect; 160 | - (NSRect)closeButtonRectForBounds:(NSRect)theRect; 161 | 162 | @property (readonly) CGFloat minimumWidthOfCell; 163 | @property (readonly) CGFloat desiredWidthOfCell; 164 | 165 | #pragma mark Drawing 166 | 167 | - (void)drawWithFrame:(NSRect) cellFrame inView:(NSView *)controlView; 168 | - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 169 | - (void)drawBezelWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 170 | - (void)drawLargeImageWithFrame:(NSRect)frame inView:(NSView *)controlView; 171 | - (void)drawIconWithFrame:(NSRect)frame inView:(NSView *)controlView; 172 | - (void)drawTitleWithFrame:(NSRect)frame inView:(NSView *)controlView; 173 | - (void)drawObjectCounterWithFrame:(NSRect)frame inView:(NSView *)controlView; 174 | - (void)drawIndicatorWithFrame:(NSRect)frame inView:(NSView *)controlView; 175 | - (void)drawCloseButtonWithFrame:(NSRect)frame inView:(NSView *)controlView; 176 | 177 | @end 178 | 179 | NS_ASSUME_NONNULL_END 180 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarViewler.h 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 11/24/06. 6 | // Copyright 2006 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class MMTabBarView, MMAttachedTabBarButton; 18 | 19 | @interface MMTabBarController : NSObject 20 | 21 | - (instancetype)initWithTabBarView:(MMTabBarView *)aTabBarView; 22 | 23 | @property (readonly) NSMenu *overflowMenu; 24 | 25 | - (void)layoutButtons; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarItem.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/29/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @protocol MMTabBarItem 18 | 19 | @optional 20 | 21 | /** 22 | * Title 23 | */ 24 | @property (copy, nullable) NSString *title; 25 | 26 | /** 27 | * Icon 28 | */ 29 | @property (strong, nullable) NSImage *icon; 30 | 31 | /** 32 | * Large image 33 | */ 34 | @property (strong, nullable) NSImage *largeImage; 35 | 36 | /** 37 | * Object count to display 38 | */ 39 | @property (assign) NSInteger objectCount; 40 | 41 | /** 42 | * YES: show object count, NO: do not show 43 | */ 44 | @property (assign) BOOL showObjectCount; 45 | 46 | /** 47 | * Color of object count badge 48 | */ 49 | @property (strong) NSColor *objectCountColor; 50 | 51 | /** 52 | * Processing state 53 | */ 54 | @property (assign) BOOL isProcessing; 55 | 56 | /** 57 | * Edited state 58 | */ 59 | @property (assign) BOOL isEdited; 60 | 61 | /** 62 | * Returns YES if item has close button 63 | */ 64 | @property (assign) BOOL hasCloseButton; 65 | 66 | @end 67 | 68 | NS_ASSUME_NONNULL_END 69 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.4.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.3.2 25 | NSHumanReadableCopyright 26 | © 2012-2016 Michael Monscheuer. All rights reserved. 27 | NSPrincipalClass 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MMTabBarView' target in the 'MMTabBarView' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #if __has_feature(modules) 7 | @import Cocoa; 8 | #else 9 | #import 10 | #endif 11 | #endif 12 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarView.Globals.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarView.Globals.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 20/04/16. 6 | // Copyright © 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | #define MMTabDragDidEndNotification @"MMTabDragDidEndNotification" 12 | #define MMTabDragDidBeginNotification @"MMTabDragDidBeginNotification" 13 | 14 | #define kMMTabBarViewHeight 22 15 | // default inset 16 | #define MARGIN_X 6 17 | #define MARGIN_Y 3 18 | // padding between objects 19 | #define kMMTabBarCellPadding 4 20 | // fixed size objects 21 | #define kMMMinimumTitleWidth 30 22 | #define kMMTabBarIndicatorWidth 16.0 23 | #define kMMTabBarIconWidth 16.0 24 | #define kMMObjectCounterMinWidth 20.0 25 | #define kMMObjectCounterRadius 7.0 26 | #define kMMTabBarViewSourceListHeight 28 27 | 28 | #define StaticImage(name) \ 29 | static NSImage* _static##name##Image() \ 30 | { \ 31 | static NSImage* image = nil; \ 32 | if (!image) \ 33 | image = [MMTabBarView.bundle imageForResource:@#name]; \ 34 | return image; \ 35 | } 36 | 37 | #define StaticImageWithFilename(name, filename) \ 38 | static NSImage* _static##name##Image() \ 39 | { \ 40 | static NSImage* image = nil; \ 41 | if (!image) \ 42 | image = [MMTabBarView.bundle imageForResource:@#filename]; \ 43 | return image; \ 44 | } 45 | 46 | /** 47 | * Tab bar orientation 48 | */ 49 | typedef NS_ENUM(NSUInteger, MMTabBarOrientation){ 50 | /** 51 | * Horizontal orientation 52 | */ 53 | MMTabBarHorizontalOrientation = 0, 54 | /** 55 | * Vertical orientation 56 | */ 57 | MMTabBarVerticalOrientation 58 | }; 59 | 60 | /** 61 | * Tear off style 62 | */ 63 | typedef NS_ENUM(NSUInteger, MMTabBarTearOffStyle){ 64 | /** 65 | * Show alpha window 66 | */ 67 | MMTabBarTearOffAlphaWindow, 68 | /** 69 | * Show mini window 70 | */ 71 | MMTabBarTearOffMiniwindow 72 | }; 73 | 74 | /** 75 | * Attached tab bar buttons enumeration options 76 | */ 77 | typedef NS_ENUM(NSUInteger, MMAttachedButtonsEnumerationOptions){ 78 | /** 79 | * No options 80 | */ 81 | MMAttachedButtonsEnumerationNone = 0, 82 | /** 83 | * Update tab state 84 | */ 85 | MMAttachedButtonsEnumerationUpdateTabStateMask = 1 << 1, 86 | /** 87 | * Update button state 88 | */ 89 | MMAttachedButtonsEnumerationUpdateButtonState = 1 << 2 90 | }; 91 | 92 | NS_ASSUME_NONNULL_END 93 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabBarView.Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabBarView.Private.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 23/05/15. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface MMTabBarView (PrivateDrawing) 12 | 13 | - (void)_drawInteriorInRect:(NSRect)rect; 14 | 15 | @property (readonly) NSRect _addTabButtonRect; 16 | @property (readonly) NSRect _overflowButtonRect; 17 | 18 | @property (assign) BOOL isReorderingTabViewItems; 19 | 20 | #pragma mark Private Actions 21 | 22 | - (void)_overflowMenuAction:(id)sender; 23 | - (void)_didClickTabButton:(id)sender; 24 | - (void)_didClickCloseButton:(id)sender; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragAssistant.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragAssistant.h 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 4/10/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | /* 10 | This class is a sigleton that manages the details of a tab drag and drop. The details were beginning to overwhelm me when keeping all of this in the control and buttons :-) 11 | */ 12 | 13 | #if __has_feature(modules) 14 | @import Cocoa; 15 | #else 16 | #import 17 | #endif 18 | #import "MMTabBarView.h" 19 | 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | @class MMTabDragWindowController, MMTabPasteboardItem; 23 | 24 | extern NSString *AttachedTabBarButtonUTI; 25 | 26 | @interface MMTabDragAssistant : NSObject 27 | 28 | // Creation/destruction 29 | + (instancetype)sharedDragAssistant; 30 | 31 | #pragma mark Properties 32 | 33 | @property (nullable, strong) MMTabBarView *sourceTabBar; 34 | @property (nullable, strong) MMAttachedTabBarButton *attachedTabBarButton; 35 | @property (nullable, strong) MMTabPasteboardItem *pasteboardItem; 36 | @property (nullable, strong) MMTabBarView *destinationTabBar; 37 | @property (assign) BOOL isDragging; 38 | @property (assign) NSPoint currentMouseLocation; 39 | 40 | @property (assign) BOOL isSliding; 41 | 42 | #pragma mark Dragging Source Handling 43 | 44 | - (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context ofTabBarView:(MMTabBarView *)tabBarView; 45 | 46 | - (BOOL)shouldStartDraggingAttachedTabBarButton:(MMAttachedTabBarButton *)aButton ofTabBarView:(MMTabBarView *)tabBarView withMouseDownEvent:(NSEvent *)event; 47 | 48 | - (void)startDraggingAttachedTabBarButton:(MMAttachedTabBarButton *)aButton fromTabBarView:(MMTabBarView *)tabBarView withMouseDownEvent:(NSEvent *)event; 49 | 50 | - (void)draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint withTabBarView:(MMTabBarView *)tabBarView; 51 | - (void)draggingSession:(NSDraggingSession *)session movedToPoint:(NSPoint)screenPoint; 52 | - (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation; 53 | 54 | #pragma mark Dragging Destination Handling 55 | 56 | - (NSDragOperation)draggingEntered:(id )sender inTabBarView:(MMTabBarView *)tabBarView; 57 | 58 | - (NSDragOperation)draggingUpdated:(id )sender inTabBarView:(MMTabBarView *)tabBarView; 59 | 60 | - (void)draggingExitedTabBarView:(MMTabBarView *)tabBarView draggingInfo:(id )sender; 61 | 62 | - (BOOL)performDragOperation:(id )sender forTabBarView:(MMTabBarView *)tabBarView; 63 | 64 | - (void)finishDragOfPasteboardItem:(MMTabPasteboardItem *)pasteboardItem; 65 | 66 | #pragma mark Dragging Helpers 67 | 68 | - (NSUInteger)destinationIndexForButton:(MMAttachedTabBarButton *)aButton atPoint:(NSPoint)aPoint inTabBarView:(MMTabBarView *)tabBarView; 69 | 70 | @end 71 | 72 | void CGContextCopyWindowCaptureContentsToRect(void *grafport, CGRect rect, NSInteger cid, NSInteger wid, NSInteger zero); 73 | OSStatus CGSSetWindowTransform(NSInteger cid, NSInteger wid, CGAffineTransform transform); 74 | 75 | @interface NSApplication (CoreGraphicsUndocumented) 76 | - (NSInteger)contextID; 77 | @end 78 | 79 | NS_ASSUME_NONNULL_END 80 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragView.h 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 6/17/07. 6 | // Copyright 2007 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface MMTabDragView : NSView 18 | 19 | @property (assign) CGFloat alpha; 20 | @property (strong) NSImage *image; 21 | @property (strong) NSImage *alternateImage; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragView.m 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 6/17/07. 6 | // Copyright 2007 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #import "MMTabDragView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @implementation MMTabDragView 14 | 15 | - (instancetype)initWithFrame:(NSRect)frame { 16 | if ((self = [super initWithFrame:frame])) { 17 | _alpha = 1.0; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)drawRect:(NSRect)rect { 23 | //1.0 fade means show the primary image 24 | //0.0 fade means show the secondary image 25 | CGFloat primaryAlpha = _alpha + 0.001, alternateAlpha = 1.001 - _alpha; 26 | NSRect srcRect; 27 | srcRect.origin = NSZeroPoint; 28 | srcRect.size = _image.size; 29 | 30 | [_image drawInRect:self.bounds fromRect:srcRect operation:NSCompositeSourceOver fraction:primaryAlpha respectFlipped:YES hints:nil]; 31 | srcRect.size = _alternateImage.size; 32 | [_alternateImage drawInRect:self.bounds fromRect:srcRect operation:NSCompositeSourceOver fraction:alternateAlpha respectFlipped:YES hints:nil]; 33 | } 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragWindow.h 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 6/1/06. 6 | // Copyright 2006 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class MMTabDragView; 18 | 19 | @interface MMTabDragWindow : NSWindow 20 | 21 | + (instancetype)dragWindowWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask; 22 | 23 | - (instancetype)initWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask; 24 | 25 | @property (readonly) MMTabDragView *dragView; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragWindow.m 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 6/1/06. 6 | // Copyright 2006 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #import "MMTabDragWindow.h" 10 | #import "MMTabDragView.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @implementation MMTabDragWindow 15 | { 16 | MMTabDragView *_dragView; 17 | } 18 | 19 | + (instancetype)dragWindowWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask { 20 | return [[MMTabDragWindow alloc] initWithImage:image styleMask:styleMask]; 21 | } 22 | 23 | - (instancetype)initWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask { 24 | NSSize size = image.size; 25 | 26 | if ((self = [super initWithContentRect:NSMakeRect(0, 0, size.width, size.height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO])) { 27 | _dragView = [[MMTabDragView alloc] initWithFrame:NSMakeRect(0, 0, size.width, size.height)]; 28 | [self setContentView:_dragView]; 29 | [self setLevel:NSStatusWindowLevel]; 30 | [self setIgnoresMouseEvents:YES]; 31 | [self setOpaque:NO]; 32 | 33 | [_dragView setImage:image]; 34 | 35 | //Set the size of the window to be the exact size of the drag image 36 | NSRect windowFrame = self.frame; 37 | windowFrame.origin.y += windowFrame.size.height - size.height; 38 | windowFrame.size = size; 39 | 40 | if (styleMask | NSBorderlessWindowMask) { 41 | windowFrame.size.height += 22; 42 | } 43 | 44 | [self setFrame:windowFrame display:YES]; 45 | } 46 | return self; 47 | } 48 | 49 | - (MMTabDragView *)dragView { 50 | return _dragView; 51 | } 52 | 53 | @end 54 | 55 | NS_ASSUME_NONNULL_END 56 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragWindowController.h 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 6/18/07. 6 | // Copyright 2007 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabBarView.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | #define kMMTabDragWindowAlpha 0.75 19 | #define kMMTabDragAlphaInterval 0.15 20 | 21 | @class MMTabDragView; 22 | 23 | @interface MMTabDragWindowController : NSWindowController 24 | 25 | - (instancetype)initWithImage:(NSImage *)image styleMask:(NSUInteger) styleMask tearOffStyle:(MMTabBarTearOffStyle)tearOffStyle; 26 | 27 | @property (readonly) NSImage *image; 28 | 29 | @property (strong) NSImage *alternateImage; 30 | 31 | @property (readonly) BOOL isAnimating; 32 | 33 | - (void)switchImages; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabDragWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabDragWindowController.m 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 6/18/07. 6 | // Copyright 2007 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #import "MMTabDragWindowController.h" 10 | #import "MMTabDragWindow.h" 11 | #import "MMTabDragView.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @implementation MMTabDragWindowController 16 | { 17 | MMTabBarTearOffStyle _tearOffStyle; 18 | MMTabDragView *_view; 19 | NSAnimation *_animation; 20 | NSTimer *_timer; 21 | 22 | BOOL _showingAlternate; 23 | NSRect _originalWindowFrame; 24 | } 25 | 26 | - (instancetype)initWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask tearOffStyle:(MMTabBarTearOffStyle)tearOffStyle { 27 | MMTabDragWindow *window = [MMTabDragWindow dragWindowWithImage:image styleMask:styleMask]; 28 | if ((self = [super initWithWindow:window])) { 29 | _view = window.dragView; 30 | _tearOffStyle = tearOffStyle; 31 | 32 | if (tearOffStyle == MMTabBarTearOffMiniwindow) { 33 | [window setBackgroundColor:NSColor.clearColor]; 34 | [window setHasShadow:YES]; 35 | } 36 | 37 | [window setAlphaValue:kMMTabDragWindowAlpha]; 38 | } 39 | return self; 40 | } 41 | 42 | - (void)dealloc { 43 | if (_timer) { 44 | [_timer invalidate]; 45 | } 46 | } 47 | 48 | - (NSImage *)image { 49 | return _view.image; 50 | } 51 | 52 | - (NSImage *)alternateImage { 53 | return _view.alternateImage; 54 | } 55 | 56 | - (void)setAlternateImage:(NSImage *)image { 57 | [_view setAlternateImage:image]; 58 | } 59 | 60 | - (BOOL)isAnimating { 61 | return _animation != nil; 62 | } 63 | 64 | - (void)switchImages { 65 | if (_tearOffStyle != MMTabBarTearOffMiniwindow || !_view.alternateImage) { 66 | return; 67 | } 68 | 69 | NSAnimationProgress progress = 0; 70 | _showingAlternate = !_showingAlternate; 71 | 72 | if (_animation) { 73 | //An animation already exists, get the current progress 74 | progress = 1.0f - _animation.currentProgress; 75 | [_animation stopAnimation]; 76 | } 77 | 78 | //begin animating 79 | _animation = [[NSAnimation alloc] initWithDuration:0.25 animationCurve:NSAnimationEaseInOut]; 80 | [_animation setAnimationBlockingMode:NSAnimationNonblocking]; 81 | [_animation setCurrentProgress:progress]; 82 | [_animation startAnimation]; 83 | 84 | _originalWindowFrame = self.window.frame; 85 | 86 | if (_timer) { 87 | [_timer invalidate]; 88 | } 89 | _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 / 30.0 target:self selector:@selector(animateTimer:) userInfo:nil repeats:YES]; 90 | } 91 | 92 | - (void)animateTimer:(NSTimer *)timer { 93 | NSRect frame = _originalWindowFrame; 94 | NSImage *currentImage = _showingAlternate ? _view.alternateImage : _view.image; 95 | NSSize size = currentImage.size; 96 | NSPoint mousePoint = NSEvent.mouseLocation; 97 | CGFloat animationValue = (CGFloat) _animation.currentValue; 98 | 99 | frame.size.width = _originalWindowFrame.size.width + (size.width - _originalWindowFrame.size.width) * animationValue; 100 | frame.size.height = _originalWindowFrame.size.height + (size.height - _originalWindowFrame.size.height) * animationValue; 101 | frame.origin.x = mousePoint.x - (frame.size.width / 2); 102 | frame.origin.y = mousePoint.y - (frame.size.height / 2); 103 | 104 | [_view setAlpha:_showingAlternate ? 1.0 - animationValue : animationValue]; 105 | [self.window setFrame:frame display:YES]; 106 | 107 | if (!_animation.isAnimating) { 108 | _animation = nil; 109 | [timer invalidate]; 110 | _timer = nil; 111 | } 112 | } 113 | 114 | @end 115 | 116 | NS_ASSUME_NONNULL_END 117 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabPasteboardItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabPasteboardItem.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/11/12. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class MMAttachedTabBarButton; 18 | @class MMTabBarView; 19 | 20 | @interface MMTabPasteboardItem : NSPasteboardItem 21 | 22 | @property (assign) NSUInteger sourceIndex; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/MMTabPasteboardItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMTabPasteboardItem.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/11/12. 6 | // 7 | // 8 | 9 | #import "MMTabPasteboardItem.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @implementation MMTabPasteboardItem 14 | 15 | - (instancetype)init { 16 | self = [super init]; 17 | if (self) { 18 | _sourceIndex = NSNotFound; 19 | } 20 | return self; 21 | } 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSAffineTransform+MMTabBarViewExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAffineTransform+MMTabBarViewExtensions.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/26/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface NSAffineTransform (MMTabBarViewExtensions) 18 | 19 | - (NSAffineTransform *)mm_flipVertical:(NSRect)bounds; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSAffineTransform+MMTabBarViewExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSAffineTransform+MMTabBarViewExtensions.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/26/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "NSAffineTransform+MMTabBarViewExtensions.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @implementation NSAffineTransform (MMTabBarViewExtensions) 14 | 15 | // initialize the NSAffineTransform so it will flip the contents of bounds 16 | - (NSAffineTransform *)mm_flipVertical:(NSRect)bounds { 17 | NSAffineTransformStruct at; 18 | at.m11 = 1.0; 19 | at.m12 = 0.0; 20 | at.tX = 0; 21 | at.m21 = 0.0; 22 | at.m22 = -1.0; 23 | at.tY = bounds.origin.y+bounds.size.height; 24 | [self setTransformStruct: at]; 25 | 26 | [self translateXBy:0.0 yBy:-bounds.origin.y]; 27 | return self; 28 | } 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSBezierPath+MMTabBarViewExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+MMTabBarViewExtensions.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/26/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | typedef NS_ENUM(NSUInteger, MMBezierShapeCapMask) 18 | { 19 | MMBezierShapeLeftCap = 0x0001, 20 | MMBezierShapeRightCap = 0x0002, 21 | 22 | MMBezierShapeAllCaps = 0x000F, 23 | 24 | MMBezierShapeFlippedVertically = 0x1000, 25 | MMBezierShapeFillPath = 0x2000 26 | }; 27 | 28 | @interface NSBezierPath (MMTabBarViewExtensions) 29 | 30 | + (NSBezierPath *)bezierPathWithCardInRect:(NSRect)aRect radius:(CGFloat)radius capMask:(MMBezierShapeCapMask)mask; 31 | 32 | + (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)aRect radius:(CGFloat)radius capMask:(MMBezierShapeCapMask)mask; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSBezierPath+MMTabBarViewExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+MMTabBarViewExtensions.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/26/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "NSBezierPath+MMTabBarViewExtensions.h" 10 | 11 | #import "NSAffineTransform+MMTabBarViewExtensions.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @implementation NSBezierPath (MMTabBarViewExtensions) 16 | 17 | + (NSBezierPath *)bezierPathWithCardInRect:(NSRect)aRect radius:(CGFloat)radius capMask:(MMBezierShapeCapMask)mask { 18 | 19 | NSBezierPath *bezier = [self _bezierPathWithCardInRect:aRect radius:radius capMask:mask]; 20 | 21 | // Flip the final NSBezierPath. 22 | if (mask & MMBezierShapeFlippedVertically) 23 | [bezier transformUsingAffineTransform:[NSAffineTransform.transform mm_flipVertical:bezier.bounds]]; 24 | 25 | return bezier; 26 | } 27 | 28 | + (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)aRect radius:(CGFloat)radius capMask:(MMBezierShapeCapMask)mask { 29 | 30 | NSBezierPath *bezier = [self _bezierPathWithRoundedRect:aRect radius:radius capMask:mask]; 31 | 32 | // Flip the final NSBezierPath. 33 | if (mask & MMBezierShapeFlippedVertically) 34 | [bezier transformUsingAffineTransform:[NSAffineTransform.transform mm_flipVertical:bezier.bounds]]; 35 | 36 | return bezier; 37 | } 38 | 39 | #pragma mark - 40 | #pragma mark Private Methods 41 | 42 | + (NSBezierPath *)_bezierPathWithCardInRect:(NSRect)aRect radius:(CGFloat)radius capMask:(MMBezierShapeCapMask)mask { 43 | 44 | NSBezierPath *bezier = NSBezierPath.bezierPath; 45 | 46 | if (mask & MMBezierShapeLeftCap) { 47 | [bezier moveToPoint: NSMakePoint(NSMinX(aRect),NSMaxY(aRect))]; 48 | [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMinX(aRect),NSMinY(aRect)) toPoint:NSMakePoint(NSMidX(aRect),NSMinY(aRect)) radius:radius]; 49 | } else { 50 | if (mask & MMBezierShapeFillPath) { 51 | [bezier moveToPoint: NSMakePoint(NSMinX(aRect),NSMaxY(aRect))]; 52 | [bezier lineToPoint:NSMakePoint(NSMinX(aRect), NSMinY(aRect))]; 53 | } else { 54 | [bezier moveToPoint:NSMakePoint(NSMinX(aRect), NSMinY(aRect))]; 55 | } 56 | } 57 | 58 | if (mask & MMBezierShapeRightCap) { 59 | [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMaxX(aRect),NSMinY(aRect)) toPoint:NSMakePoint(NSMaxX(aRect),NSMaxY(aRect)) radius:radius]; 60 | [bezier lineToPoint: NSMakePoint(NSMaxX(aRect),NSMaxY(aRect))]; 61 | } else { 62 | 63 | [bezier lineToPoint: NSMakePoint(NSMaxX(aRect),NSMinY(aRect))]; 64 | if (mask & MMBezierShapeFillPath) 65 | [bezier lineToPoint: NSMakePoint(NSMaxX(aRect),NSMaxY(aRect))]; 66 | } 67 | 68 | return bezier; 69 | } 70 | 71 | + (NSBezierPath *)_bezierPathWithRoundedRect:(NSRect)aRect radius:(CGFloat)radius capMask:(MMBezierShapeCapMask)mask { 72 | 73 | NSBezierPath *bezier = NSBezierPath.bezierPath; 74 | 75 | [bezier moveToPoint: NSMakePoint(NSMidX(aRect),NSMaxY(aRect))]; 76 | if (mask & MMBezierShapeLeftCap) { 77 | [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMinX(aRect),NSMaxY(aRect)) toPoint:NSMakePoint(NSMinX(aRect),NSMinY(aRect)) radius:radius]; 78 | [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMinX(aRect),NSMinY(aRect)) toPoint:NSMakePoint(NSMidX(aRect),NSMinY(aRect)) radius:radius]; 79 | [bezier lineToPoint:NSMakePoint(NSMidX(aRect),NSMinY(aRect))]; 80 | } else { 81 | [bezier lineToPoint:NSMakePoint(NSMinX(aRect),NSMaxY(aRect))]; 82 | if (mask & MMBezierShapeFillPath) 83 | [bezier lineToPoint:NSMakePoint(NSMinX(aRect),NSMinY(aRect))]; 84 | else 85 | [bezier moveToPoint:NSMakePoint(NSMinX(aRect),NSMinY(aRect))]; 86 | [bezier lineToPoint:NSMakePoint(NSMidX(aRect),NSMinY(aRect))]; 87 | } 88 | 89 | if (mask & MMBezierShapeRightCap) { 90 | [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMaxX(aRect), NSMinY(aRect)) toPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)) radius:radius]; 91 | [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)) toPoint:NSMakePoint(NSMidX(aRect), NSMaxY(aRect)) radius:radius]; 92 | [bezier closePath]; 93 | } else { 94 | [bezier lineToPoint:NSMakePoint(NSMaxX(aRect),NSMinY(aRect))]; 95 | if (mask & MMBezierShapeFillPath) 96 | [bezier lineToPoint:NSMakePoint(NSMaxX(aRect),NSMaxY(aRect))]; 97 | else 98 | [bezier moveToPoint:NSMakePoint(NSMaxX(aRect),NSMaxY(aRect))]; 99 | [bezier lineToPoint:NSMakePoint(NSMidX(aRect),NSMaxY(aRect))]; 100 | [bezier closePath]; 101 | } 102 | 103 | return bezier; 104 | } 105 | @end 106 | 107 | NS_ASSUME_NONNULL_END 108 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSCell+MMTabBarViewExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSCell+MMTabBarViewExtensions.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/25/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface NSCell (MMTabBarViewExtensions) 18 | 19 | #pragma mark Image Scaling 20 | 21 | - (NSSize)mm_scaleImageWithSize:(NSSize)imageSize toFitInSize:(NSSize)canvasSize scalingType:(NSImageScaling)scalingType; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSCell+MMTabBarViewExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSCell+MMTabBarViewExtensions.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/25/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "NSCell+MMTabBarViewExtensions.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @implementation NSCell (MMTabBarViewExtensions) 14 | 15 | #pragma mark - 16 | #pragma mark Image Scaling 17 | 18 | static inline NSSize mm_scaleProportionally(NSSize imageSize, NSSize canvasSize, BOOL scaleUpOrDown) { 19 | 20 | CGFloat ratio; 21 | 22 | if (imageSize.width <= 0 || imageSize.height <= 0) { 23 | return NSMakeSize(0, 0); 24 | } 25 | 26 | // get the smaller ratio and scale the image size with it 27 | ratio = MIN(canvasSize.width / imageSize.width, 28 | canvasSize.height / imageSize.height); 29 | 30 | // Only scale down, unless scaleUpOrDown is YES 31 | if (ratio < 1.0 || scaleUpOrDown) 32 | { 33 | imageSize.width *= ratio; 34 | imageSize.height *= ratio; 35 | } 36 | 37 | return imageSize; 38 | } 39 | 40 | - (NSSize)mm_scaleImageWithSize:(NSSize)imageSize toFitInSize:(NSSize)canvasSize scalingType:(NSImageScaling)scalingType { 41 | 42 | NSSize result; 43 | 44 | switch (scalingType) { 45 | case NSImageScaleProportionallyDown: 46 | result = mm_scaleProportionally (imageSize, canvasSize, NO); 47 | break; 48 | case NSImageScaleAxesIndependently: 49 | result = canvasSize; 50 | break; 51 | default: 52 | case NSImageScaleNone: 53 | result = imageSize; 54 | break; 55 | case NSImageScaleProportionallyUpOrDown: 56 | result = mm_scaleProportionally (imageSize, canvasSize, YES); 57 | break; 58 | } 59 | 60 | return result; 61 | } 62 | 63 | @end 64 | 65 | NS_ASSUME_NONNULL_END 66 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSString+MMTabBarViewExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MMTabBarViewExtensions.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/19/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface NSString (MMTabBarViewExtensions) 18 | 19 | // Truncate string to no longer than truncationLength; should be > 10 20 | - (NSString *)stringByTruncatingToLength:(NSUInteger)truncationLength; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSString+MMTabBarViewExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MMTabBarViewExtensions.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/19/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #import "NSString+MMTabBarViewExtensions.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @implementation NSString (MMTabBarViewExtensions) 14 | 15 | // Truncate string to no longer than truncationLength; should be > 10 16 | - (NSString *)stringByTruncatingToLength:(NSUInteger)truncationLength { 17 | NSUInteger len = self.length; 18 | if (len < truncationLength) 19 | return [self copy]; 20 | 21 | // Unicode character 2026 is ellipsis 22 | return [[self substringToIndex:truncationLength - 10] stringByAppendingString:@"\u2026"]; 23 | } 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSTabViewItem+MMTabBarViewExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTabViewItem+MMTabBarViewExtensions.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/29/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "MMTabBarItem.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface NSTabViewItem (MMTabBarViewExtensions) 20 | 21 | @property (nullable, retain) NSImage *largeImage; 22 | @property (nullable, retain) NSImage *icon; 23 | @property (assign) BOOL isProcessing; 24 | @property (assign) NSInteger objectCount; 25 | @property (nullable, retain) NSColor *objectCountColor; 26 | @property (assign) BOOL showObjectCount; 27 | @property (assign) BOOL isEdited; 28 | @property (assign) BOOL hasCloseButton; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSTabViewItem+MMTabBarViewExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSTabViewItem+MMTabBarViewExtensions.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/29/12. 6 | // Copyright (c) 2016 Michael Monscheuer. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import ObjectiveC.runtime; 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "NSTabViewItem+MMTabBarViewExtensions.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @implementation NSTabViewItem (MMTabBarViewExtensions) 20 | 21 | static char largeImage_key; //has a unique address (identifier) 22 | static char icon_key; 23 | static char isProcessing_key; 24 | static char isEdited_key; 25 | static char hasCloseButton_key; 26 | static char objectCount_key; 27 | static char objectCountColor_key; 28 | static char showObjectCount_key; 29 | 30 | - (nullable NSImage *)largeImage 31 | { 32 | return objc_getAssociatedObject(self,&largeImage_key); 33 | } 34 | 35 | - (void)setLargeImage:(nullable NSImage *)newImage 36 | { 37 | objc_setAssociatedObject(self,&largeImage_key,newImage, 38 | OBJC_ASSOCIATION_RETAIN); 39 | } 40 | 41 | - (nullable NSImage *)icon 42 | { 43 | return objc_getAssociatedObject(self,&icon_key); 44 | } 45 | 46 | - (void)setIcon:(nullable NSImage *)newImage 47 | { 48 | objc_setAssociatedObject(self,&icon_key,newImage, 49 | OBJC_ASSOCIATION_RETAIN); 50 | } 51 | 52 | - (BOOL)isProcessing 53 | { 54 | return [(NSNumber*) objc_getAssociatedObject(self,&isProcessing_key) boolValue]; 55 | } 56 | 57 | - (void)setIsProcessing:(BOOL)flag 58 | { 59 | NSNumber *boolValue = [NSNumber numberWithBool:flag]; 60 | objc_setAssociatedObject(self,&isProcessing_key,boolValue, 61 | OBJC_ASSOCIATION_RETAIN); 62 | } 63 | 64 | - (NSInteger)objectCount 65 | { 66 | return [(NSNumber*) objc_getAssociatedObject(self,&objectCount_key) integerValue]; 67 | } 68 | 69 | - (void)setObjectCount:(NSInteger)value 70 | { 71 | NSNumber *integerValue = [NSNumber numberWithInteger:value]; 72 | objc_setAssociatedObject(self,&objectCount_key,integerValue, 73 | OBJC_ASSOCIATION_RETAIN); 74 | } 75 | 76 | - (nullable NSColor *)objectCountColor 77 | { 78 | return objc_getAssociatedObject(self,&objectCountColor_key); 79 | } 80 | 81 | - (void)setObjectCountColor:(nullable NSColor *)aColor 82 | { 83 | objc_setAssociatedObject(self,&objectCountColor_key,aColor, 84 | OBJC_ASSOCIATION_RETAIN); 85 | } 86 | 87 | - (BOOL)showObjectCount 88 | { 89 | return [(NSNumber*) objc_getAssociatedObject(self,&showObjectCount_key) boolValue]; 90 | } 91 | 92 | - (void)setShowObjectCount:(BOOL)flag 93 | { 94 | NSNumber *boolValue = [NSNumber numberWithBool:flag]; 95 | objc_setAssociatedObject(self,&showObjectCount_key,boolValue, 96 | OBJC_ASSOCIATION_RETAIN); 97 | } 98 | 99 | - (BOOL)isEdited 100 | { 101 | return [(NSNumber*) objc_getAssociatedObject(self,&isEdited_key) boolValue]; 102 | } 103 | 104 | - (void)setIsEdited:(BOOL)flag 105 | { 106 | NSNumber *boolValue = [NSNumber numberWithBool:flag]; 107 | objc_setAssociatedObject(self,&isEdited_key,boolValue, 108 | OBJC_ASSOCIATION_RETAIN); 109 | } 110 | 111 | - (BOOL)hasCloseButton 112 | { 113 | return [(NSNumber*) objc_getAssociatedObject(self,&hasCloseButton_key) boolValue]; 114 | } 115 | 116 | - (void)setHasCloseButton:(BOOL)flag 117 | { 118 | NSNumber *boolValue = [NSNumber numberWithBool:flag]; 119 | objc_setAssociatedObject(self,&hasCloseButton_key,boolValue, 120 | OBJC_ASSOCIATION_RETAIN); 121 | } 122 | 123 | @end 124 | 125 | NS_ASSUME_NONNULL_END 126 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSView+MMTabBarViewExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSView+MMTabBarViewExtensions.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/13/12. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class MMTabBarView; 18 | @class MMTabBarButton; 19 | 20 | @interface NSView (MMTabBarViewExtensions) 21 | 22 | - (BOOL)mm_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent withExpiration:(NSDate *)expiration; 23 | - (BOOL)mm_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent withExpiration:(NSDate *)expiration xHysteresis:(CGFloat)xHysteresis yHysteresis:(CGFloat)yHysteresis; 24 | 25 | - (NSView *)mm_superviewOfClass:(Class)class; 26 | 27 | - (MMTabBarView *)enclosingTabBarView; 28 | - (MMTabBarButton *)enclosingTabBarButton; 29 | 30 | - (void)orderFront; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/NSView+MMTabBarViewExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSView+MMTabBarExtensions.m 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/13/12. 6 | // 7 | // 8 | 9 | #import "NSView+MMTabBarViewExtensions.h" 10 | 11 | #import "MMTabBarView.h" 12 | #import "MMTabBarButton.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | #define MMDragStartHysteresisX 5.0 17 | #define MMDragStartHysteresisY 5.0 18 | 19 | @implementation NSView (MMTabBarExtensions) 20 | 21 | - (BOOL)mm_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent 22 | withExpiration:(NSDate *)expiration 23 | { 24 | return [self mm_dragShouldBeginFromMouseDown:mouseDownEvent 25 | withExpiration:expiration 26 | xHysteresis:MMDragStartHysteresisX 27 | yHysteresis:MMDragStartHysteresisY]; 28 | } 29 | 30 | - (BOOL)mm_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent 31 | withExpiration:(NSDate *)expiration 32 | xHysteresis:(CGFloat)xHysteresis 33 | yHysteresis:(CGFloat)yHysteresis { 34 | 35 | NSEvent *nextEvent = nil, 36 | *firstEvent = nil, 37 | *dragEvent = nil, 38 | *mouseUp = nil; 39 | BOOL dragIt = NO; 40 | 41 | while ((nextEvent = [self.window nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask) untilDate:expiration inMode:NSEventTrackingRunLoopMode dequeue:YES]) != nil) { 42 | 43 | if (firstEvent == nil) { 44 | firstEvent = nextEvent; 45 | } 46 | 47 | if (nextEvent.type == NSLeftMouseDragged) { 48 | CGFloat deltaX = ABS(nextEvent.locationInWindow.x - mouseDownEvent.locationInWindow.x); 49 | CGFloat deltaY = ABS(nextEvent.locationInWindow.y - mouseDownEvent.locationInWindow.y); 50 | dragEvent = nextEvent; 51 | 52 | if (deltaX >= xHysteresis || deltaY >= yHysteresis) { 53 | dragIt = YES; 54 | break; 55 | } 56 | } else if (nextEvent.type == NSLeftMouseUp) { 57 | mouseUp = nextEvent; 58 | break; 59 | } 60 | } 61 | 62 | // push back dequeued events 63 | if (mouseUp != nil) { 64 | [NSApp postEvent:mouseUp atStart:YES]; 65 | } 66 | if (dragEvent != nil) { 67 | [NSApp postEvent:dragEvent atStart:YES]; 68 | } 69 | if (firstEvent != mouseUp && firstEvent != dragEvent) { 70 | [NSApp postEvent:firstEvent atStart:YES]; 71 | } 72 | 73 | return dragIt; 74 | } 75 | 76 | - (NSView *)mm_superviewOfClass:(Class)class { 77 | NSView *view = self.superview; 78 | while (view && ![view isKindOfClass:class]) 79 | view = view.superview; 80 | return view; 81 | } 82 | 83 | -(MMTabBarView *)enclosingTabBarView { 84 | return (MMTabBarView *)[self mm_superviewOfClass:MMTabBarView.class]; 85 | } 86 | 87 | - (MMTabBarButton *)enclosingTabBarButton { 88 | return (MMTabBarButton *)[self mm_superviewOfClass:MMTabBarButton.class]; 89 | } 90 | 91 | - (void)orderFront { 92 | 93 | NSView *superview = self.superview; 94 | if (!superview) 95 | return; 96 | 97 | NSMutableArray<__kindof NSView *> *subviews = [superview.subviews mutableCopy]; 98 | [subviews removeObjectIdenticalTo:self]; 99 | [subviews addObject:self]; 100 | [superview setSubviews:subviews]; 101 | } 102 | 103 | @end 104 | 105 | NS_ASSUME_NONNULL_END 106 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/MMAdiumTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAdiumTabStyle.h 3 | // MMTabBarView 4 | // 5 | // Created by Kent Sutherland on 5/26/06. 6 | // Copyright 2006 Kent Sutherland. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMAdiumTabStyle : NSObject 19 | 20 | @property (assign) BOOL drawsUnified; 21 | @property (assign) BOOL drawsRight; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/MMAquaTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAquaTabStyle.h 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 2/17/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMAquaTabStyle : NSObject 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/MMCardTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMCardTabStyle.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/3/12. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | #import "NSBezierPath+MMTabBarViewExtensions.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface MMCardTabStyle : NSObject 20 | 21 | @property (assign) CGFloat horizontalInset; 22 | @property (assign) CGFloat topMargin; 23 | 24 | #pragma mark Card Tab Style Drawings 25 | 26 | // the funnel point for modify tab button drawing in a subclass 27 | - (void)drawBezelInRect:(NSRect)aRect withCapMask:(MMBezierShapeCapMask)capMask usingStatesOfAttachedButton:(MMAttachedTabBarButton *)button ofTabBarView:(MMTabBarView *)tabBarView; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/MMLiveChatTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMLiveChatTabStyle.h 3 | // -------------------- 4 | // 5 | // Created by Keith Blount on 30/04/2006. 6 | // Copyright 2006 Keith Blount. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | #import "NSBezierPath+MMTabBarViewExtensions.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface MMLiveChatTabStyle : NSObject 20 | 21 | @property (assign) CGFloat leftMarginForTabBarView; 22 | 23 | #pragma mark Live Chat Tab Style Drawings 24 | 25 | // the funnel point for modify tab button drawing in a subclass 26 | - (void)drawBezelInRect:(NSRect)aRect withCapMask:(MMBezierShapeCapMask)capMask usingStatesOfAttachedButton:(MMAttachedTabBarButton *)button ofTabBarView:(MMTabBarView *)tabBarView; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/MMMetalTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMMetalTabStyle.h 3 | // MMTabBarView 4 | // 5 | // Created by John Pannell on 2/17/06. 6 | // Copyright 2006 Positive Spin Media. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMMetalTabStyle : NSObject 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/MMUnifiedTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMUnifiedTabStyle.h 3 | // -------------------- 4 | // 5 | // Created by Keith Blount on 30/04/2006. 6 | // Copyright 2006 Keith Blount. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMUnifiedTabStyle : NSObject 19 | 20 | @property (assign) CGFloat leftMarginForTabBarView; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Mojave Tab Style/MMMojaveTabStyle+Assets.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMMojaveTabStyle+Assets.h 3 | // ------------------------ 4 | // 5 | // Provides assets for MMMojaveTabStyle 6 | // Created by Jim Derry on 2018/07/31. 7 | // Changes released in accordance with MMTabBarView license. 8 | // 9 | // Because MMTabBarView supports back to 10.10 (this fork), we cannot use 10 | // named colors in asset catalogues. The MMMojaveTabStyle should work 11 | // transparently pre-10.14, and so we will build our own catalogue of assets. 12 | // 13 | // Nearly all colors are hard-coded. Most of the Mojave-required named system 14 | // colors were introduced in macOS 10.14, and are not available in older 15 | // platforms supported by MMTabBarView. 16 | // 17 | // In addition, NSImage assets are generated procedurally in order to support 18 | // current and future color tints and to maintain resolution independence. 19 | // 20 | 21 | #import "MMMojaveTabStyle.h" 22 | 23 | 24 | @interface MMMojaveTabStyle (Assets) 25 | 26 | // Appearances supported by this tab style, with room to grow in case Apple give us 27 | // future surprises. Pre-Mojove will only use the MMMappearanceAquaLight; Mojave and 28 | // later will choose the correct appearance based on the containing view's setting. 29 | typedef NS_ENUM(NSInteger, MMMojaveTabStyleAppearance) 30 | { 31 | MMMappearanceAquaLight, 32 | MMMappearanceAquaLightInactive, 33 | MMMappearanceAquaLightHighContrast, 34 | MMMappearanceAquaLightHighContrastInactive, 35 | MMMappearanceAquaDark, 36 | MMMappearanceAquaDarkInactive, 37 | MMMappearanceAquaDarkHighContrast, 38 | MMMappearanceAquaDarkHighContrastInactive, 39 | }; 40 | 41 | // `assetForPart` will retrieve colors, images, and other assets via this enum as keys. Assets 42 | // are also keyed to MMCloseButtonImageType, which can be cast to this type for fetching assets. 43 | typedef NS_ENUM(NSInteger, MMMojaveTabStyleAsset) 44 | { 45 | MMMbezelMiddle = 512, // Interbutton color, right side. 46 | MMMbezelTop, // Top bezel color. 47 | MMMbezelBottom, // Bottom bezel color. 48 | 49 | MMMtabSelected, // Tab selected color. 50 | MMMtabUnselected, // Tab unselected color. 51 | MMMtabUnselectedHover, // Tab hover color. 52 | 53 | MMMtabSelectedFont, // Tab selected font color. 54 | MMMtabUnselectedFont, // Tab unselected font color. 55 | MMMtabUnselectedHoverFont, // Tab hover font color. 56 | 57 | MMMtabBarBackground, // Tab bar background color (visible behind add button) 58 | 59 | MMMaddButtonImage, // Add button, normal image. 60 | MMMaddButtonImageAlternate, // Add button, alternate/pressed image. 61 | MMMaddButtonImageRollover // Add button, rollover image. 62 | }; 63 | 64 | 65 | // Retrieve the required part as an NSColor for the given tabBarView. 66 | - (NSColor *)colorForPart:(MMMojaveTabStyleAsset)part ofTabBarView:(MMTabBarView *)tabBarView; 67 | 68 | // Retrieve the required part for the given tabBarView. 69 | - (id)assetForPart:(MMMojaveTabStyleAsset)part ofTabBarView:(MMTabBarView *)tabBarView; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Mojave Tab Style/MMMojaveTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMMojaveTabStyle.h 3 | // ------------------ 4 | // 5 | // Created by Jim Derry on 2018/07/30. 6 | // Changes released in accordance with MMTabBarView license. 7 | // 8 | // For proper Mojave-like appearance, configure your MMTabBar like so: 9 | // - allow inactive tab closing 10 | // - only show close on hover 11 | // - use overflow menu NO 12 | // - automatically animates 13 | // - size to fit NO 14 | // 15 | // Features: 16 | // - Presents a nearly-faithful reproduction of Movaje tabs such as those 17 | // used on Safari and in Finder on all MMTabBarView supported systems. 18 | // - Dark mode is supported on macOS 10.14 systems and newer, when the 19 | // framework is built with the macOS 10.14 SDK or later. 20 | // - Dark mode is automatic. If the containing view is in dark mode, then 21 | // the style will be in dark mode. 22 | // - High contrast mode is supported on all modes. 23 | // - Proper, dimmed colors are used when the containing window is inactive. 24 | // - All images are drawn in code, reducing the framework size. Due to all 25 | // of the different highlight color combinations, this is a positive 26 | // feature, and of course supports future, higher-pixel-density displays. 27 | // 28 | // Limitations: 29 | // We are unable to replicate Mojave's tab bar style completely, due to lack 30 | // of supporting API in MMTabBarView. For example: 31 | // - Some of the close tab button hover colors are different in Mojave, but 32 | // MMTabBarView supports only a single image. 33 | // - MMTabBarView provides its own margins for the add tab button, so we 34 | // cannot occupy the entire space. Thus although we can implement Mojave's 35 | // hover behavor faithfully, we cannot emulate the mouse-down highlighting 36 | // properly. 37 | // 38 | 39 | 40 | #if __has_feature(modules) 41 | @import Cocoa; 42 | #else 43 | #import 44 | #endif 45 | #import "MMTabStyle.h" 46 | 47 | NS_ASSUME_NONNULL_BEGIN 48 | 49 | @interface MMMojaveTabStyle : NSObject 50 | 51 | @property (assign) CGFloat leftMarginForTabBarView; 52 | 53 | @property (assign) BOOL needsResizeTabsToFitTotalWidth; 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/MMSafariTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMSafariTabStyle.h 3 | // MMTabBarView 4 | // 5 | // Created by Michael Monscheuer on 9/20/12. 6 | // Copyright 2011 Marrintech. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Cocoa; 11 | #else 12 | #import 13 | #endif 14 | #import "MMTabStyle.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface MMSafariTabStyle : NSObject 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClose.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWATClose.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWATClose@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClose.imageset/SafariAWATClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClose.imageset/SafariAWATClose.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClose.imageset/SafariAWATClose@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClose.imageset/SafariAWATClose@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClosePressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWATClosePressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWATClosePressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClosePressed.imageset/SafariAWATClosePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClosePressed.imageset/SafariAWATClosePressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClosePressed.imageset/SafariAWATClosePressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATClosePressed.imageset/SafariAWATClosePressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATCloseRollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWATCloseRollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWATCloseRollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATCloseRollover.imageset/SafariAWATCloseRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATCloseRollover.imageset/SafariAWATCloseRollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATCloseRollover.imageset/SafariAWATCloseRollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATCloseRollover.imageset/SafariAWATCloseRollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWATFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWATFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATFill.imageset/SafariAWATFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATFill.imageset/SafariAWATFill.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATFill.imageset/SafariAWATFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATFill.imageset/SafariAWATFill@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATLeftCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWATLeftCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWATLeftCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATLeftCap.imageset/SafariAWATLeftCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATLeftCap.imageset/SafariAWATLeftCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATLeftCap.imageset/SafariAWATLeftCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATLeftCap.imageset/SafariAWATLeftCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATRightCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWATRightCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWATRightCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATRightCap.imageset/SafariAWATRightCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATRightCap.imageset/SafariAWATRightCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATRightCap.imageset/SafariAWATRightCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWATRightCap.imageset/SafariAWATRightCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWAddTabButton.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButton.imageset/SafariAWAddTabButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButton.imageset/SafariAWAddTabButton.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButtonPushed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWAddTabButtonPushed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButtonPushed.imageset/SafariAWAddTabButtonPushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButtonPushed.imageset/SafariAWAddTabButtonPushed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButtonRolloverPlus.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWAddTabButtonRolloverPlus.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButtonRolloverPlus.imageset/SafariAWAddTabButtonRolloverPlus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWAddTabButtonRolloverPlus.imageset/SafariAWAddTabButtonRolloverPlus.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWBG.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWBG.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWBG.imageset/SafariAWBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWBG.imageset/SafariAWBG.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClose.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWITClose.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWITClose@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClose.imageset/SafariAWITClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClose.imageset/SafariAWITClose.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClose.imageset/SafariAWITClose@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClose.imageset/SafariAWITClose@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClosePressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWITClosePressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWITClosePressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClosePressed.imageset/SafariAWITClosePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClosePressed.imageset/SafariAWITClosePressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClosePressed.imageset/SafariAWITClosePressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITClosePressed.imageset/SafariAWITClosePressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITCloseRollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWITCloseRollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWITCloseRollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITCloseRollover.imageset/SafariAWITCloseRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITCloseRollover.imageset/SafariAWITCloseRollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITCloseRollover.imageset/SafariAWITCloseRollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITCloseRollover.imageset/SafariAWITCloseRollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITLeftCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWITLeftCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWITLeftCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITLeftCap.imageset/SafariAWITLeftCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITLeftCap.imageset/SafariAWITLeftCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITLeftCap.imageset/SafariAWITLeftCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITLeftCap.imageset/SafariAWITLeftCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITRightCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariAWITRightCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariAWITRightCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITRightCap.imageset/SafariAWITRightCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITRightCap.imageset/SafariAWITRightCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITRightCap.imageset/SafariAWITRightCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariAWITRightCap.imageset/SafariAWITRightCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClose.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWATClose.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWATClose@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClose.imageset/SafariIWATClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClose.imageset/SafariIWATClose.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClose.imageset/SafariIWATClose@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClose.imageset/SafariIWATClose@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClosePressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWATClosePressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWATClosePressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClosePressed.imageset/SafariIWATClosePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClosePressed.imageset/SafariIWATClosePressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClosePressed.imageset/SafariIWATClosePressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATClosePressed.imageset/SafariIWATClosePressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATCloseRollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWATCloseRollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWATCloseRollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATCloseRollover.imageset/SafariIWATCloseRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATCloseRollover.imageset/SafariIWATCloseRollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATCloseRollover.imageset/SafariIWATCloseRollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATCloseRollover.imageset/SafariIWATCloseRollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWATFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATFill.imageset/SafariIWATFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATFill.imageset/SafariIWATFill.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATLeftCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWATLeftCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWATLeftCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATLeftCap.imageset/SafariIWATLeftCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATLeftCap.imageset/SafariIWATLeftCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATLeftCap.imageset/SafariIWATLeftCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATLeftCap.imageset/SafariIWATLeftCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATRightCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWATRightCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWATRightCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATRightCap.imageset/SafariIWATRightCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATRightCap.imageset/SafariIWATRightCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATRightCap.imageset/SafariIWATRightCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWATRightCap.imageset/SafariIWATRightCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWAddTabButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWAddTabButton.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWAddTabButton.imageset/SafariIWAddTabButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWAddTabButton.imageset/SafariIWAddTabButton.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWBG.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWBG.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWBG.imageset/SafariIWBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWBG.imageset/SafariIWBG.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClose.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWITClose.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWITClose@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClose.imageset/SafariIWITClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClose.imageset/SafariIWITClose.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClose.imageset/SafariIWITClose@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClose.imageset/SafariIWITClose@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClosePressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWITClosePressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWITClosePressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClosePressed.imageset/SafariIWITClosePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClosePressed.imageset/SafariIWITClosePressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClosePressed.imageset/SafariIWITClosePressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITClosePressed.imageset/SafariIWITClosePressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITCloseRollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWITCloseRollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWITCloseRollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITCloseRollover.imageset/SafariIWITCloseRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITCloseRollover.imageset/SafariIWITCloseRollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITCloseRollover.imageset/SafariIWITCloseRollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITCloseRollover.imageset/SafariIWITCloseRollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITLeftCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWITLeftCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWITLeftCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITLeftCap.imageset/SafariIWITLeftCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITLeftCap.imageset/SafariIWITLeftCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITLeftCap.imageset/SafariIWITLeftCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITLeftCap.imageset/SafariIWITLeftCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITRightCap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "SafariIWITRightCap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "SafariIWITRightCap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITRightCap.imageset/SafariIWITRightCap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITRightCap.imageset/SafariIWITRightCap.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITRightCap.imageset/SafariIWITRightCap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/Safari.xcassets/SafariIWITRightCap.imageset/SafariIWITRightCap@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Images/YosemiteTabNewPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Images/YosemiteTabNewPressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Images/YosemiteTabNewPressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Images/YosemiteTabNewPressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/MMYosemiteTabStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMYosemiteTabStyle.h 3 | // -------------------- 4 | // 5 | // Based on MMUnifiedTabStyle.h by Keith Blount 6 | // Created by Ajin Man Tuladhar on 04/11/2014. 7 | // Some clean up and adjustment by Michael Monscheuer on 03/16/2016 8 | // Copyright 2016 Ajin Man Tuladhar. All rights reserved. 9 | // 10 | 11 | #if __has_feature(modules) 12 | @import Cocoa; 13 | #else 14 | #import 15 | #endif 16 | #import "MMTabStyle.h" 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | @interface MMYosemiteTabStyle : NSObject 21 | 22 | @property (assign) CGFloat leftMarginForTabBarView; 23 | 24 | @property (assign) BOOL hasBaseline; 25 | 26 | @property (retain) NSColor *selectedTabColor; 27 | @property (retain) NSColor *unselectedTabColor; 28 | 29 | @property (assign) BOOL needsResizeTabsToFitTotalWidth; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "YosemiteTabClose_Front.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "YosemiteTabClose_Front@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front.imageset/YosemiteTabClose_Front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front.imageset/YosemiteTabClose_Front.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front.imageset/YosemiteTabClose_Front@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front.imageset/YosemiteTabClose_Front@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "YosemiteTabClose_Front_Pressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "YosemiteTabClose_Front_Pressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Pressed.imageset/YosemiteTabClose_Front_Pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Pressed.imageset/YosemiteTabClose_Front_Pressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Pressed.imageset/YosemiteTabClose_Front_Pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Pressed.imageset/YosemiteTabClose_Front_Pressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Rollover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "YosemiteTabClose_Front_Rollover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "YosemiteTabClose_Front_Rollover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Rollover.imageset/YosemiteTabClose_Front_Rollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Rollover.imageset/YosemiteTabClose_Front_Rollover.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Rollover.imageset/YosemiteTabClose_Front_Rollover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabClose_Front_Rollover.imageset/YosemiteTabClose_Front_Rollover@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNew.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "YosemiteTabNew.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "YosemiteTabNew@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNew.imageset/YosemiteTabNew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNew.imageset/YosemiteTabNew.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNew.imageset/YosemiteTabNew@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNew.imageset/YosemiteTabNew@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNewPressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "YosemiteTabNewPressed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "YosemiteTabNewPressed@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNewPressed.imageset/YosemiteTabNewPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNewPressed.imageset/YosemiteTabNewPressed.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNewPressed.imageset/YosemiteTabNewPressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/MMTabBarView/MMTabBarView/Styles/Yosemite Tab Style/Yosemite.xcassets/YosemiteTabNewPressed.imageset/YosemiteTabNewPressed@2x.png -------------------------------------------------------------------------------- /MMTabBarView/MMTabBarView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OriginalGraphics/AquaTabNew.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/OriginalGraphics/AquaTabNew.psd -------------------------------------------------------------------------------- /OriginalGraphics/AquaTabNewPressed.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/OriginalGraphics/AquaTabNewPressed.psd -------------------------------------------------------------------------------- /OriginalGraphics/AquaTabNewRollover.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiMo42/MMTabBarView/f7865412364c1dd744992b1f2176925b5186311c/OriginalGraphics/AquaTabNewRollover.psd -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MMTabBarView 2 | ============ 3 | 4 | A Mac OS X tab bar view that works on 10.10+ with Xcode 9.3 or higher.
5 | MMTabBarView is a modernized and view based re-write of PSMTabBarControl,
6 | which can be found here: https://github.com/dorianj/PSMTabBarControl
7 | Though MMTabBarView's API is quite similar, it is no drop-in replacement for PSMTabBarControl. 8 | The MMTabBarViewDelegate protocol is somewhat different. 9 | But MMTabBarView will help you: The methods of the delegate protocol of PSMTabBarControl have been 10 | included and set to deprecated. That means your compiler shows deprecation warnings (if switched on) for 11 | all your old delegate method implementations. Transition will be a matter of minutes. 12 | 13 | If you want to support this project, there are various ways in which you could do this:
14 | 15 |
    16 |
  • Send me a pull request.
  • 17 |
  • Review it on your site or blog.
  • 18 |
  • Make a donation via PayPal following the link below (credit cards etc. accepted too).
  • 19 |
20 | 21 | Donating via PayPal is as easy as clicking the donate button on this page: 22 | http://mimo42.github.com/MMTabBarView/ 23 | 24 | If you make any improvements, please submit them as pull requests. 25 | 26 | ## Building 27 | 28 | To, build, simply open default.xcworkspace, choose MMTabBarView Demo scheme and run. 29 | The workspace contains two projects, the MMTabBarView framework and the Demo application. 30 | 31 | ## Installing 32 | Add the .framework bundle to your Xcode project, and add it to the Linked Frameworks and Libraries (under Target -> Summary). Next, under Target -> Build Phases, Add a new build phase that copies it to the Frameworks directory of your app. (Add Build Phase > Copy Files. Destination: Frameworks).
33 | Do not forget to set LD_RUNPATH_SEARCH_PATHS to @loader_path/../Frameworks in your Xcode project. 34 | 35 | ## Copying 36 | Some components and lines originally were created by Positive Spin Media. The original is BSD licensed.
37 | See: http://www.positivespinmedia.com/dev/PSMTabBarControl.html License
38 | The re-write is also BSD licensed.
39 | Since 2005 there have been lots of commits by various contributors.
40 | Thanks to the guys recently improved PSMTabBarControl and inspired me to finally do the re-write! 41 | 42 | ## License 43 | Copyright © 2005, Positive Spin Media. All rights reserved.
44 | Copyright © 2018, Michael Monscheuer. All rights reserved.
45 | 46 |
47 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 48 | 49 |
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
50 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
51 | * Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
52 | 
53 | 54 |

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

55 | -------------------------------------------------------------------------------- /default.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 27 | 28 | 30 | 31 | 33 | 34 | 35 | 38 | 40 | 41 | 43 | 44 | 46 | 47 | 48 | 50 | 51 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /default.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /default.xcworkspace/xcshareddata/default.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | EB8E041C-83CE-46A2-B595-E3A259F5BC6F 9 | IDESourceControlProjectName 10 | default 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | B28F34E93FF7C34A6E2F490D54CBCF67304F4394 14 | https://github.com/MiMo42/MMTabBarView.git 15 | 16 | IDESourceControlProjectPath 17 | default.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | B28F34E93FF7C34A6E2F490D54CBCF67304F4394 21 | .. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/MiMo42/MMTabBarView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | B28F34E93FF7C34A6E2F490D54CBCF67304F4394 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | B28F34E93FF7C34A6E2F490D54CBCF67304F4394 36 | IDESourceControlWCCName 37 | MMTabBarView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /default.xcworkspace/xcshareddata/xcschemes/MMTabBarView Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /default.xcworkspace/xcshareddata/xcschemes/MMTabBarView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | --------------------------------------------------------------------------------