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. 7
      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"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = DD4F7BF913C30F9F00825C6E; mainGroup = DD4F7BF913C30F9F00825C6E;
productRefGroup = DD4F7C0513C30F9F00825C6E /* Products */; productRefGroup = DD4F7C0513C30F9F00825C6E /* Products */;
projectDirPath = ""; 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"/> <action selector="openPreferences:" target="-2" id="rJI-gB-Gcb"/>
</connections> </connections>
</toolbarItem> </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"> <toolbarItem implicitItemIdentifier="B5E58161-D319-4490-AD3C-CED0C67FD50E" label="Appearance" paletteLabel="About Us" tag="-1" image="NSInfo" autovalidates="NO" id="ti4-MJ-8Xu">
<connections> <connections>
<action selector="openAboutUsView:" target="-2" id="Aec-lN-CqR"/> <action selector="openAboutUsView:" target="-2" id="Aec-lN-CqR"/>
@ -36,7 +35,6 @@
</allowedToolbarItems> </allowedToolbarItems>
<defaultToolbarItems> <defaultToolbarItems>
<toolbarItem reference="Khj-zc-D5t"/> <toolbarItem reference="Khj-zc-D5t"/>
<toolbarItem reference="hOs-51-YmZ"/>
<toolbarItem reference="ti4-MJ-8Xu"/> <toolbarItem reference="ti4-MJ-8Xu"/>
</defaultToolbarItems> </defaultToolbarItems>
</toolbar> </toolbar>
@ -47,7 +45,6 @@
</window> </window>
</objects> </objects>
<resources> <resources>
<image name="NSComputer" width="32" height="32"/>
<image name="NSHomeTemplate" width="14" height="14"/> <image name="NSHomeTemplate" width="14" height="14"/>
<image name="NSInfo" width="32" height="32"/> <image name="NSInfo" width="32" height="32"/>
</resources> </resources>

6
Clocker/CLOneWindow/CLOneWindowController.h

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

7
Clocker/CLOneWindow/CLOneWindowController.m

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

1
Clocker/Custom Table Cell Views/CLTimezoneCellView.h

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

6
Clocker/Panel.xib

@ -85,9 +85,9 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="101" translatesAutoresizingMaskIntoConstraints="NO" id="vnv-J2-7r1"> <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> <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"/> <constraint firstAttribute="width" constant="100" id="cQV-gJ-zMz"/>
</constraints> </constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" placeholderString="23:46" id="g8s-EU-UHx"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" placeholderString="23:46" id="g8s-EU-UHx">
@ -100,7 +100,7 @@
<constraints> <constraints>
<constraint firstItem="QUd-7D-q14" firstAttribute="leading" secondItem="qbN-ba-fho" secondAttribute="leading" constant="10" id="0Qz-Ev-efP"/> <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="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="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 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"/> <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, strong) NSMutableArray *defaultPreferences;
@property (nonatomic) BOOL hasActivePanel; @property (nonatomic) BOOL hasActivePanel;
@property (nonatomic) NSInteger previousSelectedRow; //for color changes on row selection
@property (nonatomic, unsafe_unretained, readonly) id<PanelControllerDelegate> delegate; @property (nonatomic, unsafe_unretained, readonly) id<PanelControllerDelegate> delegate;
@property (weak) IBOutlet NSTableView *mainTableview; @property (weak) IBOutlet NSTableView *mainTableview;

7
Clocker/PanelController.m

