diff --git a/HNHUi b/HNHUi index 1dd80a57..5246ae73 160000 --- a/HNHUi +++ b/HNHUi @@ -1 +1 @@ -Subproject commit 1dd80a57df9f2d122634a6ca1c193dd6581b6922 +Subproject commit 5246ae7342de16a5907838f992f0469cb79d3af3 diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 18cdb53b..60f79a86 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -73,7 +73,7 @@ 4C669BA016760ED100DD0774 /* Salsa20RandomStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7716760ED100DD0774 /* Salsa20RandomStream.m */; }; 4C669BA116760ED100DD0774 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7916760ED100DD0774 /* Utils.m */; }; 4C669BA216760ED100DD0774 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7B16760ED100DD0774 /* UUID.m */; }; - 4C69A73A16D589DF00EC1B1A /* MPGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C69A73916D589DF00EC1B1A /* MPGradientView.m */; }; + 4C69A73A16D589DF00EC1B1A /* HNHGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */; }; 4C6B0E8C16C9B99B00A9ED23 /* PasswordInputView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */; }; 4C77547516E55FE800970E02 /* MPInspectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77547416E55FE800970E02 /* MPInspectorViewController.m */; }; 4C77547716E55FFC00970E02 /* InspectorView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C77547616E55FFC00970E02 /* InspectorView.xib */; }; @@ -250,8 +250,8 @@ 4C669B7916760ED100DD0774 /* Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utils.m; sourceTree = ""; }; 4C669B7A16760ED100DD0774 /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = ""; }; 4C669B7B16760ED100DD0774 /* UUID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UUID.m; sourceTree = ""; }; - 4C69A73816D589DF00EC1B1A /* MPGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPGradientView.h; sourceTree = ""; }; - 4C69A73916D589DF00EC1B1A /* MPGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPGradientView.m; sourceTree = ""; }; + 4C69A73816D589DF00EC1B1A /* HNHGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHGradientView.h; sourceTree = ""; }; + 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHGradientView.m; sourceTree = ""; }; 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordInputView.xib; sourceTree = ""; }; 4C77547316E55FE800970E02 /* MPInspectorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPInspectorViewController.h; sourceTree = ""; }; 4C77547416E55FE800970E02 /* MPInspectorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPInspectorViewController.m; sourceTree = ""; }; @@ -372,8 +372,6 @@ 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */, 4C77547616E55FFC00970E02 /* InspectorView.xib */, 4CE39AC016ECE359000FE29D /* IconSelection.xib */, - 4C69A73816D589DF00EC1B1A /* MPGradientView.h */, - 4C69A73916D589DF00EC1B1A /* MPGradientView.m */, 4CE8247316E2F2B900573141 /* MPOverlayView.h */, 4CE8247416E2F2B900573141 /* MPOverlayView.m */, 4CFC53BD16E94729007396BE /* MPShadowBox.h */, @@ -752,6 +750,8 @@ 4CC3AAB9175F4983003EF01B /* HNHRoundedTextFieldCell.m */, 4C3D4C0617594CA40038DAAC /* HNHSeparator.h */, 4C3D4C0717594CA40038DAAC /* HNHSeparator.m */, + 4C69A73816D589DF00EC1B1A /* HNHGradientView.h */, + 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */, 4CC3AABA175F4983003EF01B /* LICENSE.MIT */, 4CC3AABB175F4983003EF01B /* README.md */, ); @@ -970,7 +970,7 @@ 4C61EA0316D2FD0800AC519E /* MPOutlineViewController.m in Sources */, 4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPAdditions.m in Sources */, 4CC1AEBE16D4467C006D2AAB /* KdbTree+MPAdditions.m in Sources */, - 4C69A73A16D589DF00EC1B1A /* MPGradientView.m in Sources */, + 4C69A73A16D589DF00EC1B1A /* HNHGradientView.m in Sources */, 4C920E2A16DCDFA00083839B /* MPLoggerProxy.m in Sources */, 4C65C79C16DD283900E32CFF /* MPToolbarButton.m in Sources */, 4C431BCD16E2A82800700A81 /* MPPasteBoardController.m in Sources */, diff --git a/MacPass/FilterBar.xib b/MacPass/FilterBar.xib index a7c0f5a5..70aa23cd 100644 --- a/MacPass/FilterBar.xib +++ b/MacPass/FilterBar.xib @@ -2,9 +2,9 @@ 1080 - 12D78 + 12E55 3084 - 1187.37 + 1187.39 626.00 com.apple.InterfaceBuilder.CocoaPlugin @@ -39,7 +39,7 @@ NSApplication - + 268 @@ -47,7 +47,6 @@ 268 {{369, 5}, {136, 19}} - _NS:9 YES @@ -122,7 +121,6 @@ 268 {{513, 5}, {42, 17}} - _NS:9 YES @@ -146,7 +144,6 @@ 268 {{188, 5}, {38, 17}} - _NS:9 YES @@ -175,7 +172,6 @@ 268 {{104, 5}, {76, 17}} - _NS:9 YES @@ -200,7 +196,6 @@ 268 {{5, 6}, {44, 14}} - _NS:1535 YES @@ -241,7 +236,6 @@ 268 {{54, 4}, {42, 19}} - _NS:9 YES @@ -263,10 +257,8 @@ {563, 28} - - - MPGradientView + HNHGradientView @@ -948,14 +940,6 @@ ./Classes/MPEntryViewController.h - - MPGradientView - NSView - - IBProjectSource - ./Classes/MPGradientView.h - - MPViewController NSViewController diff --git a/MacPass/MPGradientView.h b/MacPass/MPGradientView.h deleted file mode 100644 index 98568c94..00000000 --- a/MacPass/MPGradientView.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// MPGradientView.h -// MacPass -// -// Created by Michael Starke on 20.02.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import - -/* - A view just displaying a gradient - */ -@interface MPGradientView : NSView - -- (id)initWithFrame:(NSRect)frame activeGradient:(NSGradient *)activeGradient inactiveGradient:(NSGradient *)inactiveGradient; - -@end diff --git a/MacPass/MPGradientView.m b/MacPass/MPGradientView.m deleted file mode 100644 index 2e903a47..00000000 --- a/MacPass/MPGradientView.m +++ /dev/null @@ -1,91 +0,0 @@ -// -// MPGradientView.m -// MacPass -// -// Created by Michael Starke on 20.02.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import "MPGradientView.h" - -@interface MPGradientView () - -@property (assign, nonatomic) BOOL isRenderedActive; -@property (retain) NSGradient *activeGradient; -@property (retain) NSGradient *inactiveGradient; - -- (void)_refreshActiveState; - -@end - -@implementation MPGradientView - -- (id)initWithFrame:(NSRect)frameRect { - NSColor *activeTop = [NSColor colorWithCalibratedWhite:0.85 alpha:1]; - NSColor *activeBottom = [NSColor colorWithCalibratedWhite:0.7 alpha:1]; - NSColor *inactiveTop = [NSColor colorWithCalibratedWhite:0.9 alpha:1]; - NSColor *inactiveBottom = [NSColor colorWithCalibratedWhite:0.85 alpha:1]; - NSGradient *activeGradient = [[[NSGradient alloc] initWithColors:@[ activeBottom, activeTop ]] autorelease]; - NSGradient *inactiveGradient = [[[NSGradient alloc] initWithColors:@[ inactiveBottom, inactiveTop ]] autorelease]; - return [self initWithFrame:frameRect activeGradient:activeGradient inactiveGradient:inactiveGradient]; -} - -- (id)initWithFrame:(NSRect)frame activeGradient:(NSGradient *)activeGradient inactiveGradient:(NSGradient *)inactiveGradient { - self = [super initWithFrame:frame]; - if(self) { - _activeGradient = [activeGradient retain]; - _inactiveGradient = [inactiveGradient retain]; - } - return self; -} - -- (void)dealloc { - self.activeGradient = nil; - self.inactiveGradient = nil; - [super dealloc]; -} - -#pragma mark Drawing - -- (void)drawRect:(NSRect)dirtyRect { - /* - We draw a Gradient, so make sure we always redraw the full view - */ - NSGradient *gradient = self.isRenderedActive ? self.activeGradient : self.inactiveGradient; - [gradient drawInRect:self.bounds angle:90]; -} - -- (BOOL)isOpaque { - return YES; -} - -#pragma mark State Refresh -- (void)_registerWindow:(NSWindow *)newWindow { - if([self window]) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:[self window]]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResignKeyNotification object:[self window]]; - } - if(newWindow) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_refreshActiveState) name:NSWindowDidBecomeKeyNotification object:newWindow]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_refreshActiveState) name:NSWindowDidResignKeyNotification object:newWindow]; - } -} - -- (void)viewWillMoveToWindow:(NSWindow *)newWindow { - [self _registerWindow:newWindow]; - [super viewWillMoveToWindow:newWindow]; -} - -- (void)_refreshActiveState { - self.isRenderedActive = [[self window] isKeyWindow]; -} - -# pragma mark Custom Properties -- (void)setIsRenderedActive:(BOOL)isRenderedActive { - if(_isRenderedActive != isRenderedActive) { - _isRenderedActive = isRenderedActive; - [self setNeedsDisplay:YES]; - } -} - -@end