├── .gitignore ├── ITSidebar.png ├── ITSidebar.xcodeproj └── project.pbxproj ├── ITSidebar ├── ITAppDelegate.h ├── ITAppDelegate.m ├── ITLeakWarningHelper.h ├── ITSidebar-Info.plist ├── ITSidebar-Prefix.pch ├── ITSidebar.h ├── ITSidebar.m ├── ITSidebarItemCell.h ├── ITSidebarItemCell.m ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib ├── main.m ├── push-pushed.png ├── push-pushed@2x.png ├── push.png ├── push@2x.png ├── star-pushed.png ├── star-pushed@2x.png ├── star.png ├── star@2x.png ├── tag-pushed.png ├── tag-pushed@2x.png ├── tag.png ├── tag@2x.png ├── trash-pushed.png ├── trash-pushed@2x.png ├── trash.png ├── trash@2x.png ├── watch-pushed.png ├── watch-pushed@2x.png ├── watch.png └── watch@2x.png ├── README.md └── images ├── export ├── push-pushed.png ├── push-pushed@2x.png ├── push.png ├── push@2x.png ├── star-pushed.png ├── star-pushed@2x.png ├── star.png ├── star@2x.png ├── tag-pushed.png ├── tag-pushed@2x.png ├── tag.png ├── tag@2x.png ├── trash-pushed.png ├── trash-pushed@2x.png ├── trash.png ├── trash@2x.png ├── watch-pushed.png ├── watch-pushed@2x.png ├── watch.png └── watch@2x.png └── sidebar-icons.psd /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /ITSidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar.png -------------------------------------------------------------------------------- /ITSidebar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9106D56C16D7746100EE6CE0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9106D56B16D7746100EE6CE0 /* Cocoa.framework */; }; 11 | 9106D57616D7746100EE6CE0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9106D57416D7746100EE6CE0 /* InfoPlist.strings */; }; 12 | 9106D57816D7746100EE6CE0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9106D57716D7746100EE6CE0 /* main.m */; }; 13 | 9106D57C16D7746100EE6CE0 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 9106D57A16D7746100EE6CE0 /* Credits.rtf */; }; 14 | 9106D57F16D7746100EE6CE0 /* ITAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9106D57E16D7746100EE6CE0 /* ITAppDelegate.m */; }; 15 | 9106D58216D7746100EE6CE0 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9106D58016D7746100EE6CE0 /* MainMenu.xib */; }; 16 | 9106D58A16D7748F00EE6CE0 /* ITSidebar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9106D58916D7748F00EE6CE0 /* ITSidebar.m */; }; 17 | 9106D58D16D7786000EE6CE0 /* ITSidebarItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9106D58C16D7786000EE6CE0 /* ITSidebarItemCell.m */; }; 18 | 9137022116D9369600E18796 /* push-pushed.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137020D16D9369600E18796 /* push-pushed.png */; }; 19 | 9137022216D9369600E18796 /* push-pushed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137020E16D9369600E18796 /* push-pushed@2x.png */; }; 20 | 9137022316D9369600E18796 /* push.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137020F16D9369600E18796 /* push.png */; }; 21 | 9137022416D9369600E18796 /* push@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021016D9369600E18796 /* push@2x.png */; }; 22 | 9137022516D9369600E18796 /* star-pushed.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021116D9369600E18796 /* star-pushed.png */; }; 23 | 9137022616D9369600E18796 /* star-pushed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021216D9369600E18796 /* star-pushed@2x.png */; }; 24 | 9137022716D9369600E18796 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021316D9369600E18796 /* star.png */; }; 25 | 9137022816D9369600E18796 /* star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021416D9369600E18796 /* star@2x.png */; }; 26 | 9137022916D9369600E18796 /* tag-pushed.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021516D9369600E18796 /* tag-pushed.png */; }; 27 | 9137022A16D9369600E18796 /* tag-pushed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021616D9369600E18796 /* tag-pushed@2x.png */; }; 28 | 9137022B16D9369600E18796 /* tag.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021716D9369600E18796 /* tag.png */; }; 29 | 9137022C16D9369600E18796 /* tag@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021816D9369600E18796 /* tag@2x.png */; }; 30 | 9137022D16D9369600E18796 /* trash-pushed.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021916D9369600E18796 /* trash-pushed.png */; }; 31 | 9137022E16D9369600E18796 /* trash-pushed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021A16D9369600E18796 /* trash-pushed@2x.png */; }; 32 | 9137022F16D9369600E18796 /* trash.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021B16D9369600E18796 /* trash.png */; }; 33 | 9137023016D9369600E18796 /* trash@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021C16D9369600E18796 /* trash@2x.png */; }; 34 | 9137023116D9369600E18796 /* watch-pushed.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021D16D9369600E18796 /* watch-pushed.png */; }; 35 | 9137023216D9369600E18796 /* watch-pushed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021E16D9369600E18796 /* watch-pushed@2x.png */; }; 36 | 9137023316D9369600E18796 /* watch.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137021F16D9369600E18796 /* watch.png */; }; 37 | 9137023416D9369600E18796 /* watch@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9137022016D9369600E18796 /* watch@2x.png */; }; 38 | /* End PBXBuildFile section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 9106D56816D7746100EE6CE0 /* ITSidebar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ITSidebar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 9106D56B16D7746100EE6CE0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 43 | 9106D56E16D7746100EE6CE0 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 44 | 9106D56F16D7746100EE6CE0 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 45 | 9106D57016D7746100EE6CE0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 46 | 9106D57316D7746100EE6CE0 /* ITSidebar-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ITSidebar-Info.plist"; sourceTree = ""; }; 47 | 9106D57516D7746100EE6CE0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 48 | 9106D57716D7746100EE6CE0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 9106D57916D7746100EE6CE0 /* ITSidebar-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ITSidebar-Prefix.pch"; sourceTree = ""; }; 50 | 9106D57B16D7746100EE6CE0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 51 | 9106D57D16D7746100EE6CE0 /* ITAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ITAppDelegate.h; sourceTree = ""; }; 52 | 9106D57E16D7746100EE6CE0 /* ITAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ITAppDelegate.m; sourceTree = ""; }; 53 | 9106D58116D7746100EE6CE0 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 54 | 9106D58816D7748F00EE6CE0 /* ITSidebar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITSidebar.h; sourceTree = ""; }; 55 | 9106D58916D7748F00EE6CE0 /* ITSidebar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ITSidebar.m; sourceTree = ""; }; 56 | 9106D58B16D7786000EE6CE0 /* ITSidebarItemCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITSidebarItemCell.h; sourceTree = ""; }; 57 | 9106D58C16D7786000EE6CE0 /* ITSidebarItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ITSidebarItemCell.m; sourceTree = ""; }; 58 | 9137020D16D9369600E18796 /* push-pushed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "push-pushed.png"; sourceTree = ""; }; 59 | 9137020E16D9369600E18796 /* push-pushed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "push-pushed@2x.png"; sourceTree = ""; }; 60 | 9137020F16D9369600E18796 /* push.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = push.png; sourceTree = ""; }; 61 | 9137021016D9369600E18796 /* push@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "push@2x.png"; sourceTree = ""; }; 62 | 9137021116D9369600E18796 /* star-pushed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "star-pushed.png"; sourceTree = ""; }; 63 | 9137021216D9369600E18796 /* star-pushed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "star-pushed@2x.png"; sourceTree = ""; }; 64 | 9137021316D9369600E18796 /* star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star.png; sourceTree = ""; }; 65 | 9137021416D9369600E18796 /* star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "star@2x.png"; sourceTree = ""; }; 66 | 9137021516D9369600E18796 /* tag-pushed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tag-pushed.png"; sourceTree = ""; }; 67 | 9137021616D9369600E18796 /* tag-pushed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tag-pushed@2x.png"; sourceTree = ""; }; 68 | 9137021716D9369600E18796 /* tag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tag.png; sourceTree = ""; }; 69 | 9137021816D9369600E18796 /* tag@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tag@2x.png"; sourceTree = ""; }; 70 | 9137021916D9369600E18796 /* trash-pushed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "trash-pushed.png"; sourceTree = ""; }; 71 | 9137021A16D9369600E18796 /* trash-pushed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "trash-pushed@2x.png"; sourceTree = ""; }; 72 | 9137021B16D9369600E18796 /* trash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = trash.png; sourceTree = ""; }; 73 | 9137021C16D9369600E18796 /* trash@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "trash@2x.png"; sourceTree = ""; }; 74 | 9137021D16D9369600E18796 /* watch-pushed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "watch-pushed.png"; sourceTree = ""; }; 75 | 9137021E16D9369600E18796 /* watch-pushed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "watch-pushed@2x.png"; sourceTree = ""; }; 76 | 9137021F16D9369600E18796 /* watch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = watch.png; sourceTree = ""; }; 77 | 9137022016D9369600E18796 /* watch@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "watch@2x.png"; sourceTree = ""; }; 78 | 91B97A5B16D90A3600FAC09F /* ITLeakWarningHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITLeakWarningHelper.h; sourceTree = ""; }; 79 | /* End PBXFileReference section */ 80 | 81 | /* Begin PBXFrameworksBuildPhase section */ 82 | 9106D56516D7746100EE6CE0 /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | 9106D56C16D7746100EE6CE0 /* Cocoa.framework in Frameworks */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 9106D55F16D7746100EE6CE0 = { 94 | isa = PBXGroup; 95 | children = ( 96 | 9106D57116D7746100EE6CE0 /* ITSidebar */, 97 | 9106D56A16D7746100EE6CE0 /* Frameworks */, 98 | 9106D56916D7746100EE6CE0 /* Products */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | 9106D56916D7746100EE6CE0 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 9106D56816D7746100EE6CE0 /* ITSidebar.app */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | 9106D56A16D7746100EE6CE0 /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 9106D56B16D7746100EE6CE0 /* Cocoa.framework */, 114 | 9106D56D16D7746100EE6CE0 /* Other Frameworks */, 115 | ); 116 | name = Frameworks; 117 | sourceTree = ""; 118 | }; 119 | 9106D56D16D7746100EE6CE0 /* Other Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 9106D56E16D7746100EE6CE0 /* AppKit.framework */, 123 | 9106D56F16D7746100EE6CE0 /* CoreData.framework */, 124 | 9106D57016D7746100EE6CE0 /* Foundation.framework */, 125 | ); 126 | name = "Other Frameworks"; 127 | sourceTree = ""; 128 | }; 129 | 9106D57116D7746100EE6CE0 /* ITSidebar */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 9106D57D16D7746100EE6CE0 /* ITAppDelegate.h */, 133 | 9106D57E16D7746100EE6CE0 /* ITAppDelegate.m */, 134 | 9106D58016D7746100EE6CE0 /* MainMenu.xib */, 135 | 91B97A5C16D90AC400FAC09F /* ITSidebar */, 136 | 91B97A5D16D90ACE00FAC09F /* Helpers */, 137 | 9106D57216D7746100EE6CE0 /* Supporting Files */, 138 | ); 139 | path = ITSidebar; 140 | sourceTree = ""; 141 | }; 142 | 9106D57216D7746100EE6CE0 /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 9106D57316D7746100EE6CE0 /* ITSidebar-Info.plist */, 146 | 9106D57416D7746100EE6CE0 /* InfoPlist.strings */, 147 | 9106D57716D7746100EE6CE0 /* main.m */, 148 | 9106D57916D7746100EE6CE0 /* ITSidebar-Prefix.pch */, 149 | 9106D57A16D7746100EE6CE0 /* Credits.rtf */, 150 | ); 151 | name = "Supporting Files"; 152 | sourceTree = ""; 153 | }; 154 | 912AAE0B16D8252A00F9B32F /* images */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 9137020D16D9369600E18796 /* push-pushed.png */, 158 | 9137020E16D9369600E18796 /* push-pushed@2x.png */, 159 | 9137020F16D9369600E18796 /* push.png */, 160 | 9137021016D9369600E18796 /* push@2x.png */, 161 | 9137021116D9369600E18796 /* star-pushed.png */, 162 | 9137021216D9369600E18796 /* star-pushed@2x.png */, 163 | 9137021316D9369600E18796 /* star.png */, 164 | 9137021416D9369600E18796 /* star@2x.png */, 165 | 9137021516D9369600E18796 /* tag-pushed.png */, 166 | 9137021616D9369600E18796 /* tag-pushed@2x.png */, 167 | 9137021716D9369600E18796 /* tag.png */, 168 | 9137021816D9369600E18796 /* tag@2x.png */, 169 | 9137021916D9369600E18796 /* trash-pushed.png */, 170 | 9137021A16D9369600E18796 /* trash-pushed@2x.png */, 171 | 9137021B16D9369600E18796 /* trash.png */, 172 | 9137021C16D9369600E18796 /* trash@2x.png */, 173 | 9137021D16D9369600E18796 /* watch-pushed.png */, 174 | 9137021E16D9369600E18796 /* watch-pushed@2x.png */, 175 | 9137021F16D9369600E18796 /* watch.png */, 176 | 9137022016D9369600E18796 /* watch@2x.png */, 177 | ); 178 | name = images; 179 | sourceTree = ""; 180 | }; 181 | 91B97A5C16D90AC400FAC09F /* ITSidebar */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 912AAE0B16D8252A00F9B32F /* images */, 185 | 9106D58816D7748F00EE6CE0 /* ITSidebar.h */, 186 | 9106D58916D7748F00EE6CE0 /* ITSidebar.m */, 187 | 9106D58B16D7786000EE6CE0 /* ITSidebarItemCell.h */, 188 | 9106D58C16D7786000EE6CE0 /* ITSidebarItemCell.m */, 189 | ); 190 | name = ITSidebar; 191 | sourceTree = ""; 192 | }; 193 | 91B97A5D16D90ACE00FAC09F /* Helpers */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 91B97A5B16D90A3600FAC09F /* ITLeakWarningHelper.h */, 197 | ); 198 | name = Helpers; 199 | sourceTree = ""; 200 | }; 201 | /* End PBXGroup section */ 202 | 203 | /* Begin PBXNativeTarget section */ 204 | 9106D56716D7746100EE6CE0 /* ITSidebar */ = { 205 | isa = PBXNativeTarget; 206 | buildConfigurationList = 9106D58516D7746100EE6CE0 /* Build configuration list for PBXNativeTarget "ITSidebar" */; 207 | buildPhases = ( 208 | 9106D56416D7746100EE6CE0 /* Sources */, 209 | 9106D56516D7746100EE6CE0 /* Frameworks */, 210 | 9106D56616D7746100EE6CE0 /* Resources */, 211 | ); 212 | buildRules = ( 213 | ); 214 | dependencies = ( 215 | ); 216 | name = ITSidebar; 217 | productName = ITSidebar; 218 | productReference = 9106D56816D7746100EE6CE0 /* ITSidebar.app */; 219 | productType = "com.apple.product-type.application"; 220 | }; 221 | /* End PBXNativeTarget section */ 222 | 223 | /* Begin PBXProject section */ 224 | 9106D56016D7746100EE6CE0 /* Project object */ = { 225 | isa = PBXProject; 226 | attributes = { 227 | CLASSPREFIX = IT; 228 | LastUpgradeCheck = 0500; 229 | ORGANIZATIONNAME = "Ilija Tovilo"; 230 | }; 231 | buildConfigurationList = 9106D56316D7746100EE6CE0 /* Build configuration list for PBXProject "ITSidebar" */; 232 | compatibilityVersion = "Xcode 3.2"; 233 | developmentRegion = English; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | ); 238 | mainGroup = 9106D55F16D7746100EE6CE0; 239 | productRefGroup = 9106D56916D7746100EE6CE0 /* Products */; 240 | projectDirPath = ""; 241 | projectRoot = ""; 242 | targets = ( 243 | 9106D56716D7746100EE6CE0 /* ITSidebar */, 244 | ); 245 | }; 246 | /* End PBXProject section */ 247 | 248 | /* Begin PBXResourcesBuildPhase section */ 249 | 9106D56616D7746100EE6CE0 /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | 9106D57616D7746100EE6CE0 /* InfoPlist.strings in Resources */, 254 | 9106D57C16D7746100EE6CE0 /* Credits.rtf in Resources */, 255 | 9106D58216D7746100EE6CE0 /* MainMenu.xib in Resources */, 256 | 9137022116D9369600E18796 /* push-pushed.png in Resources */, 257 | 9137022216D9369600E18796 /* push-pushed@2x.png in Resources */, 258 | 9137022316D9369600E18796 /* push.png in Resources */, 259 | 9137022416D9369600E18796 /* push@2x.png in Resources */, 260 | 9137022516D9369600E18796 /* star-pushed.png in Resources */, 261 | 9137022616D9369600E18796 /* star-pushed@2x.png in Resources */, 262 | 9137022716D9369600E18796 /* star.png in Resources */, 263 | 9137022816D9369600E18796 /* star@2x.png in Resources */, 264 | 9137022916D9369600E18796 /* tag-pushed.png in Resources */, 265 | 9137022A16D9369600E18796 /* tag-pushed@2x.png in Resources */, 266 | 9137022B16D9369600E18796 /* tag.png in Resources */, 267 | 9137022C16D9369600E18796 /* tag@2x.png in Resources */, 268 | 9137022D16D9369600E18796 /* trash-pushed.png in Resources */, 269 | 9137022E16D9369600E18796 /* trash-pushed@2x.png in Resources */, 270 | 9137022F16D9369600E18796 /* trash.png in Resources */, 271 | 9137023016D9369600E18796 /* trash@2x.png in Resources */, 272 | 9137023116D9369600E18796 /* watch-pushed.png in Resources */, 273 | 9137023216D9369600E18796 /* watch-pushed@2x.png in Resources */, 274 | 9137023316D9369600E18796 /* watch.png in Resources */, 275 | 9137023416D9369600E18796 /* watch@2x.png in Resources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXResourcesBuildPhase section */ 280 | 281 | /* Begin PBXSourcesBuildPhase section */ 282 | 9106D56416D7746100EE6CE0 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 9106D57816D7746100EE6CE0 /* main.m in Sources */, 287 | 9106D57F16D7746100EE6CE0 /* ITAppDelegate.m in Sources */, 288 | 9106D58A16D7748F00EE6CE0 /* ITSidebar.m in Sources */, 289 | 9106D58D16D7786000EE6CE0 /* ITSidebarItemCell.m in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXSourcesBuildPhase section */ 294 | 295 | /* Begin PBXVariantGroup section */ 296 | 9106D57416D7746100EE6CE0 /* InfoPlist.strings */ = { 297 | isa = PBXVariantGroup; 298 | children = ( 299 | 9106D57516D7746100EE6CE0 /* en */, 300 | ); 301 | name = InfoPlist.strings; 302 | sourceTree = ""; 303 | }; 304 | 9106D57A16D7746100EE6CE0 /* Credits.rtf */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 9106D57B16D7746100EE6CE0 /* en */, 308 | ); 309 | name = Credits.rtf; 310 | sourceTree = ""; 311 | }; 312 | 9106D58016D7746100EE6CE0 /* MainMenu.xib */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 9106D58116D7746100EE6CE0 /* en */, 316 | ); 317 | name = MainMenu.xib; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 9106D58316D7746100EE6CE0 /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_CONSTANT_CONVERSION = YES; 331 | CLANG_WARN_EMPTY_BODY = YES; 332 | CLANG_WARN_ENUM_CONVERSION = YES; 333 | CLANG_WARN_INT_CONVERSION = YES; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | COPY_PHASE_STRIP = NO; 336 | GCC_C_LANGUAGE_STANDARD = gnu99; 337 | GCC_DYNAMIC_NO_PIC = NO; 338 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 339 | GCC_OPTIMIZATION_LEVEL = 0; 340 | GCC_PREPROCESSOR_DEFINITIONS = ( 341 | "DEBUG=1", 342 | "$(inherited)", 343 | ); 344 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 345 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 346 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 347 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | MACOSX_DEPLOYMENT_TARGET = 10.8; 350 | ONLY_ACTIVE_ARCH = YES; 351 | SDKROOT = macosx; 352 | }; 353 | name = Debug; 354 | }; 355 | 9106D58416D7746100EE6CE0 /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ALWAYS_SEARCH_USER_PATHS = NO; 359 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 360 | CLANG_CXX_LIBRARY = "libc++"; 361 | CLANG_ENABLE_OBJC_ARC = YES; 362 | CLANG_WARN_CONSTANT_CONVERSION = YES; 363 | CLANG_WARN_EMPTY_BODY = YES; 364 | CLANG_WARN_ENUM_CONVERSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 367 | COPY_PHASE_STRIP = YES; 368 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 374 | GCC_WARN_UNUSED_VARIABLE = YES; 375 | MACOSX_DEPLOYMENT_TARGET = 10.8; 376 | SDKROOT = macosx; 377 | }; 378 | name = Release; 379 | }; 380 | 9106D58616D7746100EE6CE0 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | COMBINE_HIDPI_IMAGES = YES; 384 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 385 | GCC_PREFIX_HEADER = "ITSidebar/ITSidebar-Prefix.pch"; 386 | INFOPLIST_FILE = "ITSidebar/ITSidebar-Info.plist"; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | WRAPPER_EXTENSION = app; 389 | }; 390 | name = Debug; 391 | }; 392 | 9106D58716D7746100EE6CE0 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | COMBINE_HIDPI_IMAGES = YES; 396 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 397 | GCC_PREFIX_HEADER = "ITSidebar/ITSidebar-Prefix.pch"; 398 | INFOPLIST_FILE = "ITSidebar/ITSidebar-Info.plist"; 399 | PRODUCT_NAME = "$(TARGET_NAME)"; 400 | WRAPPER_EXTENSION = app; 401 | }; 402 | name = Release; 403 | }; 404 | /* End XCBuildConfiguration section */ 405 | 406 | /* Begin XCConfigurationList section */ 407 | 9106D56316D7746100EE6CE0 /* Build configuration list for PBXProject "ITSidebar" */ = { 408 | isa = XCConfigurationList; 409 | buildConfigurations = ( 410 | 9106D58316D7746100EE6CE0 /* Debug */, 411 | 9106D58416D7746100EE6CE0 /* Release */, 412 | ); 413 | defaultConfigurationIsVisible = 0; 414 | defaultConfigurationName = Release; 415 | }; 416 | 9106D58516D7746100EE6CE0 /* Build configuration list for PBXNativeTarget "ITSidebar" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | 9106D58616D7746100EE6CE0 /* Debug */, 420 | 9106D58716D7746100EE6CE0 /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | /* End XCConfigurationList section */ 426 | }; 427 | rootObject = 9106D56016D7746100EE6CE0 /* Project object */; 428 | } 429 | -------------------------------------------------------------------------------- /ITSidebar/ITAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | #import 29 | 30 | @class ITSidebar; 31 | 32 | @interface ITAppDelegate : NSObject 33 | 34 | @property (assign) IBOutlet NSWindow *window; 35 | @property (weak) IBOutlet ITSidebar *sidebar; 36 | @property (weak) IBOutlet NSTextField *label; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ITSidebar/ITAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | // 29 | // ITAppDelegate.m 30 | // ITSidebar 31 | // 32 | // Created by Ilija Tovilo on 2/22/13. 33 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 34 | // 35 | 36 | #import "ITAppDelegate.h" 37 | #import "ITSidebar.h" 38 | #import "ITSidebarItemCell.h" 39 | 40 | @implementation ITAppDelegate 41 | 42 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 43 | { 44 | // Method 1 - Brdiged NSMatrix Target Action 45 | // This has the advantage of detecting an empty selection 46 | { 47 | /* 48 | [self.sidebar setTarget:self]; 49 | [self.sidebar setAction:@selector(sidebarChanged:)]; 50 | 51 | NSArray *items = @[ @"star", 52 | @"watch", 53 | @"tag", 54 | @"trash", 55 | @"push"]; 56 | 57 | [items enumerateObjectsUsingBlock:^(NSString *image, NSUInteger idx, BOOL *stop) { 58 | ITSidebarItemCell *cell = [self.sidebar addItemWithImage:[NSImage imageNamed:[image stringByAppendingString:@"-pushed"]] alternateImage:[NSImage imageNamed:image]]; 59 | [cell setTag:idx + 1]; 60 | }]; 61 | */ 62 | } 63 | 64 | 65 | // Method 2 - NSButtonCell Target Action 66 | { 67 | [self.sidebar addItemWithImage:[NSImage imageNamed:@"star-pushed"] alternateImage:[NSImage imageNamed:@"star"] target:self action:@selector(starClicked:)]; 68 | [self.sidebar addItemWithImage:[NSImage imageNamed:@"watch-pushed"] alternateImage:[NSImage imageNamed:@"watch"] target:self action:@selector(watchClicked:)]; 69 | [self.sidebar addItemWithImage:[NSImage imageNamed:@"tag-pushed"] alternateImage:[NSImage imageNamed:@"tag"] target:self action:@selector(tagClicked:)]; 70 | [self.sidebar addItemWithImage:[NSImage imageNamed:@"trash-pushed"] alternateImage:[NSImage imageNamed:@"trash"] target:self action:@selector(trashClicked:)]; 71 | [self.sidebar addItemWithImage:[NSImage imageNamed:@"push-pushed"] alternateImage:[NSImage imageNamed:@"push"] target:self action:@selector(pushClicked:)]; 72 | 73 | // Because this mehthod does not support empty selection, we obviously disable it. 74 | // Note to set the allowsEmptySelection AFTER adding the items, because else it won't be able to select the first item 75 | self.sidebar.allowsEmptySelection = NO; 76 | } 77 | 78 | // You CAN technically mix method 1 and 2, I just recommend some serious debugging. 79 | } 80 | 81 | // ****************************************** We can use 82 | // NSMatrix Target Action 83 | - (IBAction)sidebarChanged:(ITSidebar *)sender { 84 | NSLog(@"%@: %lu", [sender selectedItem], (unsigned long)[sender selectedIndex]); 85 | [self.label setStringValue:[NSString stringWithFormat:@"%lu", (unsigned long)[sender selectedIndex]]]; 86 | } 87 | 88 | // ****************************************** OOOOOOOR 89 | // NSButtonCell Target Action 90 | - (IBAction)starClicked:(id)sender { 91 | [self.label setStringValue:@"Star"]; 92 | } 93 | - (IBAction)watchClicked:(id)sender { 94 | [self.label setStringValue:@"Watch"]; 95 | } 96 | - (IBAction)tagClicked:(id)sender { 97 | [self.label setStringValue:@"Tag"]; 98 | } 99 | - (IBAction)trashClicked:(id)sender { 100 | [self.label setStringValue:@"Trash"]; 101 | } 102 | - (IBAction)pushClicked:(id)sender { 103 | [self.label setStringValue:@"Push"]; 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /ITSidebar/ITLeakWarningHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | // 29 | // ITLeachWarningHelper.h 30 | // iTunes Read Test 31 | // 32 | // Created by Ilija Tovilo on 2/19/13. 33 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 34 | // 35 | 36 | #ifndef iTunes_Read_Test_ITLeakWarningHelper_h 37 | #define iTunes_Read_Test_ITLeakWarningHelper_h 38 | 39 | // This awesome method was found at Stackoverflow 40 | // From Rob Mayoff - http://stackoverflow.com/users/77567/rob-mayoff 41 | // Initial Solution by Scott Thompson - http://stackoverflow.com/users/415303/scott-thompson 42 | // http://stackoverflow.com/a/7933931/1320374 43 | 44 | #define SuppressPerformSelectorLeakWarning(Stuff) \ 45 | do { \ 46 | _Pragma("clang diagnostic push") \ 47 | _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \ 48 | Stuff; \ 49 | _Pragma("clang diagnostic pop") \ 50 | } while (0) 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /ITSidebar/ITSidebar-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | ch.ilijatovilo.${PRODUCT_NAME:rfc1034identifier} 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 © 2013 Ilija Tovilo. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /ITSidebar/ITSidebar-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ITSidebar' target in the 'ITSidebar' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /ITSidebar/ITSidebar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | // 29 | // ITSidebar.h 30 | // ITSidebar 31 | // 32 | // Created by Ilija Tovilo on 2/22/13. 33 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 34 | // 35 | 36 | #import 37 | @class ITSidebarItemCell; 38 | 39 | @interface ITSidebar : NSView 40 | @property (strong) NSMatrix *matrix; 41 | 42 | @property (strong, nonatomic) id target; 43 | @property (nonatomic) SEL action; 44 | 45 | // Customisation 46 | @property (nonatomic) NSSize cellSize; 47 | @property (nonatomic) NSColor *backgroundColor; 48 | @property (nonatomic) NSScrollerKnobStyle scrollerKnobStyle; 49 | @property (nonatomic) ITSidebarItemCell *selectedItem; 50 | @property (nonatomic) NSUInteger selectedIndex; 51 | @property (nonatomic) BOOL allowsEmptySelection; 52 | 53 | + (Class)sidebarItemCellClass; 54 | 55 | // Add/Remove Cells 56 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image target:(id)target action:(SEL)action; 57 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage target:(id)target action:(SEL)action; 58 | 59 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image; 60 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage; 61 | 62 | - (void)removeRow:(NSInteger)row; 63 | 64 | // Select Cells 65 | - (void)deselectAllItems; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /ITSidebar/ITSidebar.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | // 29 | // ITSidebar.m 30 | // ITSidebar 31 | // 32 | // Created by Ilija Tovilo on 2/22/13. 33 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 34 | // 35 | 36 | #import "ITSidebar.h" 37 | #import "ITSidebarItemCell.h" 38 | #import "ITLeakWarningHelper.h" 39 | 40 | #define kDefaultBackgroundColor [NSColor colorWithDeviceWhite:0.16 alpha:1.0] 41 | #define kDefaultScrollerKnobStyle NSScrollerKnobStyleLight 42 | #define kDefaultAllowsEmptySelection YES 43 | 44 | @implementation ITSidebar 45 | @synthesize action = _action; 46 | @synthesize target = _target; 47 | 48 | #pragma mark Initialise 49 | - (id)initWithFrame:(NSRect)frame 50 | { 51 | self = [super initWithFrame:frame]; 52 | if (self) { 53 | [self initialise]; 54 | } 55 | 56 | return self; 57 | } 58 | - (void)dealloc 59 | { 60 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 61 | } 62 | - (id)initWithCoder:(NSCoder *)coder 63 | { 64 | self = [super initWithCoder:coder]; 65 | if (self) { 66 | [self initialise]; 67 | } 68 | return self; 69 | } 70 | - (void)awakeFromNib { 71 | [self resizeMatrix]; 72 | [self initialiseScrollView]; 73 | } 74 | - (void)initialise { 75 | [self addMatrix]; 76 | } 77 | - (void)initialiseScrollView { 78 | [[self enclosingScrollView] setDrawsBackground:YES]; 79 | 80 | // Style scroll view 81 | [[self enclosingScrollView] setBorderType:NSNoBorder]; 82 | [self setBackgroundColor:kDefaultBackgroundColor]; 83 | [self setScrollerKnobStyle:kDefaultScrollerKnobStyle]; 84 | 85 | [[self enclosingScrollView] setDrawsBackground:YES]; 86 | 87 | NSClipView *clipView = [[self enclosingScrollView] contentView]; 88 | [clipView setPostsBoundsChangedNotifications:YES]; 89 | [[NSNotificationCenter defaultCenter] addObserver:self 90 | selector:@selector(resizeMatrix) 91 | name:NSViewBoundsDidChangeNotification 92 | object:clipView]; 93 | } 94 | - (void)addMatrix { 95 | self.matrix = [[NSMatrix alloc] initWithFrame:[self frame] 96 | mode:NSRadioModeMatrix 97 | cellClass:[[self.class sidebarItemCellClass] class] 98 | numberOfRows:0 99 | numberOfColumns:1]; 100 | 101 | [self.matrix setAllowsEmptySelection:kDefaultAllowsEmptySelection]; 102 | [self.matrix setCellSize:[[self class] defaultCellSize]]; 103 | 104 | [self resizeMatrix]; 105 | [self addSubview:self.matrix]; 106 | } 107 | #pragma mark Scroll View 108 | - (NSColor *)backgroundColor { 109 | return [[self enclosingScrollView] backgroundColor]; 110 | } 111 | - (void)setBackgroundColor:(NSColor *)backgroundColor { 112 | [[self enclosingScrollView] setBackgroundColor:backgroundColor]; 113 | } 114 | - (NSScrollerKnobStyle)scrollerKnobStyle { 115 | return [[self enclosingScrollView] scrollerKnobStyle]; 116 | } 117 | - (void)setScrollerKnobStyle:(NSScrollerKnobStyle)knobStyle { 118 | [[self enclosingScrollView] setScrollerKnobStyle:knobStyle]; 119 | } 120 | 121 | #pragma mark Key Handling 122 | - (BOOL)acceptsFirstResponder { 123 | return YES; 124 | } 125 | - (void)keyDown:(NSEvent *)theEvent { 126 | // NSLog(@"%d", theEvent.keyCode); 127 | switch (theEvent.keyCode) { 128 | case 126: // Up 129 | { 130 | [self selectPreviousItem]; 131 | } 132 | break; 133 | case 125: // Down 134 | { 135 | [self selectNextItem]; 136 | } 137 | break; 138 | case 53: // Down 139 | { 140 | [self deselectAllItems]; 141 | } 142 | break; 143 | default: 144 | { 145 | [super keyDown:theEvent]; 146 | } 147 | break; 148 | } 149 | } 150 | - (void)deselectAllItems { 151 | [self.matrix deselectSelectedCell]; 152 | 153 | // For some reason the matrix does not call the action like this.. :/ 154 | // So we do it manually 155 | [self matrixCallback:self]; 156 | 157 | } 158 | - (void)selectNextItem { 159 | [self selectNeighbourItemWithValue:1]; 160 | } 161 | 162 | - (void)selectPreviousItem { 163 | [self selectNeighbourItemWithValue:-1]; 164 | } 165 | 166 | - (void)selectNeighbourItemWithValue:(int)value { 167 | self.selectedIndex = self.selectedIndex + value; 168 | } 169 | 170 | #pragma mark Cells 171 | - (ITSidebarItemCell *)selectedItem { 172 | return self.matrix.selectedCell; 173 | } 174 | - (void)setSelectedItem:(ITSidebarItemCell *)selectedItem { 175 | self.selectedIndex = [[self.matrix cells] indexOfObject:selectedItem]; 176 | } 177 | - (NSUInteger)selectedIndex { 178 | ITSidebarItemCell *cell = [self selectedItem]; 179 | return (int)[self.matrix.cells indexOfObject:cell]; 180 | } 181 | - (void)setSelectedIndex:(NSUInteger)index { 182 | if (index < self.matrix.cells.count) { 183 | [self.matrix selectCell:[self.matrix.cells objectAtIndex:index]]; 184 | 185 | // Again, no action 186 | [self matrixCallback:self]; 187 | } 188 | } 189 | + (NSSize)defaultCellSize { 190 | return NSMakeSize(62, 62); 191 | } 192 | - (NSSize)cellSize { 193 | return [self.matrix cellSize]; 194 | } 195 | - (void)setCellSize:(NSSize)cellSize { 196 | [self.matrix setCellSize:cellSize]; 197 | } 198 | - (BOOL)allowsEmptySelection { 199 | return self.matrix.allowsEmptySelection; 200 | } 201 | - (void)setAllowsEmptySelection:(BOOL)allowsEmptySelection { 202 | [self.matrix setAllowsEmptySelection:allowsEmptySelection]; 203 | 204 | // If empty selection is not allowed, we select the first item 205 | if (!allowsEmptySelection && [self selectedIndex] == -1) { 206 | self.selectedIndex = 0; 207 | } 208 | } 209 | 210 | + (Class)sidebarItemCellClass { 211 | return [ITSidebarItemCell class]; 212 | } 213 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image target:(id)target action:(SEL)action { 214 | ITSidebarItemCell *cell = [[[self.class sidebarItemCellClass] alloc] initImageCell:image]; 215 | [cell setTarget:target]; 216 | [cell setAction:action]; 217 | [self addCell:cell]; 218 | 219 | return cell; 220 | } 221 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage target:(id)target action:(SEL)action { 222 | ITSidebarItemCell *cell = [self addItemWithImage:image target:target action:action]; 223 | [cell setAlternateImage:alternateImage]; 224 | 225 | return cell; 226 | } 227 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image { 228 | ITSidebarItemCell *cell = [[[self.class sidebarItemCellClass] alloc] initImageCell:image]; 229 | [self addCell:cell]; 230 | 231 | return cell; 232 | } 233 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage { 234 | ITSidebarItemCell *cell = [self addItemWithImage:image]; 235 | [cell setAlternateImage:alternateImage]; 236 | 237 | return cell; 238 | } 239 | - (void)addCell:(ITSidebarItemCell *)cell { 240 | [self.matrix addRowWithCells:@[ cell ]]; 241 | [self resizeMatrix]; 242 | } 243 | - (void)removeRow:(NSInteger)row { 244 | [self.matrix removeRow:row]; 245 | [self resizeMatrix]; 246 | } 247 | 248 | #pragma mark Resizing 249 | - (void)setFrame:(NSRect)frameRect { 250 | [super setFrame:frameRect]; 251 | [self resizeMatrix]; 252 | } 253 | - (void)resizeMatrix { 254 | [self.matrix sizeToCells]; 255 | 256 | NSRect newSize = self.matrix.frame; 257 | if (NSHeight([[self enclosingScrollView].contentView frame]) > NSHeight(newSize)) { 258 | newSize.size.height = NSHeight([[self enclosingScrollView].contentView frame]); 259 | } 260 | 261 | [self.matrix setFrameSize:newSize.size]; 262 | [self setFrameSize:newSize.size]; 263 | } 264 | 265 | #pragma mark ITSidebar Target Action 266 | - (IBAction)matrixCallback:(id)sender { 267 | if ([self.target respondsToSelector:self.action]) { 268 | // Ideally, NSInvocation needs to be used here but, afterDelay:0 is just as good (for now) :) 269 | [self.target performSelector:self.action withObject:self afterDelay:0]; 270 | } else { 271 | // Ideally, NSInvocation needs to be used here but, afterDelay:0 is just as good (for now) :) 272 | [self.selectedItem.target performSelector:self.selectedItem.action withObject:self.selectedItem afterDelay:0]; 273 | } 274 | } 275 | - (void)setTarget:(id)target { 276 | [self.matrix setTarget:self]; 277 | _target = target; 278 | } 279 | - (void)setAction:(SEL)action { 280 | [self.matrix setAction:@selector(matrixCallback:)]; 281 | _action = action; 282 | } 283 | 284 | @end -------------------------------------------------------------------------------- /ITSidebar/ITSidebarItemCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | // 29 | // ITSidebarCell.h 30 | // ITSidebar 31 | // 32 | // Created by Ilija Tovilo on 2/22/13. 33 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 34 | // 35 | 36 | #import 37 | 38 | @interface ITSidebarItemCell : NSButtonCell 39 | 40 | // Those methods should be overridden in subclasses 41 | - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 42 | - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView; 43 | - (void)drawSelectionWithFrame:(NSRect)frame inView:(NSView *)view; 44 | - (void)drawBackgroundWithFrame:(NSRect)frame inView:(NSView *)view; 45 | 46 | - (NSShadow *)shadow; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /ITSidebar/ITSidebarItemCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 - 2014, Ilija Tovilo 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the organization nor the 13 | // names of its contributors may be used to endorse or promote products 14 | // derived from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | // DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 20 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | // 27 | 28 | // 29 | // ITSidebarCell.m 30 | // ITSidebar 31 | // 32 | // Created by Ilija Tovilo on 2/22/13. 33 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 34 | // 35 | 36 | #import "ITSidebarItemCell.h" 37 | 38 | #define kSelectionCornerRadius 5.0 39 | #define kSelectionWidth 2.0 40 | 41 | #define kSelectionColor [NSColor colorWithCalibratedRed:0.12f green:0.49f blue:0.93f alpha:1.f] 42 | #define kSelectionHighlightColor [NSColor colorWithCalibratedRed:0.12f green:0.49f blue:0.93f alpha:0.7f] 43 | 44 | @implementation ITSidebarItemCell 45 | 46 | - (void)drawImageWithFrame:(NSRect)frame inView:(NSView *)controlView { 47 | NSImage *image; 48 | if ((self.isHighlighted || [self state] == NSOnState) && self.alternateImage) { 49 | image = self.alternateImage; 50 | } else { 51 | image = self.image; 52 | } 53 | [self drawImage:image withFrame:frame inView:controlView]; 54 | } 55 | - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView { 56 | 57 | [NSGraphicsContext saveGraphicsState]; 58 | { 59 | [[self shadow] set]; 60 | 61 | NSRect imgRect = NSInsetRect(frame, ( NSWidth(frame) -[image size].width)/2.0, ( NSHeight(frame) -[image size].height)/2.0); 62 | [image drawInRect:imgRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil]; 63 | } 64 | [NSGraphicsContext restoreGraphicsState]; 65 | } 66 | 67 | - (NSShadow *)shadow { 68 | NSShadow *shadow = [NSShadow new]; 69 | [shadow setShadowOffset:NSMakeSize(0, -1)]; 70 | [shadow setShadowColor:[NSColor blackColor]]; 71 | [shadow setShadowBlurRadius:3.0]; 72 | 73 | return shadow; 74 | } 75 | 76 | - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { 77 | [NSGraphicsContext saveGraphicsState]; 78 | { 79 | [[self shadow] set]; 80 | [[NSColor whiteColor] set]; 81 | 82 | [super drawTitle:self.attributedTitle withFrame:cellFrame inView:controlView]; 83 | [self drawImageWithFrame:cellFrame inView:controlView]; 84 | } 85 | [NSGraphicsContext restoreGraphicsState]; 86 | } 87 | 88 | - (void)drawBackgroundWithFrame:(NSRect)frame inView:(NSView *)view { 89 | // We do nothing for this example here.. 90 | } 91 | 92 | - (void)drawSelectionWithFrame:(NSRect)frame inView:(NSView *)view { 93 | if ([self state] == NSOnState) { 94 | [kSelectionColor set]; 95 | } else { 96 | [kSelectionHighlightColor set]; 97 | } 98 | 99 | NSRect strokeRect = NSInsetRect(frame, 10, 10); 100 | NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:strokeRect xRadius:kSelectionCornerRadius yRadius:kSelectionCornerRadius]; 101 | [path setLineWidth:kSelectionWidth]; 102 | [path stroke]; 103 | } 104 | 105 | - (void)drawWithFrame:(NSRect)frame inView:(NSView *)view { 106 | [NSGraphicsContext saveGraphicsState]; 107 | { 108 | [self drawBackgroundWithFrame:frame inView:view]; 109 | [self drawInteriorWithFrame:frame inView:view]; 110 | 111 | if([self state] == NSOnState || [self isHighlighted]) 112 | { 113 | [self drawSelectionWithFrame:frame inView:view]; 114 | } 115 | } 116 | [NSGraphicsContext restoreGraphicsState]; 117 | } 118 | 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /ITSidebar/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 6 | 7 | \f0\fs24 \cf0 Copyright \'a9 2013 by Ilija Tovilo} -------------------------------------------------------------------------------- /ITSidebar/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ITSidebar/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ITSidebar 4 | // 5 | // Created by Ilija Tovilo on 2/22/13. 6 | // Copyright (c) 2013 Ilija Tovilo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /ITSidebar/push-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/push-pushed.png -------------------------------------------------------------------------------- /ITSidebar/push-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/push-pushed@2x.png -------------------------------------------------------------------------------- /ITSidebar/push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/push.png -------------------------------------------------------------------------------- /ITSidebar/push@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/push@2x.png -------------------------------------------------------------------------------- /ITSidebar/star-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/star-pushed.png -------------------------------------------------------------------------------- /ITSidebar/star-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/star-pushed@2x.png -------------------------------------------------------------------------------- /ITSidebar/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/star.png -------------------------------------------------------------------------------- /ITSidebar/star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/star@2x.png -------------------------------------------------------------------------------- /ITSidebar/tag-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/tag-pushed.png -------------------------------------------------------------------------------- /ITSidebar/tag-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/tag-pushed@2x.png -------------------------------------------------------------------------------- /ITSidebar/tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/tag.png -------------------------------------------------------------------------------- /ITSidebar/tag@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/tag@2x.png -------------------------------------------------------------------------------- /ITSidebar/trash-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/trash-pushed.png -------------------------------------------------------------------------------- /ITSidebar/trash-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/trash-pushed@2x.png -------------------------------------------------------------------------------- /ITSidebar/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/trash.png -------------------------------------------------------------------------------- /ITSidebar/trash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/trash@2x.png -------------------------------------------------------------------------------- /ITSidebar/watch-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/watch-pushed.png -------------------------------------------------------------------------------- /ITSidebar/watch-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/watch-pushed@2x.png -------------------------------------------------------------------------------- /ITSidebar/watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/watch.png -------------------------------------------------------------------------------- /ITSidebar/watch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/ITSidebar/watch@2x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ITSidebar 2 | ========= 3 | 4 | `ITSidebar` is outdated and thus shouldn't be used in new projects anymore. 5 | It heavily depends on `NSMatrix` and `NSCell` which are both soon to be deprecated. 6 | Just use an `NSTableView` or [JNWCollectionView](https://github.com/jwilling/JNWCollectionView). 7 | 8 | I'm planning on making a **v2.0** of `ITSidebar` but that might take a while. 9 | 10 | ----------- 11 | 12 | `ITSidebar` is a very lightweight control for Mac OS X. 13 | You can create sidebars similar to the one of Sparrow. 14 | 15 | ![](./ITSidebar.png) 16 | 17 | Why would I want to use this? 18 | ----------------------------- 19 | 20 | `ITSidebar` is: 21 | 22 | - Highly customizable 23 | - Lightning-fast 24 | - Completly free to use 25 | 26 | Usage 27 | ----- 28 | 29 | ### Copy files 30 | 31 | Copy the following files: 32 | 33 | * `ITSidebar.h` 34 | * `ITSidebar.m` 35 | * `ITSidebarItemCell.h` 36 | * `ITSidebarItemCell.m` 37 | * `ITLeakWarningHelper.h` 38 | 39 | Make sure to copy them to the project, and to add them to the target. 40 | Please use your own images for the button cells. 41 | 42 | ### Use in a project 43 | 44 | Make sure to check out the sample project. 45 | First, drag a `NSScrollView` onto your window. 46 | Then, select the document view, and set its custom class to `ITSidebar`. 47 | 48 | Now you can connect an outlet to it, and use the following methods: 49 | 50 | // Add/Remove Cells 51 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image target:(id)target action:(SEL)action; 52 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage target:(id)target action:(SEL)action; 53 | 54 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image; 55 | - (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage; 56 | 57 | - (void)removeRow:(NSInteger)row; 58 | 59 | // Select Cells 60 | - (void)setSelectedIndex:(int)selectedIndex; 61 | - (void)deselectAllItems; 62 | 63 | // Customisation 64 | - (void)setCellSize:(NSSize)cellSize; 65 | - (void)setBackgroundColor:(NSColor *)backgroundColor; 66 | - (void)setScrollerKnobStyle:(NSScrollerKnobStyle)knobStyle; 67 | 68 | - (ITSidebarItemCell *)selectedItem; 69 | - (int)selectedIndex; 70 | 71 | + (Class)sidebarItemCellClass; 72 | 73 | For subclassing and customisation, check out the example. 74 | 75 | ### License 76 | 77 | Copyright (c) 2013 - 2014, Ilija Tovilo 78 | All rights reserved. 79 | 80 | Redistribution and use in source and binary forms, with or without 81 | modification, are permitted provided that the following conditions are met: 82 | * Redistributions of source code must retain the above copyright 83 | notice, this list of conditions and the following disclaimer. 84 | * Redistributions in binary form must reproduce the above copyright 85 | notice, this list of conditions and the following disclaimer in the 86 | documentation and/or other materials provided with the distribution. 87 | * Neither the name of the organization nor the 88 | names of its contributors may be used to endorse or promote products 89 | derived from this software without specific prior written permission. 90 | 91 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 92 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 93 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 94 | DISCLAIMED. IN NO EVENT SHALL ILIJA TOVILO BE LIABLE FOR ANY 95 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 96 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 97 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 98 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 99 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 100 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 101 | 102 | ### Help 103 | 104 | If you have any questions, feel free to let me know at support@ilijatovilo.ch 105 | -------------------------------------------------------------------------------- /images/export/push-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/push-pushed.png -------------------------------------------------------------------------------- /images/export/push-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/push-pushed@2x.png -------------------------------------------------------------------------------- /images/export/push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/push.png -------------------------------------------------------------------------------- /images/export/push@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/push@2x.png -------------------------------------------------------------------------------- /images/export/star-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/star-pushed.png -------------------------------------------------------------------------------- /images/export/star-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/star-pushed@2x.png -------------------------------------------------------------------------------- /images/export/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/star.png -------------------------------------------------------------------------------- /images/export/star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/star@2x.png -------------------------------------------------------------------------------- /images/export/tag-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/tag-pushed.png -------------------------------------------------------------------------------- /images/export/tag-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/tag-pushed@2x.png -------------------------------------------------------------------------------- /images/export/tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/tag.png -------------------------------------------------------------------------------- /images/export/tag@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/tag@2x.png -------------------------------------------------------------------------------- /images/export/trash-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/trash-pushed.png -------------------------------------------------------------------------------- /images/export/trash-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/trash-pushed@2x.png -------------------------------------------------------------------------------- /images/export/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/trash.png -------------------------------------------------------------------------------- /images/export/trash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/trash@2x.png -------------------------------------------------------------------------------- /images/export/watch-pushed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/watch-pushed.png -------------------------------------------------------------------------------- /images/export/watch-pushed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/watch-pushed@2x.png -------------------------------------------------------------------------------- /images/export/watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/watch.png -------------------------------------------------------------------------------- /images/export/watch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/export/watch@2x.png -------------------------------------------------------------------------------- /images/sidebar-icons.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iluuu1994/ITSidebar/9096770fda132e8a813b5abac089ee6b41c77d7f/images/sidebar-icons.psd --------------------------------------------------------------------------------