mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-20 14:29:31 +00:00
Folded MPEntryPasswordAttributeEditor back into generic attribute editor
fixed brocken tracking when scrolling added first try to show custom attributes in inspector (this might become a bottleneck)
This commit is contained in:
@@ -302,8 +302,6 @@
|
||||
4CE5B54B173AFBA700207B39 /* MPDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE5B549173AFBA700207B39 /* MPDocument.m */; };
|
||||
4CE8246F16E2E93400573141 /* MPOverlayWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */; };
|
||||
4CE8247516E2F2B900573141 /* MPOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE8247416E2F2B900573141 /* MPOverlayView.m */; };
|
||||
4CE84903271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE84901271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.m */; };
|
||||
4CE84904271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CE84902271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.xib */; };
|
||||
4CE88B9717BA651C0042E078 /* contextTriangleTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CE88B9617BA651C0042E078 /* contextTriangleTemplate.pdf */; };
|
||||
4CEE46DD181C301D006BF1E5 /* MPAutotypeDaemon.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEE46DC181C301D006BF1E5 /* MPAutotypeDaemon.m */; };
|
||||
4CEED1C617D7BD0E007180F1 /* NSError+Messages.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEED1C517D7BD0E007180F1 /* NSError+Messages.m */; };
|
||||
@@ -931,9 +929,6 @@
|
||||
4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayWindowController.m; sourceTree = "<group>"; };
|
||||
4CE8247316E2F2B900573141 /* MPOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOverlayView.h; sourceTree = "<group>"; };
|
||||
4CE8247416E2F2B900573141 /* MPOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayView.m; sourceTree = "<group>"; };
|
||||
4CE84900271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPEntryPasswordAttributeViewController.h; sourceTree = "<group>"; };
|
||||
4CE84901271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPEntryPasswordAttributeViewController.m; sourceTree = "<group>"; };
|
||||
4CE84902271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MPEntryPasswordAttributeViewController.xib; sourceTree = "<group>"; };
|
||||
4CE88B9617BA651C0042E078 /* contextTriangleTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = contextTriangleTemplate.pdf; sourceTree = "<group>"; };
|
||||
4CE88C2417C163FE00BFD195 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||
4CE88C3317C1647400BFD195 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
@@ -1543,9 +1538,6 @@
|
||||
4CC0192B271836CD00459789 /* MPEntryAttributeViewController.h */,
|
||||
4CC0192C271836CD00459789 /* MPEntryAttributeViewController.m */,
|
||||
4CC0192D271836CD00459789 /* MPEntryAttributeViewController.xib */,
|
||||
4CE84900271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.h */,
|
||||
4CE84901271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.m */,
|
||||
4CE84902271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.xib */,
|
||||
4C59AC9A2722C12200F54B20 /* MPNodeExpirationViewController.h */,
|
||||
4C59AC9B2722C12200F54B20 /* MPNodeExpirationViewController.m */,
|
||||
4C59AC9C2722C12200F54B20 /* MPNodeExpirationViewController.xib */,
|
||||
@@ -2256,7 +2248,6 @@
|
||||
4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */,
|
||||
4CF29BF417879D0000851B60 /* 26_FileSaveTemplate.pdf in Resources */,
|
||||
4C7BD07619FE94C900C7AA5C /* Assets.xcassets in Resources */,
|
||||
4CE84904271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.xib in Resources */,
|
||||
4CA182781F96523600DD4A4A /* DuplicateEntryOptionsWindow.xib in Resources */,
|
||||
4C52A88E1788628B00868229 /* 06_BlockDeviceTemplate.pdf in Resources */,
|
||||
4C52A88F1788628B00868229 /* 13_KeysTemplate.pdf in Resources */,
|
||||
@@ -2468,7 +2459,6 @@
|
||||
4CCEDE2A179F203B008402BE /* MPOutlineView.m in Sources */,
|
||||
4CB33F861EAF54A000C9341E /* KPKNode+MPIsHistory.m in Sources */,
|
||||
4CCEDE2E179F213B008402BE /* MPNotifications.m in Sources */,
|
||||
4CE84903271E10AC00EBAB0C /* MPEntryPasswordAttributeViewController.m in Sources */,
|
||||
4C17D8E517A1C780006C8C1E /* MPDocumentWindowDelegate.m in Sources */,
|
||||
4C63B8FB17A3154D0091BD72 /* MPContextButton.m in Sources */,
|
||||
4C1E9885185F71A800943563 /* MPContextBarViewController.m in Sources */,
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<rect key="frame" x="20" y="26" width="233" height="396"/>
|
||||
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="F3N-QI-Di5">
|
||||
<rect key="frame" x="1" y="1" width="231" height="394"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="36" rowSizeStyle="automatic" viewBased="YES" id="137">
|
||||
<rect key="frame" x="0.0" y="0.0" width="231" height="394"/>
|
||||
@@ -251,7 +251,7 @@
|
||||
<constraint firstAttribute="bottom" secondItem="83" secondAttribute="bottom" id="Lc3-ap-AJQ"/>
|
||||
<constraint firstItem="82" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3" secondAttribute="leading" constant="20" symbolic="YES" id="zU6-5h-Swa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-457.5" y="-1614.5"/>
|
||||
<point key="canvasLocation" x="-239" y="-1954"/>
|
||||
</view>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="HNHUIScrollDocumentViewAdapter">
|
||||
<rect key="frame" x="0.0" y="0.0" width="291" height="840"/>
|
||||
@@ -352,7 +352,7 @@
|
||||
<constraint firstItem="dx3-E2-FFt" firstAttribute="leading" secondItem="4" secondAttribute="leading" constant="20" symbolic="YES" id="sjr-Xo-zxh"/>
|
||||
<constraint firstItem="G9J-nn-2bu" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="4" secondAttribute="leading" constant="20" symbolic="YES" id="z4K-PB-Qfb"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-104.5" y="-1440"/>
|
||||
<point key="canvasLocation" x="91" y="-1780"/>
|
||||
</customView>
|
||||
<view translatesAutoresizingMaskIntoConstraints="NO" id="zv7-wE-Bmg" customClass="HNHUIScrollDocumentViewAdapter">
|
||||
<rect key="frame" x="0.0" y="0.0" width="301" height="424"/>
|
||||
@@ -583,13 +583,13 @@
|
||||
<constraint firstAttribute="trailing" secondItem="45R-v4-ywl" secondAttribute="trailing" constant="20" symbolic="YES" id="uUm-S5-cxM"/>
|
||||
<constraint firstAttribute="trailing" secondItem="z03-zW-GN3" secondAttribute="trailing" constant="20" symbolic="YES" id="wiq-pY-TG8"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="244" y="-1648"/>
|
||||
<point key="canvasLocation" x="418" y="-1988"/>
|
||||
</view>
|
||||
<scrollView borderType="line" autohidesScrollers="YES" horizontalLineScroll="56" horizontalPageScroll="10" verticalLineScroll="56" verticalPageScroll="10" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="180" customClass="HNHUIScrollView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="290" height="268"/>
|
||||
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="k8G-zp-BXZ">
|
||||
<rect key="frame" x="1" y="1" width="288" height="266"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="fullWidth" selectionHighlightStyle="none" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="54" viewBased="YES" id="193">
|
||||
<rect key="frame" x="0.0" y="0.0" width="288" height="266"/>
|
||||
@@ -611,7 +611,7 @@
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView identifier="SelectedCell" translatesAutoresizingMaskIntoConstraints="NO" id="196" customClass="MPCustomFieldTableCellView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="227" height="53"/>
|
||||
<rect key="frame" x="1" y="1" width="227" height="53"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" contentType="oneTimeCode" translatesAutoresizingMaskIntoConstraints="NO" id="199" customClass="HNHUISecureTextField">
|
||||
<rect key="frame" x="3" y="10" width="114" height="21"/>
|
||||
|
||||
@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (strong) IBOutlet NSTextField *keyTextField;
|
||||
@property (strong) IBOutlet HNHUISecureTextField *valueTextField;
|
||||
@property (strong) IBOutlet NSButton *generatePasswordButton;
|
||||
@property (strong) IBOutlet NSButton *toggleProtectedButton;
|
||||
@property (strong) IBOutlet NSButton *removeButton;
|
||||
@property (strong) IBOutlet NSButton *actionButton;
|
||||
|
||||
@@ -18,7 +18,7 @@ NSString *nameForDefaultKey(NSString *key) {
|
||||
dispatch_once(&onceToken, ^{
|
||||
mapping = @{ kKPKTitleKey: NSLocalizedString(@"TITTLE_ATTRIBUTE_KEY", @"Localized name for title attribute"),
|
||||
kKPKUsernameKey: NSLocalizedString(@"USERNAME_ATTRIBUTE_KEY", @"Localized name for username attribute"),
|
||||
kKPKPasswordKey: NSLocalizedString(@"PASSEORD_ATTRIBUTE_KEY", @"Localized name for password attribute"),
|
||||
kKPKPasswordKey: NSLocalizedString(@"PASSWORD_ATTRIBUTE_KEY", @"Localized name for password attribute"),
|
||||
kKPKURLKey: NSLocalizedString(@"URL_ATTRIBUTE_KEY", @"Localized name for URL attribute") };
|
||||
});
|
||||
return mapping[key];
|
||||
@@ -26,7 +26,9 @@ NSString *nameForDefaultKey(NSString *key) {
|
||||
|
||||
|
||||
@interface MPEntryAttributeViewController ()
|
||||
|
||||
@property (nonatomic, readonly, getter=isDefaultAttributeEditor) BOOL defaultAttributeEditor;
|
||||
@property (nonatomic, readonly, getter=isPasswordAttributeEditor) BOOL passwordAttributeEditor;
|
||||
|
||||
@end
|
||||
|
||||
@@ -94,7 +96,11 @@ NSString *nameForDefaultKey(NSString *key) {
|
||||
withKeyPath:keyKeyPath
|
||||
options:bindingOptions];
|
||||
}
|
||||
|
||||
if(self.isPasswordAttributeEditor) {
|
||||
self.toggleProtectedButton.image = [NSImage imageNamed:NSImageNameQuickLookTemplate];
|
||||
// TODO: setup pretty password value transformer
|
||||
// TODO: setup Monospaced Font
|
||||
}
|
||||
[self updateValuesAndEditing];
|
||||
}
|
||||
|
||||
@@ -109,6 +115,10 @@ NSString *nameForDefaultKey(NSString *key) {
|
||||
return (self.attributeSelector != NULL);
|
||||
}
|
||||
|
||||
- (BOOL)isPasswordAttributeEditor {
|
||||
return self.attributeSelector == @selector(password);
|
||||
}
|
||||
|
||||
- (void)setIsEditor:(BOOL)isEditor {
|
||||
_isEditor = isEditor;
|
||||
[self updateValuesAndEditing];
|
||||
@@ -195,7 +205,7 @@ NSString *nameForDefaultKey(NSString *key) {
|
||||
- (void)updateValuesAndEditing {
|
||||
// values
|
||||
self.view.hidden = self.isEditor ? NO : self.representedAttribute.value.length == 0;
|
||||
|
||||
|
||||
self.valueTextField.showPassword = !self.representedAttribute.protect;
|
||||
|
||||
// editor
|
||||
@@ -203,7 +213,8 @@ NSString *nameForDefaultKey(NSString *key) {
|
||||
self.valueTextField.editable = self.isEditor;
|
||||
self.keyTextField.selectable = YES;
|
||||
self.valueTextField.selectable = YES;
|
||||
self.toggleProtectedButton.hidden = self.isDefaultAttributeEditor;
|
||||
self.toggleProtectedButton.hidden = self.isDefaultAttributeEditor ? !self.isPasswordAttributeEditor : NO;
|
||||
self.generatePasswordButton.hidden = self.isEditor ? !self.isPasswordAttributeEditor : YES;
|
||||
|
||||
self.removeButton.hidden = !self.isEditor ? YES : self.isDefaultAttributeEditor;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MPEntryAttributeViewController">
|
||||
<connections>
|
||||
<outlet property="actionButton" destination="gab-tS-gBb" id="gvk-hn-Erc"/>
|
||||
<outlet property="generatePasswordButton" destination="5gR-99-IVJ" id="SFB-s9-2CX"/>
|
||||
<outlet property="keyTextField" destination="m8q-FN-S8D" id="HzJ-cd-ifA"/>
|
||||
<outlet property="removeButton" destination="Nmx-gC-8rG" id="eRy-l0-u0E"/>
|
||||
<outlet property="toggleProtectedButton" destination="hAk-oD-dCj" id="js9-Hx-ycS"/>
|
||||
@@ -19,14 +20,14 @@
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY" customClass="MPInspectorEditorView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="251" height="43"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="436" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="No7-P9-4cl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="251" height="43"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="436" height="50"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="m8q-FN-S8D">
|
||||
<rect key="frame" x="-2" y="29" width="255" height="14"/>
|
||||
<rect key="frame" x="-2" y="36" width="440" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="AttributeName" id="MQc-TE-UjE">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -34,11 +35,11 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LBt-0e-cUK">
|
||||
<rect key="frame" x="0.0" y="0.0" width="251" height="21"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="436" height="28"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HZM-H4-dB4" customClass="HNHUISecureTextField">
|
||||
<rect key="frame" x="0.0" y="0.0" width="132" height="21"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="sO3-xr-VwO">
|
||||
<rect key="frame" x="0.0" y="4" width="236" height="21"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="sO3-xr-VwO" customClass="HNHUISecureTextFieldCell">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -48,21 +49,31 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hAk-oD-dCj">
|
||||
<rect key="frame" x="130" y="-6" width="44" height="32"/>
|
||||
<rect key="frame" x="234" y="-3" width="44" height="32"/>
|
||||
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSLockLockedTemplate" imagePosition="only" alignment="center" alternateImage="NSLockUnlockedTemplate" lineBreakMode="truncatingTail" borderStyle="border" inset="2" id="f80-K9-DO7">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Nmx-gC-8rG">
|
||||
<rect key="frame" x="165" y="-6" width="44" height="32"/>
|
||||
<rect key="frame" x="269" y="-3" width="44" height="32"/>
|
||||
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSRemoveTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="179-uk-89S">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5gR-99-IVJ">
|
||||
<rect key="frame" x="304" y="-3" width="90" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Generate" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="IwJ-ml-b4v">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="showPasswordGenerator:" target="-1" id="L0a-eV-dW3"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gab-tS-gBb">
|
||||
<rect key="frame" x="201" y="-4" width="56" height="27"/>
|
||||
<rect key="frame" x="386" y="-1" width="56" height="27"/>
|
||||
<buttonCell key="cell" type="push" title="Copy" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="0GH-rx-Fg4">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -74,12 +85,14 @@
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
</subviews>
|
||||
@@ -99,7 +112,7 @@
|
||||
<constraint firstAttribute="bottom" secondItem="No7-P9-4cl" secondAttribute="bottom" id="MX2-as-4EI"/>
|
||||
<constraint firstItem="No7-P9-4cl" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="mbE-gq-jDF"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-434.5" y="134"/>
|
||||
<point key="canvasLocation" x="-527" y="134"/>
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#import "MPTOTPViewController.h"
|
||||
#import "MPTOTPSetupViewController.h"
|
||||
#import "MPEntryAttributeViewController.h"
|
||||
#import "MPEntryPasswordAttributeViewController.h"
|
||||
#import "MPNodeExpirationViewController.h"
|
||||
#import "MPNodeIconViewController.h"
|
||||
|
||||
@@ -89,9 +88,9 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
@property (strong) MPTOTPViewController *totpViewController;
|
||||
@property (strong) MPEntryAttributeViewController *titleEditorViewController;
|
||||
@property (strong) MPEntryAttributeViewController *usernameEditorViewController;
|
||||
@property (strong) MPEntryAttributeViewController *passwordEditorViewController;
|
||||
@property (strong) MPEntryAttributeViewController *urlEditorViewController;
|
||||
@property (strong) MPNodeExpirationViewController *expiresEditorViewController;
|
||||
@property (strong) MPEntryPasswordAttributeViewController *passwordEditorViewController;
|
||||
@property (strong) MPNodeIconViewController *iconViewController;
|
||||
|
||||
|
||||
@@ -164,7 +163,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
|
||||
[self.infoTabControl bind:NSSelectedIndexBinding toObject:self withKeyPath:NSStringFromSelector(@selector(activeTab)) options:nil];
|
||||
[self.tabView bind:NSSelectedIndexBinding toObject:self withKeyPath:NSStringFromSelector(@selector(activeTab)) options:nil];
|
||||
|
||||
|
||||
self.attachmentTableView.backgroundColor = NSColor.clearColor;
|
||||
[self.attachmentTableView bind:NSContentBinding toObject:_attachmentsController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil];
|
||||
self.attachmentTableView.delegate = _attachmentTableDelegate;
|
||||
@@ -213,7 +212,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
//[self.togglePassword bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(showPassword)) options:nil];
|
||||
|
||||
self.tagsTokenField.delegate = _tagTokenFieldDelegate;
|
||||
|
||||
|
||||
[self _setupAttributeEditors];
|
||||
[self _updateEditors];
|
||||
|
||||
@@ -512,16 +511,16 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
- (void)_setupViewBindings {
|
||||
/* Disable for history view */
|
||||
NSArray *inputs = @[
|
||||
self.tagsTokenField,
|
||||
self.addAttachmentButton,
|
||||
self.addCustomFieldButton,
|
||||
self.addWindowAssociationButton,
|
||||
self.removeWindowAssociationButton,
|
||||
self.enableAutotypeCheckButton,
|
||||
self.obfuscateAutotypeCheckButton,
|
||||
self.customEntrySequenceTextField,
|
||||
self.windowTitleComboBox,
|
||||
self.associationSequenceTextField];
|
||||
self.tagsTokenField,
|
||||
self.addAttachmentButton,
|
||||
self.addCustomFieldButton,
|
||||
self.addWindowAssociationButton,
|
||||
self.removeWindowAssociationButton,
|
||||
self.enableAutotypeCheckButton,
|
||||
self.obfuscateAutotypeCheckButton,
|
||||
self.customEntrySequenceTextField,
|
||||
self.windowTitleComboBox,
|
||||
self.associationSequenceTextField];
|
||||
|
||||
for(NSControl *control in inputs) {
|
||||
[control bind:NSEnabledBinding
|
||||
@@ -545,7 +544,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(uuid)), NSStringFromSelector(@selector(UUIDString))]
|
||||
options:@{ NSConditionallySetsEditableBindingOption: @NO }];
|
||||
self.uuidTextField.editable = NO;
|
||||
|
||||
|
||||
/* Attachments */
|
||||
[_attachmentsController bind:NSContentArrayBinding
|
||||
toObject:self
|
||||
@@ -619,8 +618,8 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[self addChildViewController:self.usernameEditorViewController];
|
||||
self.usernameEditorViewController.attributeSelector = @selector(username);
|
||||
[self.fieldsStackView addArrangedSubview:self.usernameEditorViewController.view];
|
||||
|
||||
self.passwordEditorViewController = [[MPEntryPasswordAttributeViewController alloc] init];
|
||||
|
||||
self.passwordEditorViewController = [[MPEntryAttributeViewController alloc] init];
|
||||
[self addChildViewController:self.passwordEditorViewController];
|
||||
self.passwordEditorViewController.attributeSelector = @selector(password);
|
||||
[self.fieldsStackView addArrangedSubview:self.passwordEditorViewController.view];
|
||||
@@ -652,11 +651,19 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
self.urlEditorViewController.representedObject = [self.representedEntry attributeWithKey:kKPKURLKey];
|
||||
|
||||
// update custom field editors
|
||||
if(!self.representedEntry.hasCustomAttributes) {
|
||||
// clear all custom attribute editors
|
||||
for(NSViewController *vc in _customAttributeEditorViewControllers) {
|
||||
[self.fieldsStackView removeView:vc.view];
|
||||
[vc removeFromParentViewController];
|
||||
}
|
||||
else {
|
||||
|
||||
[_customAttributeEditorViewControllers removeAllObjects];
|
||||
for(KPKAttribute *attribute in self.representedEntry.customAttributes) {
|
||||
MPEntryAttributeViewController *vc = [[MPEntryAttributeViewController alloc] init];
|
||||
// FIXME: Correcly set editor starte based on current state
|
||||
vc.isEditor = NO;
|
||||
vc.representedObject = attribute;
|
||||
[self.fieldsStackView addArrangedSubview:vc.view];
|
||||
[self addChildViewController:vc];
|
||||
[_customAttributeEditorViewControllers addObject:vc];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,9 +675,9 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
/*
|
||||
FIXME: Add to MPEntryPasswordViewController
|
||||
if(textField == self.passwordTextField) {
|
||||
return NO;
|
||||
}
|
||||
*/
|
||||
return NO;
|
||||
}
|
||||
*/
|
||||
NSInteger index = MPCustomFieldIndexFromTag(textField.tag);
|
||||
if(index > -1) {
|
||||
KPKAttribute *attribute = _customFieldsController.arrangedObjects[index];
|
||||
@@ -692,9 +699,9 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
}
|
||||
|
||||
/*- (NSArray<NSString *> *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray<NSString *> *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index {
|
||||
return @[ @"{USERNAME}", @"{PASSWORD}", @"{URL}", @"{TITLE}" ];
|
||||
}
|
||||
*/
|
||||
return @[ @"{USERNAME}", @"{PASSWORD}", @"{URL}", @"{TITLE}" ];
|
||||
}
|
||||
*/
|
||||
|
||||
- (BOOL)textField:(NSTextField *)textField textView:(NSTextView *)textView performAction:(SEL)action {
|
||||
if(action == @selector(copy:)) {
|
||||
@@ -708,24 +715,24 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
return YES;
|
||||
}
|
||||
/* FIXME: Add to AttributeViewController
|
||||
if(textField == self.usernameTextField) {
|
||||
info = MPPasteboardOverlayInfoUsername;
|
||||
}
|
||||
else if(textField == self.passwordTextField) {
|
||||
info = MPPasteboardOverlayInfoPassword;
|
||||
}
|
||||
else if(textField == self.URLTextField) {
|
||||
info = MPPasteboardOverlayInfoURL;
|
||||
}
|
||||
else*/ if(textField == self.uuidTextField) {
|
||||
name = NSLocalizedString(@"UUID", "Displayed name when uuid field was copied");
|
||||
}
|
||||
else {
|
||||
NSInteger index = MPCustomFieldIndexFromTag(textField.tag);
|
||||
if(index > -1) {
|
||||
name = [_customFieldsController.arrangedObjects[index] key];
|
||||
}
|
||||
}
|
||||
if(textField == self.usernameTextField) {
|
||||
info = MPPasteboardOverlayInfoUsername;
|
||||
}
|
||||
else if(textField == self.passwordTextField) {
|
||||
info = MPPasteboardOverlayInfoPassword;
|
||||
}
|
||||
else if(textField == self.URLTextField) {
|
||||
info = MPPasteboardOverlayInfoURL;
|
||||
}
|
||||
else*/ if(textField == self.uuidTextField) {
|
||||
name = NSLocalizedString(@"UUID", "Displayed name when uuid field was copied");
|
||||
}
|
||||
else {
|
||||
NSInteger index = MPCustomFieldIndexFromTag(textField.tag);
|
||||
if(index > -1) {
|
||||
name = [_customFieldsController.arrangedObjects[index] key];
|
||||
}
|
||||
}
|
||||
[MPPasteBoardController.defaultController copyObject:selectedValue overlayInfo:info name:name atView:self.view];
|
||||
return NO;
|
||||
}
|
||||
@@ -737,8 +744,8 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
/*
|
||||
FIXME: Add to expiredViewController
|
||||
if([sender state] == NSOnState && [self.representedEntry.timeInfo.expirationDate isEqualToDate:NSDate.distantFuture]) {
|
||||
[NSApp sendAction:self.pickExpireDateButton.action to:nil from:self.pickExpireDateButton];
|
||||
}
|
||||
[NSApp sendAction:self.pickExpireDateButton.action to:nil from:self.pickExpireDateButton];
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -773,7 +780,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
}
|
||||
|
||||
- (void)_willAddAttribute:(NSNotification *)notification {
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)_didAddAttribute:(NSNotification *)notification {
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// MPEntryPasswordAttributeViewController.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 18.10.21.
|
||||
// Copyright © 2021 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MPEntryAttributeViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// View controller to edit password attributes of entries.
|
||||
@interface MPEntryPasswordAttributeViewController : MPEntryAttributeViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// MPEntryPasswordAttributeViewController.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 18.10.21.
|
||||
// Copyright © 2021 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPEntryPasswordAttributeViewController.h"
|
||||
#import <HNHUi/HNHUi.h>
|
||||
#import <KeePassKit/KeePassKit.h>
|
||||
|
||||
@interface MPEntryPasswordAttributeViewController ()
|
||||
|
||||
@property (strong) IBOutlet HNHUISecureTextField *passwordTextField;
|
||||
@property (strong) IBOutlet NSButton *togglePasswordButton;
|
||||
@property (strong) IBOutlet NSButton *generatePasswordButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPEntryPasswordAttributeViewController
|
||||
|
||||
@dynamic representedAttribute;
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.togglePasswordButton.action = @selector(toggleDisplay:);
|
||||
self.togglePasswordButton.target = self.passwordTextField;
|
||||
|
||||
}
|
||||
|
||||
- (void)updateValuesAndEditing {
|
||||
self.view.hidden = (!self.isEditor && self.representedAttribute.value.length == 0);
|
||||
self.passwordTextField.stringValue = self.representedAttribute.value ? self.representedAttribute.value : @"";
|
||||
/* editor */
|
||||
self.generatePasswordButton.hidden = !self.isEditor;
|
||||
self.passwordTextField.editable = self.isEditor;
|
||||
self.passwordTextField.selectable = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,115 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MPEntryPasswordAttributeViewController">
|
||||
<connections>
|
||||
<outlet property="actionButton" destination="z9F-gY-cEs" id="65B-kh-9zh"/>
|
||||
<outlet property="generatePasswordButton" destination="UlI-yI-Sqn" id="sKR-Rd-2LC"/>
|
||||
<outlet property="keyTextField" destination="2aN-Ps-z4K" id="ua7-Km-K5o"/>
|
||||
<outlet property="passwordTextField" destination="tpF-hp-29r" id="2pM-fr-9l0"/>
|
||||
<outlet property="togglePasswordButton" destination="AY0-XE-8S7" id="IwM-pB-tQn"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY" customClass="MPInspectorEditorView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jTp-ga-xuT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="42"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2aN-Ps-z4K">
|
||||
<rect key="frame" x="-2" y="28" width="484" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Password" id="Piv-zL-dtc">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<stackView distribution="fill" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" horizontalHuggingPriority="249" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XRh-Fs-reW">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="20"/>
|
||||
<subviews>
|
||||
<secureTextField horizontalHuggingPriority="249" verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" allowsCharacterPickerTouchBarItem="YES" contentType="oneTimeCode" translatesAutoresizingMaskIntoConstraints="NO" id="tpF-hp-29r" customClass="HNHUISecureTextField">
|
||||
<rect key="frame" x="0.0" y="0.0" width="299" height="20"/>
|
||||
<secureTextFieldCell key="cell" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="CeT-F7-Vb3">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<allowedInputSourceLocales>
|
||||
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
|
||||
</allowedInputSourceLocales>
|
||||
</secureTextFieldCell>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="QBE-5i-J4H"/>
|
||||
<outlet property="nextKeyView" destination="AY0-XE-8S7" id="uPk-2E-Bwh"/>
|
||||
</connections>
|
||||
</secureTextField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AY0-XE-8S7">
|
||||
<rect key="frame" x="300" y="-7" width="51" height="32"/>
|
||||
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSQuickLookTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="NUE-lS-hzr">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<outlet property="nextKeyView" destination="UlI-yI-Sqn" id="6uu-J3-TEc"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="UlI-yI-Sqn">
|
||||
<rect key="frame" x="345" y="-7" width="90" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Generate" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Rx9-ck-eKo">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="z9F-gY-cEs">
|
||||
<rect key="frame" x="430" y="-5" width="56" height="27"/>
|
||||
<buttonCell key="cell" type="push" title="Copy" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="P6t-eT-Iug">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
</subviews>
|
||||
<visibilityPriorities>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<visibilityPriorities>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="jTp-ga-xuT" secondAttribute="trailing" id="8qT-FW-gVh"/>
|
||||
<constraint firstItem="jTp-ga-xuT" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="Hla-na-Bw8"/>
|
||||
<constraint firstAttribute="bottom" secondItem="jTp-ga-xuT" secondAttribute="bottom" id="pcp-4W-Bvc"/>
|
||||
<constraint firstItem="jTp-ga-xuT" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="wEy-tv-xz0"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-93" y="-125"/>
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSQuickLookTemplate" width="21" height="13"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -27,11 +27,24 @@ NSString *const MPInspectorEditorViewMouseExitedNotification = @"com.hicknhackso
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:MPInspectorEditorViewMouseExitedNotification object:self];
|
||||
}
|
||||
|
||||
- (void)updateTrackingAreas {
|
||||
[super updateTrackingAreas];
|
||||
[self removeTrackingArea:self.trackingArea];
|
||||
- (void)createTrackingArea {
|
||||
self.trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds options:NSTrackingActiveAlways|NSTrackingMouseEnteredAndExited owner:self userInfo:nil];
|
||||
[self addTrackingArea:self.trackingArea];
|
||||
|
||||
NSPoint mouseLocation = self.window.mouseLocationOutsideOfEventStream;
|
||||
mouseLocation = [self convertPoint:mouseLocation fromView:nil];
|
||||
if(NSPointInRect(mouseLocation, self.bounds)) {
|
||||
[self mouseEntered:NSApp.currentEvent];
|
||||
}
|
||||
else {
|
||||
[self mouseExited:NSApp.currentEvent];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateTrackingAreas {
|
||||
[self removeTrackingArea:self.trackingArea];
|
||||
[self createTrackingArea];
|
||||
[super updateTrackingAreas];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</constraints>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="09t-w3-euN"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xou-fD-adZ">
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="xou-fD-adZ">
|
||||
<rect key="frame" x="38" y="8" width="407" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="aKF-2z-5ob">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MPNodeTagViewController">
|
||||
@@ -14,6 +16,7 @@
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<point key="canvasLocation" x="140" y="147"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
Reference in New Issue
Block a user