Skip to content

Commit

Permalink
Added background color to NSView
Browse files Browse the repository at this point in the history
  • Loading branch information
zaru committed Feb 15, 2017
1 parent ac58d02 commit 3a2e7aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion NotifyHub/NotifyHubViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class NotifyHubViewController: NSViewController, NSSearchFieldDelegate {
override func viewDidLoad() {
super.viewDidLoad()


self.view.wantsLayer = true
self.view.layer?.backgroundColor = NSColor.whiteColor().CGColor
var timer = NSTimer.scheduledTimerWithTimeInterval(30.0, target: self, selector: #selector(NotifyHubViewController.timerFetch(_:)), userInfo: nil, repeats: true)

// Do view setup here.
Expand All @@ -39,11 +40,14 @@ class NotifyHubViewController: NSViewController, NSSearchFieldDelegate {
// Fallback on earlier versions
}

self.searchField.focusRingType = NSFocusRingType.None

self.preferenceBtn.action = #selector(openPreference)
self.logoutBtn.action = #selector(logOut)

}


override func controlTextDidChange(obj: NSNotification) {
if self.searchField.stringValue.characters.count > 0 {
let filterPredicate = NSPredicate(format: "title CONTAINS[cd] %@", self.searchField.stringValue)
Expand Down
4 changes: 2 additions & 2 deletions NotifyHub/NotifyHubViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<searchField wantsLayer="YES" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TbN-s4-tsN">
<rect key="frame" x="0.0" y="458" width="280" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" usesSingleLineMode="YES" bezelStyle="round" id="2mq-Tq-Gxs">
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="2mq-Tq-Gxs">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -86,7 +86,7 @@
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8h5-wh-5vg">
<rect key="frame" x="194" y="2" width="80" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundRect" title="log out" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Wec-Kg-sQI">
<buttonCell key="cell" type="roundRect" title="sign out" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Wec-Kg-sQI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
</buttonCell>
Expand Down

0 comments on commit 3a2e7aa

Please sign in to comment.