diff --git a/HNHUi b/HNHUi index 5f12a357..5409efc9 160000 --- a/HNHUi +++ b/HNHUi @@ -1 +1 @@ -Subproject commit 5f12a3570c764b18749ce457e75ed8f99bbc920d +Subproject commit 5409efc9331e8543e92918f4c35e366851fa5aaa diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 930c66c2..da1eb420 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -197,6 +197,7 @@ 4C888C9716EB754B003D34A1 /* MPActionHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C888C9616EB754B003D34A1 /* MPActionHelper.m */; }; 4C8A173D1790AA41008B5C17 /* NSData+Keyfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8A173C1790AA41008B5C17 /* NSData+Keyfile.m */; }; 4C8B36AB17A6ED4B005E1FF1 /* MPOutlineMenuDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8B36AA17A6ED4B005E1FF1 /* MPOutlineMenuDelegate.m */; }; + 4C8B36AE17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8B36AD17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.m */; }; 4C8FECC816D57E3200BF26CF /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C8FECC716D57E3200BF26CF /* QuartzCore.framework */; }; 4C96D15417A12E4F00D931FA /* 99_CreatedTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C96D15317A12E4F00D931FA /* 99_CreatedTemplate.pdf */; }; 4C9D6AA917615199001C660C /* HNHRoundedSecureTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9D6AA817615199001C660C /* HNHRoundedSecureTextFieldCell.m */; }; @@ -627,6 +628,8 @@ 4C8A173C1790AA41008B5C17 /* NSData+Keyfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Keyfile.m"; sourceTree = ""; }; 4C8B36A917A6ED4B005E1FF1 /* MPOutlineMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOutlineMenuDelegate.h; sourceTree = ""; }; 4C8B36AA17A6ED4B005E1FF1 /* MPOutlineMenuDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOutlineMenuDelegate.m; sourceTree = ""; }; + 4C8B36AC17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHContextButtonSegmentedCell.h; sourceTree = ""; }; + 4C8B36AD17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHContextButtonSegmentedCell.m; sourceTree = ""; }; 4C8FECC716D57E3200BF26CF /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 4C96D15317A12E4F00D931FA /* 99_CreatedTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 99_CreatedTemplate.pdf; sourceTree = ""; }; 4C9D6AA717615199001C660C /* HNHRoundedSecureTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHRoundedSecureTextFieldCell.h; sourceTree = ""; }; @@ -1502,6 +1505,8 @@ 4CF78059176E6D5F0032EE71 /* HNHTableRowView.m */, 4C52A242177D7B9F0000D88F /* HNHScrollView.h */, 4C52A243177D7B9F0000D88F /* HNHScrollView.m */, + 4C8B36AC17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.h */, + 4C8B36AD17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.m */, ); path = HNHUi; sourceTree = ""; @@ -2032,6 +2037,7 @@ 4C4B7EF817A4B335000234C7 /* MPUniqueCharactersFormatter.m in Sources */, 4C5FA86D17A5F26800C781C9 /* KPKDataStreamWriter.m in Sources */, 4C8B36AB17A6ED4B005E1FF1 /* MPOutlineMenuDelegate.m in Sources */, + 4C8B36AE17A734A1005E1FF1 /* HNHContextButtonSegmentedCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/GroupInspectorView.xib b/MacPass/GroupInspectorView.xib index 12cc9641..9a25854a 100644 --- a/MacPass/GroupInspectorView.xib +++ b/MacPass/GroupInspectorView.xib @@ -16,6 +16,10 @@ NSButtonCell NSCustomObject NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell NSScrollView NSScroller NSTextField @@ -44,49 +48,222 @@ 268 - + 268 - {{18, 127}, {130, 18}} + {{159, 99}, {81, 26}} _NS:9 YES - - -2080374784 - 268435456 - Include in Search + + -2076180416 + 2048 LucidaGrande 13 1044 _NS:9 - - 1211912448 - 2 - - NSImage - NSSwitch - - - NSSwitch - + + 109199360 + 129 - 200 - 25 + 400 + 75 + + YES + + OtherViews + + + + Inherit + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + + + Enable + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Disable + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + -1 + 1 + YES + YES + 2 + + NO + + + + 268 + {{159, 130}, {81, 26}} + + + + _NS:9 + YES + + -2076180416 + 2048 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + YES + + OtherViews + + + + Inherit + + 131072 + 2147483647 + + + _popUpItemAction: + + + + + Enable + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Disable + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + -1 + 1 + YES + YES + 2 + + NO + + + + 268 + {{17, 104}, {66, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Autotype: + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{17, 135}, {50, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Search: + + _NS:1535 + + + NO 268 - {{174, 150}, {63, 19}} + {{174, 163}, {63, 19}} - + _NS:9 YES @@ -112,7 +289,7 @@ 268 - {{18, 151}, {69, 18}} + {{18, 164}, {69, 18}} @@ -127,8 +304,13 @@ 1211912448 2 - - + + NSImage + NSSwitch + + + NSSwitch + 200 @@ -139,7 +321,7 @@ 268 - {{17, 445}, {35, 14}} + {{17, 457}, {35, 14}} @@ -156,15 +338,7 @@ _NS:1535 - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - + 6 System @@ -207,7 +381,7 @@ WebURLsWithTitlesPboardType public.url - {215, 258} + {215, 257} @@ -249,10 +423,7 @@ 6 System selectedTextColor - - 3 - MAA - + @@ -276,7 +447,7 @@ - {{1, 1}, {215, 258}} + {{1, 1}, {215, 257}} @@ -307,7 +478,7 @@ 256 - {{200, 1}, {16, 258}} + {{200, 1}, {16, 257}} @@ -333,7 +504,7 @@ 0.94565218687057495 - {{20, 177}, {217, 260}} + {{20, 190}, {217, 259}} @@ -350,7 +521,7 @@ 268 - {{20, 467}, {217, 22}} + {{20, 479}, {217, 22}} @@ -382,7 +553,7 @@ 268 - {{17, 497}, {35, 14}} + {{17, 509}, {35, 14}} @@ -401,7 +572,7 @@ NO - {257, 516} + {257, 528} @@ -570,6 +741,134 @@ 3 + + + 5 + 1 + + 6 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 102 + + 1000 + + 3 + 9 + 3 + + + + 3 + 0 + + 4 + 1 + + 10 + + 1000 + + 6 + 24 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 4 + 0 + + 4 + 1 + + 164 + + 1000 + + 3 + 9 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + 3 @@ -602,59 +901,27 @@ 29 3 - - - 4 - 0 - - 4 - 1 - - 129 - - 1000 - - 3 - 9 - 3 - - - + + 5 - 0 - - 5 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 3 - 0 - - 4 + 1 + + 6 1 8 1000 - 6 - 24 + 9 + 40 3 - - + + 10 0 - + 10 1 @@ -666,6 +933,38 @@ 24 2 + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + 5 @@ -848,7 +1147,10 @@ - + + + + @@ -1013,11 +1315,6 @@ - - 19 - - - 33 @@ -1029,36 +1326,176 @@ - 75 - + 108 + + + + + 140 + + + + + 213 + - + - 76 - - + 214 + + - 102 - + 216 + - 104 - + 218 + + + + - 107 - + 219 + + + + + 222 + - 108 - + 226 + + + + + 229 + + + + + + + + 230 + + + + + + + + 231 + + + + + + + + + + 232 + + + + + 233 + + + + + 234 + + + + + 236 + + + + + 240 + + + + + + + + 242 + + + + + + + + 243 + + + + + + + + + + 244 + + + + + 245 + + + + + 246 + + + + + 248 + + + + + 249 + + + + + 250 + + + + + 251 + + + + + 252 + + + + + 253 + + + + + 254 + @@ -1068,25 +1505,53 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin HNHRoundedTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1104,12 +1569,20 @@ - - - - + + + + + + + + + + + + @@ -1137,16 +1610,13 @@ com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - 109 + 254 @@ -1227,10 +1697,11 @@ YES 3 - - NSSwitch - {15, 15} - + + {11, 11} + {10, 3} + {15, 15} + YES diff --git a/MacPass/MPContextToolbarButton.m b/MacPass/MPContextToolbarButton.m index e87ee3ce..127854f0 100644 --- a/MacPass/MPContextToolbarButton.m +++ b/MacPass/MPContextToolbarButton.m @@ -8,6 +8,8 @@ #import "MPContextToolbarButton.h" +#import "HNHContextButtonSegmentedCell.h" + @implementation MPContextToolbarButton - (id)initWithFrame:(NSRect)frame { @@ -15,11 +17,22 @@ if (self) { [self setFocusRingType:NSFocusRingTypeNone]; [self setSegmentCount:2]; + [[self cell] setTag:-1 forSegment:0]; + [[self cell] setTag:-1 forSegment:1]; [[self cell] setWidth:15 forSegment:1]; [[self cell] setTrackingMode:NSSegmentSwitchTrackingMomentary]; [self setSegmentStyle:NSSegmentStyleTexturedSquare]; + + NSMutableData *data = [[NSMutableData alloc] init]; + NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; + [[self cell] encodeWithCoder:archiver]; + [archiver finishEncoding]; + + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; + HNHContextButtonSegmentedCell *cell = [[HNHContextButtonSegmentedCell alloc] initWithCoder:unarchiver]; + [unarchiver finishDecoding]; + [self setCell:cell]; } - return self; } /* diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 66fdb952..eb16b297 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -89,6 +89,11 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR"; [image setSize:NSMakeSize(16, 16)]; [button setImage:image]; [button sizeToFit]; + + NSMenu *menu = [NSMenu allocWithZone:[NSMenu menuZone]]; + [menu addItemWithTitle:@"Test" action:NULL keyEquivalent:@""]; + [[button cell] setMenu:menu forSegment:1]; + NSRect fittingRect = [button frame]; fittingRect.size.width = MAX( (CGFloat)32.0,fittingRect.size.width);