Skip to content

Commit

Permalink
Merge pull request #10 from tlunter/remove-colored-icons
Browse files Browse the repository at this point in the history
Remove colored icons
  • Loading branch information
tlunter committed Apr 18, 2015
2 parents f140725 + bc4c31b commit ee66df7
Show file tree
Hide file tree
Showing 33 changed files with 139 additions and 152 deletions.
18 changes: 16 additions & 2 deletions Amtrak Status.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
3A1B2A8019832EF900EB2C05 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A1B2A7F19832EF900EB2C05 /* MainMenu.xib */; };
3A1B2AC519833D0600EB2C05 /* TLAmtrakStatusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A1B2AC419833D0600EB2C05 /* TLAmtrakStatusView.m */; };
3A1DD09219A7F98A004C038C /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A1DD09119A7F98A004C038C /* Sparkle.framework */; };
3A1DD09419A7FB26004C038C /* Sparkle.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = 3A1DD09119A7F98A004C038C /* Sparkle.framework */; };
3A1DD09419A7FB26004C038C /* Sparkle.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = 3A1DD09119A7F98A004C038C /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
3A1DD09619A80318004C038C /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 3A1DD09519A80318004C038C /* dsa_pub.pem */; };
3A1DD0E519A81DEA004C038C /* AmtrakStatusHelper.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3A1DD0DF19A81D62004C038C /* AmtrakStatusHelper.app */; };
3A1DD0E619A81E3D004C038C /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A1DD09719A81901004C038C /* ServiceManagement.framework */; };
3A224BFB1A5C8FCF009992BD /* TLOperatingSystemVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A224BFA1A5C8FCF009992BD /* TLOperatingSystemVersion.m */; };
3A2F05DC198C422A00237226 /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A2F05BE198C422A00237226 /* Base64.m */; };
3A2F05DD198C422A00237226 /* UNIBaseRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A2F05C1198C422A00237226 /* UNIBaseRequest.m */; };
3A2F05DE198C422A00237226 /* UNIBodyRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A2F05C3198C422A00237226 /* UNIBodyRequest.m */; };
Expand Down Expand Up @@ -107,6 +108,8 @@
3A1DD09519A80318004C038C /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = "<group>"; };
3A1DD09719A81901004C038C /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
3A1DD0D919A81D61004C038C /* AmtrakStatusHelper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = AmtrakStatusHelper.xcodeproj; path = AmtrakStatusHelper/AmtrakStatusHelper.xcodeproj; sourceTree = "<group>"; };
3A224BF91A5C8FCF009992BD /* TLOperatingSystemVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TLOperatingSystemVersion.h; path = TLOperatingSystemVersion/TLOperatingSystemVersion.h; sourceTree = "<group>"; };
3A224BFA1A5C8FCF009992BD /* TLOperatingSystemVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TLOperatingSystemVersion.m; path = TLOperatingSystemVersion/TLOperatingSystemVersion.m; sourceTree = "<group>"; };
3A2F05BD198C422A00237226 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
3A2F05BE198C422A00237226 /* Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Base64.m; sourceTree = "<group>"; };
3A2F05C0198C422A00237226 /* UNIBaseRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UNIBaseRequest.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -219,6 +222,15 @@
name = Products;
sourceTree = "<group>";
};
3A224BFE1A5C8FD5009992BD /* TLOperatingSystemVersion */ = {
isa = PBXGroup;
children = (
3A224BF91A5C8FCF009992BD /* TLOperatingSystemVersion.h */,
3A224BFA1A5C8FCF009992BD /* TLOperatingSystemVersion.m */,
);
name = TLOperatingSystemVersion;
sourceTree = "<group>";
};
3A2F05BC198C422A00237226 /* Unirest */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -405,6 +417,7 @@
3A64C3A21987260200053DC7 /* TLTrainListItemEstimatedView */,
3A2F05ED198C4B8800237226 /* TLPreferencesWindowController */,
3A5D5A2A199967EE00F179B8 /* TLTrain */,
3A224BFE1A5C8FD5009992BD /* TLOperatingSystemVersion */,
);
path = "Amtrak Status";
sourceTree = "<group>";
Expand Down Expand Up @@ -523,7 +536,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = TL;
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = "___FULLUSERNAME___";
TargetAttributes = {
3AC026C51981AE9700AEDAE9 = {
Expand Down Expand Up @@ -611,6 +624,7 @@
3AC026DF1981C2D100AEDAE9 /* TLAmtrakStatusMenu.m in Sources */,
3A2F05E4198C422A00237226 /* UNIJsonNode.m in Sources */,
3A2F05EC198C479400237226 /* TLPreferencesWindowController.m in Sources */,
3A224BFB1A5C8FCF009992BD /* TLOperatingSystemVersion.m in Sources */,
3A2F05E7198C422A00237226 /* UNIHTTPRequestWithBody.m in Sources */,
3A2F05E6198C422A00237226 /* UNIHTTPRequest.m in Sources */,
3A2F05F0198EC2D700237226 /* TLTrainListItemTextView.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -58,7 +58,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AC026A41981AE9700AEDAE9"
Expand All @@ -76,7 +77,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AC026A41981AE9700AEDAE9"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -58,7 +58,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AC026A41981AE9700AEDAE9"
Expand All @@ -76,7 +77,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AC026A41981AE9700AEDAE9"
Expand Down
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions Amtrak Status/Images.xcassets/AmtrakOrange.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions Amtrak Status/Images.xcassets/AmtrakRed.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "amtrak-24.png"
"filename" : "amtrak-24-template.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "[email protected]"
"filename" : "amtrak-24-template@2x.png"
},
{
"idiom" : "universal",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 0 additions & 22 deletions Amtrak Status/Images.xcassets/AmtrakYellow.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
14 changes: 7 additions & 7 deletions Amtrak Status/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7531" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7531"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -670,7 +670,7 @@
<window title="Amtrak Status Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="SNo-Ji-nrs">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<rect key="contentRect" x="163" y="199" width="446" height="263"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" id="rgb-Yd-ZXA">
<rect key="frame" x="0.0" y="0.0" width="446" height="263"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -708,7 +708,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KVe-Ra-iRK">
<rect key="frame" x="178" y="221" width="100" height="22"/>
<rect key="frame" x="178" y="221" width="109" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="f6p-Bn-vVp">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -723,7 +723,7 @@
</connections>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MGE-h3-UBf">
<rect key="frame" x="178" y="189" width="100" height="22"/>
<rect key="frame" x="178" y="189" width="109" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="qAt-gE-BY7">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -738,7 +738,7 @@
</connections>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yyP-2Q-CXv">
<rect key="frame" x="178" y="143" width="100" height="22"/>
<rect key="frame" x="178" y="143" width="109" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="optional" drawsBackground="YES" id="1S2-QB-HDf">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -810,7 +810,7 @@
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6ff-dz-d7r">
<rect key="frame" x="176" y="112" width="105" height="26"/>
<rect key="frame" x="176" y="112" width="114" height="26"/>
<popUpButtonCell key="cell" type="push" title="When Late" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="RJz-wl-yS0" id="HZt-ot-bh6">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
Expand Down
66 changes: 39 additions & 27 deletions Amtrak Status/TLAmtrakStatusMenu/TLAmtrakStatusMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import <Sparkle/Sparkle.h>
#import "TLTrain.h"
#import "TLPreferencesWindowController.h"
#import "TLOperatingSystemVersion.h"
#import "TLAmtrakStatusMenu.h"

@implementation TLAmtrakStatusMenu
Expand Down Expand Up @@ -36,13 +37,19 @@ - (id)initWithStatusItem:(NSStatusItem *)newStatusItem {
[preferencesButton setTarget:self];
[self setUpdatesButton:[[NSMenuItem alloc] initWithTitle:@"Check for Updates" action:@selector(checkForUpdate:) keyEquivalent:@""]];
[updatesButton setTarget:self];

[self setStatusItem:newStatusItem];

[statusItem setMenu:menu];
[statusItem setImage:[NSImage imageNamed:@"AmtrakBlack"]];
[statusItem setAlternateImage:[NSImage imageNamed:@"AmtrakHighlighted"]];
[statusItem setHighlightMode:YES];
NSImage *amtrakTemplate = [NSImage imageNamed:@"AmtrakTemplate"];
[amtrakTemplate setTemplate:YES];
[self setImage:amtrakTemplate];
[self setTitle:nil];
if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:[TLOperatingSystemVersion yosemite]]) {
[statusItem.button setImagePosition:NSImageLeft];
} else {
[statusItem setHighlightMode:YES];
}
}
return self;
}
Expand Down Expand Up @@ -72,34 +79,39 @@ - (void)setTrainData:(NSArray*)trains {
NSDate *scheduled = [[TLAmtrakStatusMenu lateTimeFormatter] dateFromString:[train scheduled]];
NSDate *estimated = [[TLAmtrakStatusMenu lateTimeFormatter] dateFromString:[train estimated]];
NSTimeInterval timeDiff = [estimated timeIntervalSinceDate:scheduled];

NSInteger showTimeInMenu = [[NSUserDefaults standardUserDefaults] integerForKey:@"showTimeInMenu"];
// Always
if (showTimeInMenu == 2) {
[statusItem setTitle:[train estimated]];
// OR
// When later than 5 minutes
} else if (showTimeInMenu == 1 && timeDiff > 300) {
[statusItem setTitle:[train estimated]];
// Never
} else {
[statusItem setTitle:@""];
}

if (timeDiff > 5400) {
[statusItem setImage:[NSImage imageNamed:@"AmtrakRed"]];
} else if (timeDiff > 2700) {
[statusItem setImage:[NSImage imageNamed:@"AmtrakOrange"]];
} else if (timeDiff > 900) {
[statusItem setImage:[NSImage imageNamed:@"AmtrakYellow"]];
} else {
[statusItem setImage:[NSImage imageNamed:@"AmtrakBlack"]];
if (showTimeInMenu == 2 || (showTimeInMenu == 1 && timeDiff > 300)) {
NSString *estimated = [[train estimated] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if ([estimated length] > 0) {
[self setTitle: estimated];
return;
}
}
} else {
[statusItem setImage:[NSImage imageNamed:@"AmtrakBlack"]];
[statusItem setTitle:@""];
}
}

// Otherwise clear
[self setTitle:nil];
}

- (void)setTitle:(NSString *)title {
if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:[TLOperatingSystemVersion yosemite]]) {
[statusItem.button setTitle:title];
[statusItem.button setAlternateTitle:title];
} else {
[statusItem setTitle:title];
}
}

- (void)setImage:(NSImage *)image {
if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:[TLOperatingSystemVersion yosemite]]) {
[statusItem.button setImage:image];
} else {
[statusItem setTitle:@""];
[statusItem setImage:image];
}
}

Expand Down
1 change: 1 addition & 0 deletions Amtrak Status/TLAmtrakStatusView/TLAmtrakStatusView.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

+ (NSInteger)rowHeight;
- (void)setTrainData:(NSArray *)trainData;
- (void)updateView;

@property TLTrain *header;
@property NSArray *trains;
Expand Down
Loading

0 comments on commit ee66df7

Please sign in to comment.