Skip to content

Commit

Permalink
Fixed incorrect table header height in manifest editor on OS X 10.10 …
Browse files Browse the repository at this point in the history
…and earlier.
  • Loading branch information
hjuutilainen committed Oct 22, 2015
1 parent bada32d commit 13a460a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 13 deletions.
6 changes: 6 additions & 0 deletions MunkiAdmin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
F59325A2191794150079398B /* _InstallerTypeSourceListItemMO.m in Sources */ = {isa = PBXBuildFile; fileRef = F59325A1191794150079398B /* _InstallerTypeSourceListItemMO.m */; };
F594407E10FF58E700E350E7 /* UserDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = F594407D10FF58E700E350E7 /* UserDefaults.plist */; };
F59B724813698044008229E8 /* MAGradientButtonBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = F59B724713698044008229E8 /* MAGradientButtonBarView.m */; };
F59D94221BD958AF004A9870 /* MATableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = F59D94211BD958AF004A9870 /* MATableHeaderView.m */; };
F5A2CD551AAF358E00A8466E /* calendar_ok.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F5A2CD541AAF358E00A8466E /* calendar_ok.pdf */; };
F5AB9B2E1B00939400875BA4 /* manifestConditionsTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F5AB9B2D1B00939400875BA4 /* manifestConditionsTemplate.pdf */; };
F5B0A0581A77A530006243E3 /* MAScriptRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = F5B0A0571A77A530006243E3 /* MAScriptRunner.m */; };
Expand Down Expand Up @@ -320,6 +321,8 @@
F594407D10FF58E700E350E7 /* UserDefaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = UserDefaults.plist; path = MunkiAdmin/UserDefaults.plist; sourceTree = "<group>"; };
F59B724613698044008229E8 /* MAGradientButtonBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAGradientButtonBarView.h; sourceTree = "<group>"; };
F59B724713698044008229E8 /* MAGradientButtonBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MAGradientButtonBarView.m; sourceTree = "<group>"; };
F59D94201BD958AF004A9870 /* MATableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MATableHeaderView.h; sourceTree = "<group>"; };
F59D94211BD958AF004A9870 /* MATableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MATableHeaderView.m; sourceTree = "<group>"; };
F5A11C6C195706C6005A39AE /* Warnings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
F5A2CD541AAF358E00A8466E /* calendar_ok.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = calendar_ok.pdf; path = MunkiAdmin/Graphics/calendar_ok.pdf; sourceTree = "<group>"; };
F5AB9B2D1B00939400875BA4 /* manifestConditionsTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = manifestConditionsTemplate.pdf; path = MunkiAdmin/Graphics/manifestConditionsTemplate.pdf; sourceTree = "<group>"; };
Expand Down Expand Up @@ -614,6 +617,8 @@
F5E333AC1AC52CC90078CAA6 /* MASolidBackgroundView.h */,
F5E333AD1AC52CC90078CAA6 /* MASolidBackgroundView.m */,
F5063423172F9F0300EF7728 /* RSVerticallyCenteredTextFieldCell */,
F59D94201BD958AF004A9870 /* MATableHeaderView.h */,
F59D94211BD958AF004A9870 /* MATableHeaderView.m */,
);
name = "View Classes";
path = "MunkiAdmin/View Classes";
Expand Down Expand Up @@ -1147,6 +1152,7 @@
F5FF3740125D9D7900AD5BC1 /* MAMunkiOperation.m in Sources */,
F565BC9D193719E1006884CA /* MADiskImageOperation.m in Sources */,
F514A714193DA44000C9027C /* MAImageBrowserItem.m in Sources */,
F59D94221BD958AF004A9870 /* MATableHeaderView.m in Sources */,
F5DFC878129546E200B68F4F /* ApplicationMO.m in Sources */,
F5DFC87A129546E200B68F4F /* ApplicationProxyMO.m in Sources */,
F5DFC87C129546E300B68F4F /* CatalogInfoMO.m in Sources */,
Expand Down
26 changes: 13 additions & 13 deletions MunkiAdmin/UI Controllers/MAManifestEditor.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<development version="6300" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9059"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MAManifestEditor">
Expand Down Expand Up @@ -42,7 +42,7 @@
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="196" y="240" width="777" height="466"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<value key="minSize" type="size" width="600" height="400"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="777" height="466"/>
Expand Down Expand Up @@ -235,7 +235,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="FnU-rn-3Dv">
<rect key="frame" x="0.0" y="0.0" width="338" height="190"/>
<rect key="frame" x="0.0" y="0.0" width="338" height="0.0"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
Expand Down Expand Up @@ -431,11 +431,11 @@
<animations/>
</view>
<constraints>
<constraint firstItem="rCw-Ts-Ixf" firstAttribute="top" secondItem="SSj-cf-Ib2" secondAttribute="top" constant="249" id="1ab-4a-Nmw"/>
<constraint firstAttribute="trailing" secondItem="rCw-Ts-Ixf" secondAttribute="trailing" constant="16" id="B7c-jT-zG4"/>
<constraint firstItem="rCw-Ts-Ixf" firstAttribute="leading" secondItem="SSj-cf-Ib2" secondAttribute="leading" constant="16" id="GIv-fo-51W"/>
<constraint firstAttribute="bottom" secondItem="rCw-Ts-Ixf" secondAttribute="bottom" constant="26" id="XuZ-WU-CJg"/>
<constraint firstItem="rCw-Ts-Ixf" firstAttribute="top" secondItem="SSj-cf-Ib2" secondAttribute="top" constant="249" id="BD3-Ll-ub7"/>
<constraint firstAttribute="width" constant="372" id="iI8-jH-ZWP"/>
<constraint firstAttribute="bottom" secondItem="rCw-Ts-Ixf" secondAttribute="bottom" constant="26" id="j9U-L7-uLb"/>
<constraint firstItem="rCw-Ts-Ixf" firstAttribute="leading" secondItem="SSj-cf-Ib2" secondAttribute="leading" constant="16" id="lJW-JQ-Mwh"/>
<constraint firstAttribute="trailing" secondItem="rCw-Ts-Ixf" secondAttribute="trailing" constant="16" id="n3X-qz-Jkj"/>
</constraints>
<animations/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -635,7 +635,7 @@
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
<tableHeaderView key="headerView" id="GdV-7o-fS0">
<tableHeaderView key="headerView" id="GdV-7o-fS0" customClass="MATableHeaderView">
<rect key="frame" x="0.0" y="0.0" width="481" height="23"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
Expand Down Expand Up @@ -902,7 +902,7 @@
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
<tableHeaderView key="headerView" id="Usy-y0-z5N">
<tableHeaderView key="headerView" id="Usy-y0-z5N" customClass="MATableHeaderView">
<rect key="frame" x="0.0" y="0.0" width="481" height="23"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
Expand Down Expand Up @@ -1127,7 +1127,7 @@
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
<tableHeaderView key="headerView" id="61a-5g-rch">
<tableHeaderView key="headerView" id="61a-5g-rch" customClass="MATableHeaderView">
<rect key="frame" x="0.0" y="0.0" width="481" height="23"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
Expand Down Expand Up @@ -1254,7 +1254,7 @@
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="322.41796875" minWidth="40" maxWidth="1000" id="83t-Jr-VWB">
<tableColumn width="321.91796875" minWidth="40" maxWidth="1000" id="83t-Jr-VWB">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Condition">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -1365,7 +1365,7 @@
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
<tableHeaderView key="headerView" id="mZf-sd-xAQ">
<tableHeaderView key="headerView" id="mZf-sd-xAQ" customClass="MATableHeaderView">
<rect key="frame" x="0.0" y="0.0" width="481" height="23"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
Expand Down
13 changes: 13 additions & 0 deletions MunkiAdmin/View Classes/MATableHeaderView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// MATableHeaderView.h
// MunkiAdmin
//
// Created by Hannes Juutilainen on 22.10.2015.
//
//

#import <Cocoa/Cocoa.h>

@interface MATableHeaderView : NSTableHeaderView

@end
35 changes: 35 additions & 0 deletions MunkiAdmin/View Classes/MATableHeaderView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// MATableHeaderView.m
// MunkiAdmin
//
// Created by Hannes Juutilainen on 22.10.2015.
//
//

#import "MATableHeaderView.h"

@implementation MATableHeaderView

- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
}

- (NSRect)frame
{
/*
Override table view header height on OS X 10.10 and earlier
Based on http://stackoverflow.com/questions/32712561/backward-compatibility-of-header-hight-of-nstableview-with-os-x-10-11
*/
NSRect fixedFrame = [super frame];
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10_Max) {
/* on a 10.10.x system */
fixedFrame.size.height = 17;
} else {
/* 10.11 or later system */
}
return fixedFrame;
}


@end

0 comments on commit 13a460a

Please sign in to comment.