Enable automatic row height for 10.13 in custom fields. Fixed #27

This commit is contained in:
Michael Starke
2018-08-27 17:10:55 +02:00
parent c74254f171
commit cbcd9fb751
2 changed files with 15 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -46,7 +46,7 @@
<rect key="frame" x="0.0" y="0.0" width="293" height="493"/>
<subviews>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="82">
<rect key="frame" x="64" y="469" width="166" height="19"/>
<rect key="frame" x="57" y="469" width="179" height="19"/>
<segmentedCell key="cell" controlSize="small" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="238">
<font key="font" metaFont="smallSystem"/>
<segments>
@@ -105,7 +105,7 @@
<color key="backgroundColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="248" minWidth="40" maxWidth="1000" id="140">
<tableColumn identifier="" width="248" minWidth="40" maxWidth="1000" id="140">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -265,7 +265,7 @@
<rect key="frame" x="0.0" y="0.0" width="291" height="712"/>
<subviews>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="52">
<rect key="frame" x="18" y="693" width="28" height="14"/>
<rect key="frame" x="18" y="693" width="27" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Title" id="71">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -467,7 +467,7 @@
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G9J-nn-2bu" customClass="MPContextButton">
<rect key="frame" x="220" y="100" width="51" height="25"/>
<rect key="frame" x="216" y="101" width="55" height="23"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedRounded" trackingMode="selectOne" id="POU-2t-8fl">
<font key="font" metaFont="system"/>
<segments>
@@ -594,7 +594,7 @@
<rect key="frame" x="20" y="138" width="261" height="160"/>
<clipView key="contentView" id="aDE-WT-YIv">
<rect key="frame" x="1" y="1" width="259" height="158"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="caM-L6-UHC">
<rect key="frame" x="0.0" y="0.0" width="259" height="158"/>
@@ -603,7 +603,7 @@
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="256" minWidth="40" maxWidth="1000" id="Wdn-k1-39b">
<tableColumn identifier="" width="256" minWidth="40" maxWidth="1000" id="Wdn-k1-39b">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -805,7 +805,7 @@
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="256" minWidth="40" maxWidth="1000000" id="194">
<tableColumn identifier="" width="256" minWidth="40" maxWidth="1000000" id="194">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -825,7 +825,7 @@
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="199" customClass="HNHUIRoundedSecureTextField">
<rect key="frame" x="3" y="10" width="139" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="212"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="22" id="212"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="213"/>
</constraints>
<textFieldCell key="cell" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Value" drawsBackground="YES" id="214">

View File

@@ -137,6 +137,11 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
self.customFieldsTableView.translatesAutoresizingMaskIntoConstraints = NO;
NSView *customFieldTableView = self.customFieldsTableView;
[self.customFieldsTableView.enclosingScrollView removeFromSuperviewWithoutNeedingDisplay];
if (@available(macOS 10.13, *)) {
self.customFieldsTableView.usesAutomaticRowHeights = YES;
} else {
// Fallback on earlier versions
}
[self.generalView addSubview:customFieldTableView];