Skip to content

Commit

Permalink
Merge pull request #47 from qwertyyb/fix/searchview
Browse files Browse the repository at this point in the history
fix(search): 修复复制图片后,搜索框消失的问题
  • Loading branch information
qwertyyb authored Feb 11, 2021
2 parents 427c9ec + b50f54c commit 4ced50d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion YPaste/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Config {

private var windowHeight: CGFloat {
if (popupPosition == .bottom || popupPosition == .top) {
return 306
return 346
}
let menuBarHeight = NSMenu.menuBarVisible() ? NSApplication.shared.mainMenu?.menuBarHeight ?? 24 : 0
let height = (NSScreen.main?.frame.height ?? NSScreen.screens.first!.frame.height) - menuBarHeight
Expand Down
2 changes: 1 addition & 1 deletion YPaste/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>Explosion v1.0.0-alpha</string>
<key>CFBundleVersion</key>
<string>103099</string>
<string>103119</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
7 changes: 4 additions & 3 deletions YPaste/Window/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MainView: NSVisualEffectView {

addSearchView()

// addTitleView()
addTitleView()

addScrollView()

Expand Down Expand Up @@ -73,7 +73,8 @@ class MainView: NSVisualEffectView {
NSLayoutConstraint.activate([
searchField.topAnchor.constraint(equalTo: topAnchor, constant: 12),
searchField.centerXAnchor.constraint(equalTo: centerXAnchor),
searchField.widthAnchor.constraint(lessThanOrEqualToConstant: 320),
searchField.widthAnchor.constraint(greaterThanOrEqualToConstant: 320),
searchField.heightAnchor.constraint(greaterThanOrEqualToConstant: 24),
])
}

Expand Down Expand Up @@ -127,7 +128,7 @@ class MainView: NSVisualEffectView {

NSLayoutConstraint.activate([
scrollView.centerXAnchor.constraint(equalTo: centerXAnchor),
scrollView.topAnchor.constraint(equalTo: searchField.bottomAnchor, constant: 6),
scrollView.topAnchor.constraint(equalTo: titleView.bottomAnchor, constant: 6),
scrollView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -28),
scrollView.widthAnchor.constraint(equalTo: widthAnchor, constant: -24),
scrollView.contentView.widthAnchor.constraint(equalTo: widthAnchor, constant: -24),
Expand Down

0 comments on commit 4ced50d

Please sign in to comment.