浏览代码

Use blue cursor

master
Matt Baer 6 年前
父节点
当前提交
5881a28110
共有 3 个文件被更改,包括 38 次插入1 次删除
  1. +4
    -0
      writeas.xcodeproj/project.pbxproj
  2. +1
    -1
      writeas/Base.lproj/Main.storyboard
  3. +33
    -0
      writeas/TextField.swift

+ 4
- 0
writeas.xcodeproj/project.pbxproj 查看文件

@@ -10,6 +10,7 @@
33071005A600B8C542D04637 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33071BEC2D76387CC2ACE1BD /* WindowController.swift */; };
330711A70F03BFB84FB889AB /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33071648B80C4188CAC44CA1 /* Constants.swift */; };
33071853C7159177EC75175B /* Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = 330715DBB45C2BB18057D4BC /* Document.swift */; };
33071A66CAF656DB9C22D191 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33071D0D4955060F4888D328 /* TextField.swift */; };
33071D332D5799D36FBC1DDD /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3307150C0D2CA1C8A71C5E26 /* Preferences.swift */; };
C98EE9AC1F29532F002F646E /* writeas in Resources */ = {isa = PBXBuildFile; fileRef = C98EE9AB1F29532F002F646E /* writeas */; };
C9953E801F2D07A7008ED235 /* open-sans-v14-cyrillic-ext_vietnamese_cyrillic_latin-ext_latin_greek-ext_greek-regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C9953E7C1F2D07A7008ED235 /* open-sans-v14-cyrillic-ext_vietnamese_cyrillic_latin-ext_latin_greek-ext_greek-regular.ttf */; };
@@ -26,6 +27,7 @@
330715DBB45C2BB18057D4BC /* Document.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Document.swift; path = writeas/Document.swift; sourceTree = "<group>"; };
33071648B80C4188CAC44CA1 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
33071BEC2D76387CC2ACE1BD /* WindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WindowController.swift; path = writeas/WindowController.swift; sourceTree = "<group>"; };
33071D0D4955060F4888D328 /* TextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; };
C98EE9AB1F29532F002F646E /* writeas */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = writeas; sourceTree = "<group>"; };
C9953E7C1F2D07A7008ED235 /* open-sans-v14-cyrillic-ext_vietnamese_cyrillic_latin-ext_latin_greek-ext_greek-regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "open-sans-v14-cyrillic-ext_vietnamese_cyrillic_latin-ext_latin_greek-ext_greek-regular.ttf"; sourceTree = "<group>"; };
C9953E841F2D07BF008ED235 /* lora-v10-cyrillic-ext_vietnamese_cyrillic_latin-ext_latin-regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "lora-v10-cyrillic-ext_vietnamese_cyrillic_latin-ext_latin-regular.ttf"; sourceTree = "<group>"; };
@@ -89,6 +91,7 @@
C99B91121C33841F00A91990 /* Main.storyboard */,
C99B91151C33841F00A91990 /* Info.plist */,
33071648B80C4188CAC44CA1 /* Constants.swift */,
33071D0D4955060F4888D328 /* TextField.swift */,
);
path = writeas;
sourceTree = "<group>";
@@ -176,6 +179,7 @@
330711A70F03BFB84FB889AB /* Constants.swift in Sources */,
33071853C7159177EC75175B /* Document.swift in Sources */,
33071005A600B8C542D04637 /* WindowController.swift in Sources */,
33071A66CAF656DB9C22D191 /* TextField.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};


+ 1
- 1
writeas/Base.lproj/Main.storyboard 查看文件

@@ -439,7 +439,7 @@ DQ
<rect key="frame" x="0.0" y="0.0" width="480" height="339"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView importsGraphics="NO" richText="NO" selectionGranularity="word" findStyle="bar" incrementalSearchingEnabled="YES" continuousSpellChecking="YES" allowsUndo="YES" smartInsertDelete="YES" id="HxZ-78-tID">
<textView importsGraphics="NO" richText="NO" selectionGranularity="word" findStyle="bar" incrementalSearchingEnabled="YES" continuousSpellChecking="YES" allowsUndo="YES" smartInsertDelete="YES" id="HxZ-78-tID" customClass="TextField" customModule="Write_as" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="495" height="339"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>


+ 33
- 0
writeas/TextField.swift 查看文件

@@ -0,0 +1,33 @@
//
// Created by Matt Baer on 8/3/17.
// Copyright (c) 2017 A Bunch Tell. All rights reserved.
//

import Foundation
import AppKit

class TextField: NSTextView {
override func becomeFirstResponder() -> Bool {
let success = super.becomeFirstResponder()
if success {
// #5ac4ee
self.insertionPointColor = NSColor(red:0.35, green:0.77, blue:0.93, alpha:1.0)
}

return success
}

override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) {
/*
if flag {
var rect = rect
var color = self.insertionPointColor
rect.size.width = 2
let path = NSBezierPath(rect: rect)
path.setClip()
path.fill()
}
*/
super.drawInsertionPoint(in: rect, color: color, turnedOn: flag)
}
}

正在加载...
取消
保存