Browse Source

Now customize with different fonts!

v1.2.1
Abhishek Banthia 9 years ago
parent
commit
2a92e6ac1f
  1. 3
      Clocker.xcodeproj/project.pbxproj
  2. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  3. 3
      Clocker/CLOneWindow/CLOneWindow.xib
  4. 6
      Clocker/CLOneWindow/CLOneWindowController.h
  5. 7
      Clocker/CLOneWindow/CLOneWindowController.m
  6. 1
      Clocker/Custom Table Cell Views/CLTimezoneCellView.h
  7. 7
      Clocker/Custom Table Cell Views/CLTimezoneCellView.m
  8. 6
      Clocker/Panel.xib
  9. 1
      Clocker/PanelController.h
  10. 9
      Clocker/PanelController.m
  11. 139
      Clocker/Preferences/CLPreferencesView.xib
  12. 2
      Clocker/Preferences/CLPreferencesViewController.h
  13. 57
      Clocker/Preferences/CLPreferencesViewController.m
  14. 21
      Media.xcassets/Black Theme.imageset/Contents.json
  15. BIN
      Media.xcassets/Black Theme.imageset/Screen Shot 2015-12-13 at 3.26.58 AM.png
  16. 21
      Media.xcassets/White Theme.imageset/Contents.json
  17. BIN
      Media.xcassets/White Theme.imageset/Screen Shot 2015-12-13 at 3.27.22 AM.png

3
Clocker.xcodeproj/project.pbxproj

@ -410,6 +410,9 @@
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = DD4F7BF913C30F9F00825C6E;
productRefGroup = DD4F7C0513C30F9F00825C6E /* Products */;
projectDirPath = "";

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

3
Clocker/CLOneWindow/CLOneWindow.xib

@ -27,7 +27,6 @@
<action selector="openPreferences:" target="-2" id="rJI-gB-Gcb"/>
</connections>
</toolbarItem>
<toolbarItem implicitItemIdentifier="3BF08920-522C-482A-93B1-0425F8C1FBA3" label="Appearance" paletteLabel="Appearance" tag="-1" image="NSComputer" autovalidates="NO" id="hOs-51-YmZ"/>
<toolbarItem implicitItemIdentifier="B5E58161-D319-4490-AD3C-CED0C67FD50E" label="Appearance" paletteLabel="About Us" tag="-1" image="NSInfo" autovalidates="NO" id="ti4-MJ-8Xu">
<connections>
<action selector="openAboutUsView:" target="-2" id="Aec-lN-CqR"/>
@ -36,7 +35,6 @@
</allowedToolbarItems>
<defaultToolbarItems>
<toolbarItem reference="Khj-zc-D5t"/>
<toolbarItem reference="hOs-51-YmZ"/>
<toolbarItem reference="ti4-MJ-8Xu"/>
</defaultToolbarItems>
</toolbar>
@ -47,7 +45,6 @@
</window>
</objects>
<resources>
<image name="NSComputer" width="32" height="32"/>
<image name="NSHomeTemplate" width="14" height="14"/>
<image name="NSInfo" width="32" height="32"/>
</resources>

6
Clocker/CLOneWindow/CLOneWindowController.h

@ -12,12 +12,6 @@
@interface CLOneWindowController : NSWindowController
typedef enum : NSUInteger {
GeneralPane,
AppearancePane,
AboutUsPane
}PaneSelection;
@property (strong, nonatomic) CLPreferencesViewController *preferencesView;
@property (strong, nonatomic) CLAboutUsViewController *aboutUsView;

7
Clocker/CLOneWindow/CLOneWindowController.m

