-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
230 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// AboutWindow.swift | ||
// TramReminder | ||
// | ||
// Created by Anton Pauli on 07.09.15. | ||
// Copyright (c) 2015 Anton Pauli. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class AboutWindow: NSWindowController { | ||
|
||
override func windowDidLoad() { | ||
super.windowDidLoad() | ||
|
||
self.window?.center() | ||
self.window?.makeKeyAndOrderFront(nil) | ||
NSApp.activateIgnoringOtherApps(true) | ||
} | ||
|
||
override var windowNibName : String! { | ||
return "AboutWindow" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/> | ||
</dependencies> | ||
<objects> | ||
<customObject id="-2" userLabel="File's Owner" customClass="AboutWindow" customModule="TramReminder" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/> | ||
</connections> | ||
</customObject> | ||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> | ||
<customObject id="-3" userLabel="Application" customClass="NSObject"/> | ||
<window title="About" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="F0z-JX-Cv5"> | ||
<windowStyleMask key="styleMask" titled="YES" closable="YES"/> | ||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> | ||
<rect key="contentRect" x="196" y="240" width="380" height="178"/> | ||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/> | ||
<view key="contentView" id="se5-gp-TjO"> | ||
<rect key="frame" x="0.0" y="5" width="380" height="178"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Cid-zk-q7Y"> | ||
<rect key="frame" x="18" y="136" width="344" height="22"/> | ||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="TramReminder" id="TJI-bd-SQr"> | ||
<font key="font" metaFont="system" size="18"/> | ||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> | ||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> | ||
</textFieldCell> | ||
</textField> | ||
<scrollView fixedFrame="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Ub-sp-S7z"> | ||
<rect key="frame" x="20" y="20" width="340" height="100"/> | ||
<clipView key="contentView" misplaced="YES" id="Tdo-HU-OpG"> | ||
<rect key="frame" x="1" y="1" width="223" height="133"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<textView editable="NO" importsGraphics="NO" richText="NO" baseWritingDirection="leftToRight" findStyle="panel" continuousSpellChecking="YES" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="N8P-fP-2Uv"> | ||
<rect key="frame" x="0.0" y="0.0" width="223" height="133"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<size key="minSize" width="323" height="98"/> | ||
<size key="maxSize" width="463" height="10000000"/> | ||
<attributedString key="textStorage"> | ||
<fragment> | ||
<string key="content">Author: anton.pauli@gmail.com | ||
Source: https://github.com/TUNER88/TramReminder | ||
License: MIT | ||
|
||
Tram Icon desgined by Freepik | ||
</string> | ||
<attributes> | ||
<font key="NSFont" size="12" name="HelveticaNeue"/> | ||
<real key="NSKern" value="0.0"/> | ||
<paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="leftToRight" minimumLineHeight="16" defaultTabInterval="36"> | ||
<tabStops/> | ||
</paragraphStyle> | ||
<color key="NSStrokeColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> | ||
</attributes> | ||
</fragment> | ||
</attributedString> | ||
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> | ||
<size key="minSize" width="323" height="98"/> | ||
<size key="maxSize" width="463" height="10000000"/> | ||
</textView> | ||
</subviews> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
</clipView> | ||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="0Ti-wJ-Lzy"> | ||
<rect key="frame" x="-100" y="-100" width="87" height="18"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
</scroller> | ||
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="7eb-fz-lXy"> | ||
<rect key="frame" x="224" y="1" width="15" height="133"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
</scroller> | ||
</scrollView> | ||
</subviews> | ||
</view> | ||
<connections> | ||
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/> | ||
</connections> | ||
<point key="canvasLocation" x="612" y="175"/> | ||
</window> | ||
</objects> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// EventMonitor.swift | ||
// TramReminder | ||
// | ||
// Created by Anton Pauli on 06.09.15. | ||
// Copyright (c) 2015 Anton Pauli. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
public class EventMonitor { | ||
private var monitor: AnyObject? | ||
private let mask: NSEventMask | ||
private let handler: NSEvent? -> () | ||
|
||
public init(mask: NSEventMask, handler: NSEvent? -> ()) { | ||
self.mask = mask | ||
self.handler = handler | ||
} | ||
|
||
deinit { | ||
stop() | ||
} | ||
|
||
public func start() { | ||
monitor = NSEvent.addGlobalMonitorForEventsMatchingMask(mask, handler: handler) | ||
} | ||
|
||
public func stop() { | ||
if monitor != nil { | ||
NSEvent.removeMonitor(monitor!) | ||
monitor = nil | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.