Skip to content

Commit

Permalink
🐛 修复搜索框文字高度问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed Jul 12, 2023
1 parent 72b7064 commit 3034f56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mac/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
8 changes: 8 additions & 0 deletions Mac/View/SearchTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ class SearchTextField: NSSearchField, NSSearchFieldDelegate {

private var trackingArea: NSTrackingArea?


override func rectForSearchText(whenCentered isCentered: Bool) -> NSRect {
var rect = super.rectForSearchText(whenCentered: isCentered)
rect.origin.y += 1.0
rect.size.height += 2.0
return rect
}

override func updateTrackingAreas() {
if let trackingArea = trackingArea {
removeTrackingArea(trackingArea)
Expand Down

0 comments on commit 3034f56

Please sign in to comment.