@ -45,7 +45,6 @@ static CLOneWindowController *sharedWindow = nil;
- (IBAction)openPreferences:(id)sender
{
self.preferencesView = [[CLPreferencesViewController alloc] initWithNibName:@"CLPreferencesView" bundle:nil];
[self setWindowWithContentView:self.preferencesView.view];
[self.aboutUsView.view removeFromSuperview];
@ -60,11 +59,11 @@ static CLOneWindowController *sharedWindow = nil;
- (IBAction)openAboutUsView:(id)sender
{
[self.preferencesView.view removeFromSuperview];
self.preferencesView = nil;
self.aboutUsView = [[CLAboutUsViewController alloc] initWithNibName:@"CLAboutUsView" bundle:nil];
[self setWindowWithContentView:self.aboutUsView.view];
[self.preferencesView.view removeFromSuperview];
self.preferencesView = nil;
}
@end

1
Clocker/Custom Table Cell Views/CLTimezoneCellView.h

@ -14,5 +14,6 @@
@property (weak) IBOutlet NSTextField *relativeDate;
@property (weak) IBOutlet NSTextField *time;
@property (nonatomic) NSInteger rowNumber;
- (void)updateFontFamilyWithFontName:(NSString *)fontName andCell:(CLTimezoneCellView*)cell;
@end

7
Clocker/Custom Table Cell Views/CLTimezoneCellView.m

@ -45,4 +45,11 @@
}
}
- (void)updateFontFamilyWithFontName:(NSString *)fontName andCell:(CLTimezoneCellView*)cell
{
cell.relativeDate.font = [NSFont fontWithName:fontName size:13];
cell.customName.font = [NSFont fontWithName:fontName size:15];
cell.time.font = [NSFont fontWithName:fontName size:31];
}
@end

6
Clocker/Panel.xib

@ -85,9 +85,9 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="101" translatesAutoresizingMaskIntoConstraints="NO" id="vnv-J2-7r1">
<rect key="frame" x="169" y="17" width="104" height="33"/>
<rect key="frame" x="169" y="8" width="104" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="33" id="3WU-de-OQL"/>
<constraint firstAttribute="height" constant="45" id="3WU-de-OQL"/>
<constraint firstAttribute="width" constant="100" id="cQV-gJ-zMz"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" placeholderString="23:46" id="g8s-EU-UHx">
@ -100,7 +100,7 @@
<constraints>
<constraint firstItem="QUd-7D-q14" firstAttribute="leading" secondItem="qbN-ba-fho" secondAttribute="leading" constant="10" id="0Qz-Ev-efP"/>
<constraint firstItem="etF-33-bCB" firstAttribute="top" secondItem="qbN-ba-fho" secondAttribute="top" constant="8" id="Lct-kG-usb"/>
<constraint firstItem="vnv-J2-7r1" firstAttribute="centerY" secondItem="qbN-ba-fho" secondAttribute="centerY" constant="-3.5" id="TuQ-gE-ZUh"/>
<constraint firstItem="vnv-J2-7r1" firstAttribute="centerY" secondItem="qbN-ba-fho" secondAttribute="centerY" constant="-0.5" id="TuQ-gE-ZUh"/>
<constraint firstItem="QUd-7D-q14" firstAttribute="top" secondItem="etF-33-bCB" secondAttribute="bottom" constant="-5" id="VO6-Zn-eA3"/>
<constraint firstItem="etF-33-bCB" firstAttribute="leading" secondItem="qbN-ba-fho" secondAttribute="leading" constant="10" id="ueW-ow-ZRq"/>
<constraint firstAttribute="trailing" secondItem="vnv-J2-7r1" secondAttribute="trailing" constant="8" id="zXo-eA-0bQ"/>

1
Clocker/PanelController.h

@ -56,7 +56,6 @@
@property (nonatomic, strong) NSMutableArray *defaultPreferences;
@property (nonatomic) BOOL hasActivePanel;
@property (nonatomic) NSInteger previousSelectedRow; //for color changes on row selection
@property (nonatomic, unsafe_unretained, readonly) id<PanelControllerDelegate> delegate;
@property (weak) IBOutlet NSTableView *mainTableview;

9
Clocker/PanelController.m

@ -274,10 +274,15 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell";
CLRatingCellView *cellView = [self.mainTableview makeViewWithIdentifier:CLRatingCellViewIdentifier owner:self];
return cellView;
}
CLTimezoneCellView *cell = [tableView makeViewWithIdentifier:CLTimezoneCellViewIdentifier owner:self];
NSString *fontFamily = [[NSUserDefaults standardUserDefaults] objectForKey:@"defaultFontFamily"];
if (fontFamily.length > 0)
{
[cell updateFontFamilyWithFontName:fontFamily andCell:cell];
}
cell.relativeDate.stringValue = [self getDateForTimeZone:self.defaultPreferences[row][CLTimezoneName]];

139
Clocker/Preferences/CLPreferencesView.xib

