Skip to content

Commit 2e3265e

Browse files
committed
New icon + About window
1 parent e77f9ef commit 2e3265e

File tree

5 files changed

+70
-62
lines changed

5 files changed

+70
-62
lines changed

Assets/Icon.psd

1.39 MB
Binary file not shown.

ColorSet/Classes/AboutWindowController.swift

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2018 Jean-David Gadina - www.xs-labs.com
4+
* Copyright (c) 2018 Jean-David Gadina - www.imazing.com
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -24,26 +24,33 @@
2424

2525
import Cocoa
2626

27-
@objc class AboutWindowController: NSWindowController
27+
public class AboutWindowController: NSWindowController
2828
{
2929
@objc private dynamic var name: String?
3030
@objc private dynamic var version: String?
3131
@objc private dynamic var copyright: String?
3232

33-
override var windowNibName: NSNib.Name?
33+
public override var windowNibName: NSNib.Name?
3434
{
3535
return NSNib.Name( NSStringFromClass( type( of: self ) ) )
3636
}
3737

38-
override func windowDidLoad()
38+
override public func windowDidLoad()
3939
{
4040
super.windowDidLoad()
4141

42-
self.window?.titlebarAppearsTransparent = true
43-
self.window?.titleVisibility = .hidden
42+
let version = Bundle.main.object( forInfoDictionaryKey: "CFBundleShortVersionString" ) as? String ?? "0.0.0"
4443

45-
self.name = Bundle.main.object( forInfoDictionaryKey: "CFBundleName" ) as? String
46-
self.version = Bundle.main.object( forInfoDictionaryKey: "CFBundleShortVersionString" ) as? String
47-
self.copyright = Bundle.main.object( forInfoDictionaryKey: "NSHumanReadableCopyright" ) as? String
44+
if let build = Bundle.main.object( forInfoDictionaryKey: "CFBundleVersion" ) as? String
45+
{
46+
self.version = "\(version) (\(build))"
47+
}
48+
else
49+
{
50+
self.version = version
51+
}
52+
53+
self.name = Bundle.main.object( forInfoDictionaryKey: "CFBundleName" ) as? String
54+
self.copyright = Bundle.main.object( forInfoDictionaryKey: "NSHumanReadableCopyright" ) as? String
4855
}
4956
}