@ -275,9 +275,14 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell";
return cellView; return cellView;
} }
CLTimezoneCellView *cell = [tableView makeViewWithIdentifier:CLTimezoneCellViewIdentifier owner:self]; 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]]; 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"> <customObject id="-2" userLabel="File's Owner" customClass="CLPreferencesViewController">
<connections> <connections>
<outlet property="availableTimezoneTableView" destination="Q0t-hQ-orw" id="vQv-rd-Wkv"/> <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="is24HourFormatSelected" destination="msw-L5-agF" id="Orm-wH-Yr8"/>
<outlet property="messageLabel" destination="KFC-NV-5A3" id="NKB-JY-Udb"/> <outlet property="messageLabel" destination="KFC-NV-5A3" id="NKB-JY-Udb"/>
<outlet property="searchField" destination="biT-6m-ElR" id="Di3-QU-LGY"/> <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="timezonePanel" destination="6FL-fp-Ke1" id="SDq-Q4-hMb"/>
<outlet property="timezoneTableView" destination="LbJ-dW-ITm" id="tRO-Ch-Was"/> <outlet property="timezoneTableView" destination="LbJ-dW-ITm" id="tRO-Ch-Was"/>
<outlet property="view" destination="Uu9-io-frR" id="bYk-D1-SUF"/> <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="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/>
<view id="Uu9-io-frR"> <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"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button toolTip="Add a timezone" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4yB-vZ-tNX"> <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> <constraints>
<constraint firstAttribute="height" constant="20" id="GNz-C9-Ay8"/> <constraint firstAttribute="height" constant="20" id="GNz-C9-Ay8"/>
<constraint firstAttribute="width" constant="21" id="OkY-Uq-PwX"/> <constraint firstAttribute="width" constant="21" id="OkY-Uq-PwX"/>
@ -36,7 +38,7 @@
</connections> </connections>
</button> </button>
<button toolTip="Remove a timezone" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iOG-Ey-lmD"> <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"> <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"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
@ -46,9 +48,9 @@
</connections> </connections>
</button> </button>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zBR-OH-6QQ"> <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"> <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"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <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"> <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> </tableHeaderView>
</scrollView> </scrollView>
<button toolTip="Clocker will start on each system launch" translatesAutoresizingMaskIntoConstraints="NO" id="i4I-JP-QcP" customClass="ColoredButton"> <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"> <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"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" size="12" name="Helvetica-Light"/> <font key="font" size="12" name="Helvetica-Light"/>
@ -117,7 +119,7 @@
</connections> </connections>
</button> </button>
<button toolTip="Show time using a 24-hour format" translatesAutoresizingMaskIntoConstraints="NO" id="msw-L5-agF" customClass="ColoredButton"> <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> <constraints>
<constraint firstAttribute="width" constant="339" id="KXG-qX-V3N"/> <constraint firstAttribute="width" constant="339" id="KXG-qX-V3N"/>
<constraint firstAttribute="height" constant="18" id="d60-FM-DPd"/> <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"/> <binding destination="1Gq-ZQ-IML" name="value" keyPath="values.is24HourFormatSelected" id="KjZ-gp-ipG"/>
</connections> </connections>
</button> </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> </subviews>
<constraints> <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="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 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="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="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="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 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="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="11" id="uwf-y2-ZwE"/> <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="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="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="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"/> <constraint firstItem="zBR-OH-6QQ" firstAttribute="leading" secondItem="Uu9-io-frR" secondAttribute="leading" constant="10" id="zoH-62-nam"/>
</constraints> </constraints>
<point key="canvasLocation" x="295.5" y="236"/>
</view> </view>
<userDefaultsController representsSharedInstance="YES" id="1Gq-ZQ-IML"/> <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"> <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"> <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"/> <rect key="frame" x="8" y="27" width="329" height="257"/>
<clipView key="contentView" id="Z7L-Ef-90Z"> <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"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <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"> <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) NSMutableArray *selectedTimeZones;
@property (strong, nonatomic) NSArray *filteredArray; @property (strong, nonatomic) NSArray *filteredArray;
@property (atomic, assign) BOOL launchOnLogin; @property (atomic, assign) BOOL launchOnLogin;
@property (atomic, strong) NSArray *fontFamilies;
@property (atomic, strong) NSArray *themes;
@end @end

57
Clocker/Preferences/CLPreferencesViewController.m

@ -24,10 +24,10 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
@property (weak) IBOutlet NSTableView *timezoneTableView; @property (weak) IBOutlet NSTableView *timezoneTableView;
@property (strong) IBOutlet Panel *timezonePanel; @property (strong) IBOutlet Panel *timezonePanel;
@property (weak) IBOutlet NSPopUpButton *themePopUp;
@property (weak) IBOutlet NSPopUpButton *fontPopUp;
@property (weak) IBOutlet NSTableView *availableTimezoneTableView; @property (weak) IBOutlet NSTableView *availableTimezoneTableView;
@property (weak) IBOutlet NSSearchField *searchField; @property (weak) IBOutlet NSSearchField *searchField;
@property (weak) IBOutlet NSButton *is24HourFormatSelected; @property (weak) IBOutlet NSButton *is24HourFormatSelected;
@property (weak) IBOutlet NSTextField *messageLabel; @property (weak) IBOutlet NSTextField *messageLabel;
@ -52,7 +52,6 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
if (!self.timeZoneArray) if (!self.timeZoneArray)
{ {
self.timeZoneArray = [[NSMutableArray alloc] initWithArray:[NSTimeZone knownTimeZoneNames]]; self.timeZoneArray = [[NSMutableArray alloc] initWithArray:[NSTimeZone knownTimeZoneNames]];
self.filteredArray = [[NSArray alloc] init]; self.filteredArray = [[NSArray alloc] init];
} }
@ -63,9 +62,33 @@ NSString *const CLPreferencesAvailableTimezoneIdentifier = @"availableTimezones"
//Register for drag and drop //Register for drag and drop
[self.timezoneTableView registerForDraggedTypes: [NSArray arrayWithObject: CLDragSessionKey]]; [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. // Do view setup here.
} }
-(void)dealloc -(void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self [[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 @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