Skip to content

Commit

Permalink
Merge pull request #17 from TPeterW/master
Browse files Browse the repository at this point in the history
Removes previous notifications when switching input source
  • Loading branch information
Hyunje Jun authored Nov 10, 2017
2 parents 7154599 + ab35675 commit 22b7b3c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DerivedData
*.xcuserstate
/kawa.xcarchive
Kawa.app
.DS_Store

# Carthage
#
Expand Down
17 changes: 11 additions & 6 deletions kawa/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12121"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13529"/>
<capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -120,8 +121,12 @@
<autoresizingMask key="autoresizingMask"/>
<font key="font" metaFont="system"/>
<tabViewItems/>
<connections>
<outlet property="delegate" destination="lsI-lx-rUQ" id="jHL-WY-5vx"/>
</connections>
</tabView>
<connections>
<outlet property="tabView" destination="B9b-jX-Do0" id="DLy-hp-btq"/>
<segue destination="WK9-v7-Mix" kind="relationship" relationship="tabItems" id="FMn-AA-T9j"/>
<segue destination="8tD-vA-uhk" kind="relationship" relationship="tabItems" id="cIb-Vc-1BU"/>
</connections>
Expand Down Expand Up @@ -153,7 +158,7 @@
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zub-x4-8eR">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zub-x4-8eR">
<rect key="frame" x="35" y="64" width="363" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="When the icon is hidden, Kawa can be accessed by launching it again" id="ZP5-V3-u7u">
Expand Down Expand Up @@ -192,7 +197,7 @@
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yD8-rS-xQC" customClass="HyperlinkTextField" customModule="Kawa" customModuleProvider="target">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yD8-rS-xQC" customClass="HyperlinkTextField" customModule="Kawa" customModuleProvider="target">
<rect key="frame" x="130" y="20" width="172" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="github.com/utatti/kawa" placeholderString="" id="78n-cW-Oy5">
Expand Down Expand Up @@ -255,8 +260,8 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSActionTemplate" id="DCD-V0-mqr"/>
</imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsExpansionToolTips="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2PC-7Y-er3">
<rect key="frame" x="25" y="1" width="161.5" height="20"/>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2PC-7Y-er3">
<rect key="frame" x="25" y="1" width="162" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="hxP-Wj-ePa">
<font key="font" metaFont="system"/>
Expand Down
1 change: 1 addition & 0 deletions kawa/ShortcutCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ShortcutCellView: NSTableCellView {
}

func showNotification(_ message: String, icon: NSImage?) {
NSUserNotificationCenter.default.removeAllDeliveredNotifications()
guard Settings.get(.showNotification, withDefaultValue: true) else { return }
let notification = NSUserNotification()
notification.informativeText = message
Expand Down

0 comments on commit 22b7b3c

Please sign in to comment.