ColorSet/Classes/ApplicationDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class ApplicationDelegate: NSResponder, NSApplicationDelegate
6767
{
6868
self.aboutWindowController = AboutWindowController()
6969

70+
self.aboutWindowController?.window?.layoutIfNeeded()
7071
self.aboutWindowController?.window?.center()
7172
}
7273

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,99 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17506" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14269.12"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17506"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
9-
<customObject id="-2" userLabel="File's Owner" customClass="AboutWindowController" customModule="ColorSet" customModuleProvider="target">
9+
<customObject id="-2" userLabel="File's Owner" customClass="AboutWindowController" customModule="Xclean" customModuleProvider="target">
1010
<connections>
11-
<outlet property="window" destination="QvC-M9-y7g" id="3uC-xA-AhB"/>
11+
<outlet property="window" destination="QvC-M9-y7g" id="MQd-GZ-qWp"/>
1212
</connections>
1313
</customObject>
1414
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
1515
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
16-
<window title="About" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="QvC-M9-y7g">
16+
<window title="About Xclean" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="QvC-M9-y7g">
1717
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" fullSizeContentView="YES"/>
1818
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
19-
<rect key="contentRect" x="196" y="240" width="395" height="296"/>
20-
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
19+
<rect key="contentRect" x="196" y="240" width="277" height="168"/>
20+
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1175"/>
2121
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
22-
<rect key="frame" x="0.0" y="0.0" width="395" height="296"/>
22+
<rect key="frame" x="0.0" y="0.0" width="307" height="198"/>
2323
<autoresizingMask key="autoresizingMask"/>
2424
<subviews>
25-
<visualEffectView appearanceType="vibrantDark" blendingMode="behindWindow" material="appearanceBased" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="2na-Z2-u9Y">
26-
<rect key="frame" x="0.0" y="0.0" width="395" height="296"/>
25+
<visualEffectView blendingMode="behindWindow" material="underWindowBackground" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="ls5-I3-hMR">
26+
<rect key="frame" x="0.0" y="0.0" width="307" height="198"/>
2727
<subviews>
28-
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="H8T-8E-DDN">
29-
<rect key="frame" x="20" y="20" width="256" height="256"/>
28+
<imageView wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="bkJ-Ud-XM8">
29+
<rect key="frame" x="30" y="30" width="128" height="128"/>
3030
<constraints>
31-
<constraint firstAttribute="width" constant="256" id="HER-vU-ej4"/>
32-
<constraint firstAttribute="height" constant="256" id="tEO-yL-v7f"/>
31+
<constraint firstAttribute="width" constant="128" id="CSW-JZ-Wa6"/>
32+
<constraint firstAttribute="height" constant="128" id="kJV-3v-pYD"/>
3333
</constraints>
34-
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="NSApplicationIcon" id="6bs-kJ-2MD"/>
34+
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="NSApplicationIcon" id="GGX-kf-SmE"/>
3535
</imageView>
36-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eUO-Xh-gcg">
37-
<rect key="frame" x="282" y="176" width="95" height="24"/>
38-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="n4t-G6-Fj5">
39-
<font key="font" metaFont="systemThin" size="20"/>
36+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="c3B-11-Nnn">
37+
<rect key="frame" x="186" y="111" width="93" height="47"/>
38+
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Mhf-3U-WaO">
39+
<font key="font" metaFont="systemThin" size="40"/>
4040
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
41-
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
41+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
4242
</textFieldCell>
4343
<connections>
44-
<binding destination="-2" name="value" keyPath="version" id="9GC-rX-a5S"/>
44+
<binding destination="-2" name="value" keyPath="self.name" id="joW-A0-HfH"/>
4545
</connections>
4646
</textField>
47-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zOn-oh-QdP">
48-
<rect key="frame" x="282" y="55" width="95" height="17"/>
49-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="JEk-lW-tk0">
50-
<font key="font" metaFont="systemThin" size="13"/>
51-
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
52-
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
47+
<textField wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yLd-6Z-IaF">
48+
<rect key="frame" x="186" y="79" width="50" height="24"/>
49+
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="GPR-R9-Yud">
50+
<font key="font" metaFont="systemThin" size="20"/>
51+
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
52+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
5353
</textFieldCell>
5454
<connections>
55-
<binding destination="-2" name="value" keyPath="copyright" id="j3k-9t-5tC"/>
55+
<binding destination="-2" name="value" keyPath="self.version" id="zcF-Mv-hcv"/>
5656
</connections>
5757
</textField>
58-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2ba-9s-ZV8">
59-
<rect key="frame" x="282" y="208" width="95" height="48"/>
60-
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="UGy-b9-cuI">
61-
<font key="font" metaFont="systemThin" size="40"/>
62-
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
63-
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
58+
<textField wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qK4-am-2Hl">
59+
<rect key="frame" x="186" y="40" width="36" height="16"/>
60+
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="CqC-AJ-UHI">
61+
<font key="font" metaFont="systemThin" size="13"/>
62+
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
63+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
6464
</textFieldCell>
6565
<connections>
66-
<binding destination="-2" name="value" keyPath="name" id="OKL-6y-FGO"/>
66+
<binding destination="-2" name="value" keyPath="self.copyright" id="Q5j-jh-2rr"/>
6767
</connections>
6868
</textField>
6969
</subviews>
7070
<constraints>
71-
<constraint firstItem="H8T-8E-DDN" firstAttribute="top" secondItem="2na-Z2-u9Y" secondAttribute="top" constant="20" id="3I5-PH-yU3"/>
72-
<constraint firstItem="zOn-oh-QdP" firstAttribute="leading" secondItem="eUO-Xh-gcg" secondAttribute="leading" id="9z8-TQ-exV"/>
73-
<constraint firstItem="eUO-Xh-gcg" firstAttribute="top" secondItem="2ba-9s-ZV8" secondAttribute="bottom" constant="8" id="Ab9-it-JUm"/>
74-
<constraint firstAttribute="trailing" secondItem="zOn-oh-QdP" secondAttribute="trailing" constant="20" id="H1w-13-zMV"/>
75-
<constraint firstItem="eUO-Xh-gcg" firstAttribute="leading" secondItem="2ba-9s-ZV8" secondAttribute="leading" id="QtV-Me-2JH"/>
76-
<constraint firstAttribute="bottom" secondItem="zOn-oh-QdP" secondAttribute="bottom" constant="55" id="XKh-Lz-92q"/>
77-
<constraint firstAttribute="trailing" secondItem="eUO-Xh-gcg" secondAttribute="trailing" constant="20" id="ZzX-cc-IvF"/>
78-
<constraint firstAttribute="trailing" secondItem="2ba-9s-ZV8" secondAttribute="trailing" constant="20" id="a49-qe-KTA"/>
79-
<constraint firstItem="2ba-9s-ZV8" firstAttribute="top" secondItem="H8T-8E-DDN" secondAttribute="top" constant="20" id="hUd-bj-u1o"/>
80-
<constraint firstItem="H8T-8E-DDN" firstAttribute="leading" secondItem="2na-Z2-u9Y" secondAttribute="leading" constant="20" id="qEC-HE-IWz"/>
81-
<constraint firstAttribute="bottom" secondItem="H8T-8E-DDN" secondAttribute="bottom" constant="20" id="sib-85-ry4"/>
82-
<constraint firstItem="2ba-9s-ZV8" firstAttribute="leading" secondItem="H8T-8E-DDN" secondAttribute="trailing" constant="8" id="zlY-3J-nRY"/>
71+
<constraint firstItem="qK4-am-2Hl" firstAttribute="bottom" secondItem="bkJ-Ud-XM8" secondAttribute="bottom" constant="-10" id="4eU-i4-CHR"/>
72+
<constraint firstItem="c3B-11-Nnn" firstAttribute="leading" secondItem="bkJ-Ud-XM8" secondAttribute="trailing" constant="30" id="BpG-VA-Nxl"/>
73+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="yLd-6Z-IaF" secondAttribute="trailing" constant="30" id="IQu-ql-HkC"/>
74+
<constraint firstItem="qK4-am-2Hl" firstAttribute="leading" secondItem="c3B-11-Nnn" secondAttribute="leading" id="Yot-mk-hra"/>
75+
<constraint firstItem="bkJ-Ud-XM8" firstAttribute="top" secondItem="ls5-I3-hMR" secondAttribute="top" constant="40" id="bpQ-Rd-Kjd"/>
76+
<constraint firstItem="yLd-6Z-IaF" firstAttribute="top" secondItem="c3B-11-Nnn" secondAttribute="bottom" constant="8" id="cvA-Hq-TDd"/>
77+
<constraint firstItem="bkJ-Ud-XM8" firstAttribute="leading" secondItem="ls5-I3-hMR" secondAttribute="leading" constant="30" id="mLH-C3-hte"/>
78+
<constraint firstAttribute="bottom" secondItem="bkJ-Ud-XM8" secondAttribute="bottom" constant="30" id="nEf-eO-eJA"/>
79+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="c3B-11-Nnn" secondAttribute="trailing" constant="30" id="oqv-O4-gKi"/>
80+
<constraint firstItem="c3B-11-Nnn" firstAttribute="top" secondItem="bkJ-Ud-XM8" secondAttribute="top" id="ryd-fl-aVO"/>
81+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="qK4-am-2Hl" secondAttribute="trailing" constant="30" id="xUl-C7-IqA"/>
82+
<constraint firstItem="yLd-6Z-IaF" firstAttribute="leading" secondItem="c3B-11-Nnn" secondAttribute="leading" id="zma-HZ-8Vb"/>
8383
</constraints>
8484
</visualEffectView>
8585
</subviews>
8686
<constraints>
87-
<constraint firstItem="2na-Z2-u9Y" firstAttribute="width" secondItem="EiT-Mj-1SZ" secondAttribute="width" id="4dA-8n-C7v"/>
88-
<constraint firstItem="2na-Z2-u9Y" firstAttribute="centerY" secondItem="EiT-Mj-1SZ" secondAttribute="centerY" id="O55-qt-7R1"/>
89-
<constraint firstItem="2na-Z2-u9Y" firstAttribute="centerX" secondItem="EiT-Mj-1SZ" secondAttribute="centerX" id="dSe-Gv-BQM"/>
90-
<constraint firstItem="2na-Z2-u9Y" firstAttribute="height" secondItem="EiT-Mj-1SZ" secondAttribute="height" id="hu6-Xm-VtI"/>
87+
<constraint firstItem="ls5-I3-hMR" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" id="O6b-Af-UWg"/>
88+
<constraint firstItem="ls5-I3-hMR" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" id="OTa-DV-nY1"/>
89+
<constraint firstAttribute="trailing" secondItem="ls5-I3-hMR" secondAttribute="trailing" id="S6O-Rs-Cnd"/>
90+
<constraint firstAttribute="bottom" secondItem="ls5-I3-hMR" secondAttribute="bottom" id="hL3-Sx-v9S"/>
9191
</constraints>
9292
</view>
93-
<point key="canvasLocation" x="-53.5" y="-162"/>
93+
<point key="canvasLocation" x="37.5" y="147"/>
9494
</window>
9595
</objects>
9696
<resources>
97-
<image name="NSApplicationIcon" width="128" height="128"/>
97+
<image name="NSApplicationIcon" width="32" height="32"/>
9898
</resources>
9999
</document>

ColorSet/Interface/Icon.icns

-503 KB
Binary file not shown.

0 commit comments

Comments
 (0)