Fixed clipped button in Icon Editor

Set monospaced font on password attribute editor
This commit is contained in:
Michael Starke
2022-03-16 15:20:19 +01:00
parent 36ad08ba25
commit 14b9fd8d8f
4 changed files with 18 additions and 16 deletions

View File

@@ -107,20 +107,19 @@
}
- (id)supplementalTargetForAction:(SEL)action sender:(id)sender {
NSLog(@"First Responder:%@",self.view.window.firstResponder);
NSLog(@"Looking for target for action:%@", NSStringFromSelector(action));
// NSLog(@"Looking for target for action:%@", NSStringFromSelector(action));
for(NSViewController *childViewController in self.childViewControllers) {
if([childViewController respondsToSelector:action]) {
NSLog(@"Found target:%@ for action:%@", childViewController, NSStringFromSelector(action));
// NSLog(@"Found target:%@ for action:%@", childViewController, NSStringFromSelector(action));
return childViewController;
}
else {
id target = [childViewController supplementalTargetForAction:action sender:sender];
if(!target) {
NSLog(@"No target for action:%@", NSStringFromSelector(action));
// NSLog(@"No target for action:%@", NSStringFromSelector(action));
continue;
}
NSLog(@"Found supplemental target:%@ for action:%@", target, NSStringFromSelector(action));
// NSLog(@"Found supplemental target:%@ for action:%@", target, NSStringFromSelector(action));
return target;
}
}

View File

@@ -80,6 +80,8 @@ NSString *nameForDefaultKey(NSString *key) {
NSConditionallySetsHiddenBindingOption : @(NO),
NSConditionallySetsEnabledBindingOption : @(NO),
NSConditionallySetsEditableBindingOption : @(NO) };
NSString *valueKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(value))];
if(self.isDefaultAttributeEditor) {
valueKeyPath = [NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)),NSStringFromSelector(@selector(entry)), NSStringFromSelector(self.attributeSelector)];
@@ -98,8 +100,9 @@ NSString *nameForDefaultKey(NSString *key) {
}
if(self.isPasswordAttributeEditor) {
self.toggleProtectedButton.image = [NSImage imageNamed:NSImageNameQuickLookTemplate];
NSFont *font = [NSFont fontWithName:@"Menlo-Regular" size:13.0];
self.valueTextField.font = font;
// TODO: setup pretty password value transformer
// TODO: setup Monospaced Font
}
[self updateValuesAndEditing];
}

View File

@@ -23,7 +23,7 @@
<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">
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="2" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="No7-P9-4cl">
<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">
@@ -35,10 +35,10 @@
</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="436" height="28"/>
<rect key="frame" x="0.0" y="0.0" width="436" height="34"/>
<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="4" width="236" height="21"/>
<rect key="frame" x="0.0" y="7" 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"/>
@@ -49,21 +49,21 @@
</connections>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hAk-oD-dCj">
<rect key="frame" x="234" y="-3" width="44" height="32"/>
<rect key="frame" x="234" y="0.0" 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="269" y="-3" width="44" height="32"/>
<rect key="frame" x="269" y="0.0" 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"/>
<rect key="frame" x="304" y="0.0" 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"/>
@@ -73,7 +73,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gab-tS-gBb">
<rect key="frame" x="386" y="-1" width="56" height="27"/>
<rect key="frame" x="386" y="2" 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"/>

View File

@@ -29,7 +29,7 @@
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="09t-w3-euN"/>
</imageView>
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="xou-fD-adZ">
<rect key="frame" x="38" y="8" width="407" height="16"/>
<rect key="frame" x="38" y="8" width="406" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="aKF-2z-5ob">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -37,7 +37,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0HE-hi-9Hm">
<rect key="frame" x="444" y="-1" width="58" height="32"/>
<rect key="frame" x="443" y="-1" width="58" height="32"/>
<buttonCell key="cell" type="push" title="Edit" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ueF-MQ-zDV">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
<font key="font" metaFont="system"/>
@@ -53,7 +53,7 @@
<constraint firstAttribute="bottom" secondItem="7kO-Kv-UI5" secondAttribute="bottom" id="DhE-aA-Ovp"/>
<constraint firstItem="xou-fD-adZ" firstAttribute="leading" secondItem="7kO-Kv-UI5" secondAttribute="trailing" constant="8" symbolic="YES" id="Elf-Iw-tmF"/>
<constraint firstItem="0HE-hi-9Hm" firstAttribute="leading" secondItem="xou-fD-adZ" secondAttribute="trailing" constant="8" symbolic="YES" id="J5A-t9-uim"/>
<constraint firstAttribute="trailing" secondItem="0HE-hi-9Hm" secondAttribute="trailing" id="QL9-uh-tCj"/>
<constraint firstAttribute="trailing" secondItem="0HE-hi-9Hm" secondAttribute="trailing" constant="1" id="QL9-uh-tCj"/>
<constraint firstItem="7kO-Kv-UI5" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="axe-Q2-16O"/>
<constraint firstItem="7kO-Kv-UI5" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="nCQ-tS-CIv"/>
</constraints>