@ -7,9 +7,11 @@
<customObject id="-2" userLabel="File's Owner" customClass="CLPreferencesViewController">
<connections>
<outlet property="availableTimezoneTableView" destination="Q0t-hQ-orw" id="vQv-rd-Wkv"/>
<outlet property="fontPopUp" destination="adA-dB-5Ok" id="FK1-Pq-eXW"/>
<outlet property="is24HourFormatSelected" destination="msw-L5-agF" id="Orm-wH-Yr8"/>
<outlet property="messageLabel" destination="KFC-NV-5A3" id="NKB-JY-Udb"/>
<outlet property="searchField" destination="biT-6m-ElR" id="Di3-QU-LGY"/>
<outlet property="themePopUp" destination="sfL-D2-aUX" id="G3Z-Nv-eVe"/>
<outlet property="timezonePanel" destination="6FL-fp-Ke1" id="SDq-Q4-hMb"/>
<outlet property="timezoneTableView" destination="LbJ-dW-ITm" id="tRO-Ch-Was"/>
<outlet property="view" destination="Uu9-io-frR" id="bYk-D1-SUF"/>
@ -18,11 +20,11 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<view id="Uu9-io-frR">
<rect key="frame" x="0.0" y="0.0" width="439" height="373"/>
<rect key="frame" x="0.0" y="0.0" width="439" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button toolTip="Add a timezone" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4yB-vZ-tNX">
<rect key="frame" x="11" y="67" width="21" height="22"/>
<rect key="frame" x="11" y="154" width="21" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="GNz-C9-Ay8"/>
<constraint firstAttribute="width" constant="21" id="OkY-Uq-PwX"/>
@ -36,7 +38,7 @@
</connections>
</button>
<button toolTip="Remove a timezone" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iOG-Ey-lmD">
<rect key="frame" x="32" y="67" width="21" height="22"/>
<rect key="frame" x="32" y="154" width="21" height="22"/>
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="gLH-wy-bCE">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -46,9 +48,9 @@
</connections>
</button>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zBR-OH-6QQ">
<rect key="frame" x="10" y="94" width="419" height="271"/>
<rect key="frame" x="10" y="181" width="419" height="271"/>
<clipView key="contentView" id="UZ2-JA-TZe">
<rect key="frame" x="0.0" y="23" width="419" height="248"/>
<rect key="frame" x="0.0" y="0.0" width="419" height="271"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveColumns="NO" rowHeight="20" headerView="igm-uc-1wh" id="LbJ-dW-ITm">
@ -107,7 +109,7 @@
</tableHeaderView>
</scrollView>
<button toolTip="Clocker will start on each system launch" translatesAutoresizingMaskIntoConstraints="NO" id="i4I-JP-QcP" customClass="ColoredButton">
<rect key="frame" x="9" y="18" width="191" height="18"/>
<rect key="frame" x="167" y="106" width="191" height="18"/>
<buttonCell key="cell" type="check" title="Start Clocker on system startup" bezelStyle="regularSquare" imagePosition="left" inset="2" id="GSg-4f-ngw">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" size="12" name="Helvetica-Light"/>
@ -117,7 +119,7 @@
</connections>
</button>
<button toolTip="Show time using a 24-hour format" translatesAutoresizingMaskIntoConstraints="NO" id="msw-L5-agF" customClass="ColoredButton">
<rect key="frame" x="9" y="40" width="343" height="22"/>
<rect key="frame" x="167" y="127" width="343" height="22"/>
<constraints>
<constraint firstAttribute="width" constant="339" id="KXG-qX-V3N"/>
<constraint firstAttribute="height" constant="18" id="d60-FM-DPd"/>
@ -131,23 +133,136 @@
<binding destination="1Gq-ZQ-IML" name="value" keyPath="values.is24HourFormatSelected" id="KjZ-gp-ipG"/>
</connections>
</button>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="adA-dB-5Ok">
<rect key="frame" x="167" y="47" width="179" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="174" id="Iav-7m-gZ5"/>
</constraints>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" imagePosition="overlaps" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="fI5-8y-GjM" id="3QE-QI-x3u">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="12" name="HelveticaNeue-Thin"/>
<menu key="menu" id="cF5-QZ-Ydw">
<items>
<menuItem state="on" id="fI5-8y-GjM"/>
<menuItem title="Item 2" id="0wt-P7-TFr"/>
<menuItem title="Item 3" id="i2R-uY-UOg"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="changeFont:" target="-2" id="hsn-H5-o4c"/>
<binding destination="-2" name="content" keyPath="self.fontFamilies" id="JZm-hy-Yzo"/>
<binding destination="1Gq-ZQ-IML" name="selectedValue" keyPath="values.defaultFontFamily" previousBinding="JZm-hy-Yzo" id="olU-xe-W4j"/>
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sfL-D2-aUX">
<rect key="frame" x="167" y="75" width="179" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="174" id="AQn-7i-cfu"/>
</constraints>
<popUpButtonCell key="cell" type="push" title="Default" bezelStyle="rounded" imagePosition="overlaps" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="wIH-hb-kKL" id="tDC-SX-9j7">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="12" name="HelveticaNeue-Thin"/>
<menu key="menu" id="A5x-kq-ASo">
<items>
<menuItem title="Default" state="on" id="wIH-hb-kKL"/>
<menuItem title="Item 2" id="z5C-7z-5Lv"/>
<menuItem title="Item 3" id="1qC-i0-ODT"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="changeTheme:" target="-2" id="EJf-VX-AVu"/>
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wtb-He-7BA">
<rect key="frame" x="95" y="51" width="64" height="19"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="Whm-eI-Qun"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Font Family:" id="fIc-YC-zol">
<font key="font" size="12" name="HelveticaNeue-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="O5B-d7-PCv">
<rect key="frame" x="167" y="18" width="178" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="174" id="kRc-ia-rK2"/>
<constraint firstAttribute="height" constant="23" id="kms-1V-OhO"/>
</constraints>
<sliderCell key="cell" state="on" alignment="left" minValue="50" maxValue="100" doubleValue="100" tickMarkPosition="above" numberOfTickMarks="10" sliderType="linear" id="fMg-bG-aoC"/>
<connections>
<action selector="changeTransparency:" target="-2" id="OT6-WO-Y0P"/>
</connections>
</slider>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="U8n-2q-SGh">
<rect key="frame" x="85" y="21" width="77" height="19"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Transparency:" id="1cy-6f-zq4">
<font key="font" size="12" name="HelveticaNeue-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RVw-E8-jnc">
<rect key="frame" x="119" y="79" width="43" height="19"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Theme:" id="Fxt-Z4-w4Z">
<font key="font" size="12" name="HelveticaNeue-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Dx5-9L-nPB">
<rect key="frame" x="113" y="106" width="46" height="19"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Launch:" id="AYA-cO-ArR">
<font key="font" size="12" name="HelveticaNeue-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EdZ-8X-JQg">
<rect key="frame" x="86" y="129" width="73" height="19"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Time Format:" id="KxG-3S-ZCz">
<font key="font" size="12" name="HelveticaNeue-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="i4I-JP-QcP" secondAttribute="bottom" constant="20" id="3oZ-4h-9HU"/>
<constraint firstAttribute="bottom" secondItem="U8n-2q-SGh" secondAttribute="bottom" constant="21" id="1E4-CQ-9dG"/>
<constraint firstItem="sfL-D2-aUX" firstAttribute="top" secondItem="i4I-JP-QcP" secondAttribute="bottom" constant="9" id="7cF-n8-BQL"/>
<constraint firstItem="adA-dB-5Ok" firstAttribute="top" secondItem="sfL-D2-aUX" secondAttribute="bottom" constant="7" id="8lc-ds-Esz"/>
<constraint firstItem="Dx5-9L-nPB" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="115" id="BV7-hK-dBd"/>
<constraint firstItem="msw-L5-agF" firstAttribute="top" secondItem="4yB-vZ-tNX" secondAttribute="bottom" constant="8" id="CnR-dg-KfG"/>
<constraint firstItem="iOG-Ey-lmD" firstAttribute="height" secondItem="4yB-vZ-tNX" secondAttribute="height" id="HKt-is-5y3"/>
<constraint firstAttribute="bottom" secondItem="O5B-d7-PCv" secondAttribute="bottom" constant="20" id="HkH-bC-aJN"/>
<constraint firstItem="zBR-OH-6QQ" firstAttribute="top" secondItem="Uu9-io-frR" secondAttribute="top" constant="8" id="JKn-gF-8oI"/>
<constraint firstItem="i4I-JP-QcP" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="11" id="QAx-JY-Iyc"/>
<constraint firstItem="O5B-d7-PCv" firstAttribute="leading" secondItem="U8n-2q-SGh" secondAttribute="trailing" constant="9" id="MuT-RY-fw8"/>
<constraint firstItem="U8n-2q-SGh" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="87" id="OiS-VT-dFr"/>
<constraint firstItem="i4I-JP-QcP" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="169" id="QAx-JY-Iyc"/>
<constraint firstItem="O5B-d7-PCv" firstAttribute="top" secondItem="adA-dB-5Ok" secondAttribute="bottom" constant="7" id="UFV-Pv-6wo"/>
<constraint firstItem="Dx5-9L-nPB" firstAttribute="top" secondItem="EdZ-8X-JQg" secondAttribute="bottom" constant="4" id="Udf-Cm-OWA"/>
<constraint firstItem="msw-L5-agF" firstAttribute="top" secondItem="iOG-Ey-lmD" secondAttribute="bottom" constant="8" id="Umd-Jo-VZj"/>
<constraint firstItem="4yB-vZ-tNX" firstAttribute="top" secondItem="zBR-OH-6QQ" secondAttribute="bottom" constant="6" id="Zsk-85-aI8"/>
<constraint firstItem="RVw-E8-jnc" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="121" id="dyX-Sd-50z"/>
<constraint firstItem="sfL-D2-aUX" firstAttribute="leading" secondItem="RVw-E8-jnc" secondAttribute="trailing" constant="9" id="fzk-AD-jKY"/>
<constraint firstItem="U8n-2q-SGh" firstAttribute="top" secondItem="wtb-He-7BA" secondAttribute="bottom" constant="11" id="hxN-Pq-cUq"/>
<constraint firstItem="wtb-He-7BA" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="97" id="im6-yj-x5a"/>
<constraint firstItem="adA-dB-5Ok" firstAttribute="leading" secondItem="wtb-He-7BA" secondAttribute="trailing" constant="12" id="l3q-0l-VaZ"/>
<constraint firstItem="RVw-E8-jnc" firstAttribute="top" secondItem="Dx5-9L-nPB" secondAttribute="bottom" constant="8" id="mcI-AG-tvu"/>
<constraint firstAttribute="trailing" secondItem="zBR-OH-6QQ" secondAttribute="trailing" constant="10" id="p1P-Ev-oBI"/>
<constraint firstItem="i4I-JP-QcP" firstAttribute="top" secondItem="msw-L5-agF" secondAttribute="bottom" constant="8" id="pLv-GC-ciZ"/>
<constraint firstItem="msw-L5-agF" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="11" id="uwf-y2-ZwE"/>
<constraint firstItem="i4I-JP-QcP" firstAttribute="top" secondItem="msw-L5-agF" secondAttribute="bottom" constant="7" id="pLv-GC-ciZ"/>
<constraint firstItem="msw-L5-agF" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="169" id="uwf-y2-ZwE"/>
<constraint firstItem="wtb-He-7BA" firstAttribute="top" secondItem="RVw-E8-jnc" secondAttribute="bottom" constant="9" id="w2l-AG-0Y2"/>
<constraint firstItem="iOG-Ey-lmD" firstAttribute="width" secondItem="4yB-vZ-tNX" secondAttribute="width" id="wLJ-lQ-GhP"/>
<constraint firstItem="EdZ-8X-JQg" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="88" id="wmd-IT-K12"/>
<constraint firstItem="iOG-Ey-lmD" firstAttribute="leading" secondItem="4yB-vZ-tNX" secondAttribute="trailing" id="xu0-0C-2pe"/>
<constraint firstItem="4yB-vZ-tNX" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="11" id="zgB-PO-97r"/>
<constraint firstItem="zBR-OH-6QQ" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="10" id="zoH-62-nam"/>
</constraints>
<point key="canvasLocation" x="295.5" y="236"/>
</view>
<userDefaultsController representsSharedInstance="YES" id="1Gq-ZQ-IML"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hasShadow="NO" hidesOnDeactivate="YES" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="alertPanel" appearanceType="aqua" frameAutosaveName="" id="6FL-fp-Ke1" customClass="Panel">
@ -164,7 +279,7 @@
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LM9-75-vkc">
<rect key="frame" x="8" y="27" width="329" height="257"/>
<clipView key="contentView" id="Z7L-Ef-90Z">
<rect key="frame" x="0.0" y="23" width="329" height="234"/>
<rect key="frame" x="0.0" y="0.0" width="329" height="257"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" rowHeight="20" headerView="85y-4a-860" id="Q0t-hQ-orw">

2
Clocker/Preferences/CLPreferencesViewController.h

@ -14,5 +14,7 @@
@property (strong, nonatomic) NSMutableArray *selectedTimeZones;
@property (strong, nonatomic) NSArray *filteredArray;
@property (atomic, assign) BOOL launchOnLogin;
@property (atomic, strong) NSArray *fontFamilies;
@property (atomic, strong) NSArray *themes;
@end

57
Clocker/Preferences/CLPreferencesViewController.m

@ -24,10 +24,10 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
@property (weak) IBOutlet NSTableView *timezoneTableView;
@property (strong) IBOutlet Panel *timezonePanel;
@property (weak) IBOutlet NSPopUpButton *themePopUp;
@property (weak) IBOutlet NSPopUpButton *fontPopUp;
@property (weak) IBOutlet NSTableView *availableTimezoneTableView;
@property (weak) IBOutlet NSSearchField *searchField;
@property (weak) IBOutlet NSButton *is24HourFormatSelected;
@property (weak) IBOutlet NSTextField *messageLabel;
@ -52,7 +52,6 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
if (!self.timeZoneArray)
{
self.timeZoneArray = [[NSMutableArray alloc] initWithArray:[NSTimeZone knownTimeZoneNames]];
self.filteredArray = [[NSArray alloc] init];
}
@ -62,10 +61,34 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
//Register for drag and drop
[self.timezoneTableView registerForDraggedTypes: [NSArray arrayWithObject: CLDragSessionKey]];
NSMutableSet *sampleArray = [[NSMutableSet alloc] init];
NSFontCollection *fontCollection = [NSFontCollection fontCollectionWithName:@"com.apple.UserFonts"];
for (NSFontDescriptor *descriptor in fontCollection.matchingDescriptors) {
if ([descriptor objectForKey:@"NSFontFamilyAttribute"]) {
if (![sampleArray containsObject:[descriptor objectForKey:@"NSFontFamilyAttribute"]]) {
[sampleArray addObject:[descriptor objectForKey:@"NSFontFamilyAttribute"]];
}
}
}
if ([sampleArray containsObject:@"Apple Chancery"]) {
[sampleArray removeObject:@"Apple Chancery"];
[sampleArray removeObject:@"Zapfino"];
[sampleArray removeObject:@"Trattatello"];
[sampleArray removeObject:@"Noteworthy"];
}
self.fontFamilies = [[NSArray alloc] initWithArray:sampleArray.allObjects];
// Do view setup here.
}
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self
@ -407,4 +430,32 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
}
}
- (IBAction)changeTheme:(id)sender {
}
- (IBAction)changeFont:(id)sender
{
ApplicationDelegate *appDelegate = [[NSApplication sharedApplication] delegate];
PanelController *panelController = appDelegate.panelController;
}
- (IBAction)changeTransparency:(id)sender
{
ApplicationDelegate *appDelegate = [[NSApplication sharedApplication] delegate];
PanelController *panelController = appDelegate.panelController;
NSSlider *slider = (NSSlider *)sender;
if (![panelController.window isVisible])
{
[panelController openPanel];
}
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:0.10];
[[panelController.window animator] setAlphaValue:slider.floatValue/100];
[NSAnimationContext endGrouping];
}
@end

21
Media.xcassets/Black Theme.imageset/Contents.json vendored

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Screen Shot 2015-12-13 at 3.26.58 AM.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

BIN
Media.xcassets/Black Theme.imageset/Screen Shot 2015-12-13 at 3.26.58 AM.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

21
Media.xcassets/White Theme.imageset/Contents.json vendored

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Screen Shot 2015-12-13 at 3.27.22 AM.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

BIN
Media.xcassets/White Theme.imageset/Screen Shot 2015-12-13 at 3.27.22 AM.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Loading…
Cancel
Save