Design improvements.
This commit is contained in:
@@ -7,8 +7,7 @@ class PopoverPanel: NSPanel {
|
|||||||
init(viewController: NSViewController) {
|
init(viewController: NSViewController) {
|
||||||
super.init(
|
super.init(
|
||||||
contentRect: CGRect(x: 0, y: 0, width: 100, height: 100),
|
contentRect: CGRect(x: 0, y: 0, width: 100, height: 100),
|
||||||
styleMask: [.borderless, .nonactivatingPanel, .utilityWindow,
|
styleMask: [.borderless, .nonactivatingPanel, .utilityWindow, .fullSizeContentView],
|
||||||
.fullSizeContentView],
|
|
||||||
backing: .buffered,
|
backing: .buffered,
|
||||||
defer: false
|
defer: false
|
||||||
)
|
)
|
||||||
@@ -26,8 +25,7 @@ class PopoverPanel: NSPanel {
|
|||||||
titlebarAppearsTransparent = true
|
titlebarAppearsTransparent = true
|
||||||
|
|
||||||
animationBehavior = .none
|
animationBehavior = .none
|
||||||
collectionBehavior = [.moveToActiveSpace, .fullScreenAuxiliary,
|
collectionBehavior = [.moveToActiveSpace, .fullScreenAuxiliary, .transient]
|
||||||
.transient]
|
|
||||||
isReleasedWhenClosed = false
|
isReleasedWhenClosed = false
|
||||||
hidesOnDeactivate = false
|
hidesOnDeactivate = false
|
||||||
}
|
}
|
||||||
@@ -37,21 +35,13 @@ class PopoverPanel: NSPanel {
|
|||||||
let key = event.keyCode
|
let key = event.keyCode
|
||||||
|
|
||||||
if event.type == NSEvent.EventType.keyDown {
|
if event.type == NSEvent.EventType.keyDown {
|
||||||
if modsContains(keys: OSCmd, in: modifiers) &&
|
if modsContains(keys: OSCmd, in: modifiers) && key == kVK_ANSI_Q {
|
||||||
key == kVK_ANSI_Q
|
|
||||||
{
|
|
||||||
NSApplication.shared.terminate(self)
|
NSApplication.shared.terminate(self)
|
||||||
return true
|
return true
|
||||||
} else if modsContains(keys: OSCmd, in: modifiers) &&
|
} else if modsContains(keys: OSCmd, in: modifiers) && key == kVK_ANSI_W {
|
||||||
key == kVK_ANSI_W
|
|
||||||
{
|
|
||||||
resignKey()
|
resignKey()
|
||||||
return true
|
return true
|
||||||
|
} else if modsContains(keys: OSCmd | OSShift, in: modifiers) && key == kVK_ANSI_R {
|
||||||
} else if modsContains(keys: OSCmd | OSShift,
|
|
||||||
in: modifiers) &&
|
|
||||||
key == kVK_ANSI_R
|
|
||||||
{
|
|
||||||
PathManager.shared.updateIndex()
|
PathManager.shared.updateIndex()
|
||||||
return true
|
return true
|
||||||
} else if key == kVK_Escape {
|
} else if key == kVK_Escape {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class SearchViewController: NSViewController, NSTextFieldDelegate, NSPopoverDele
|
|||||||
effect.wantsLayer = true
|
effect.wantsLayer = true
|
||||||
effect.layer?.masksToBounds = true
|
effect.layer?.masksToBounds = true
|
||||||
|
|
||||||
effect.layer?.borderColor = NSColor.labelColor.withAlphaComponent(0.1).cgColor
|
effect.layer?.borderColor = NSColor.labelColor.withAlphaComponent(0.2).cgColor
|
||||||
effect.layer?.borderWidth = 1
|
effect.layer?.borderWidth = 1
|
||||||
effect.layer?.cornerRadius = windowCornerRadius
|
effect.layer?.cornerRadius = windowCornerRadius
|
||||||
|
|
||||||
@@ -336,9 +336,7 @@ class SearchViewController: NSViewController, NSTextFieldDelegate, NSPopoverDele
|
|||||||
return listIndex
|
return listIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
func tableView(_ tableView: NSTableView,
|
func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
|
||||||
rowViewForRow row: Int) -> NSTableRowView?
|
|
||||||
{
|
|
||||||
return ProgramsTableRowView()
|
return ProgramsTableRowView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ShadowView: NSView {
|
|||||||
guard let layer = layer else { return }
|
guard let layer = layer else { return }
|
||||||
|
|
||||||
let shadow = NSShadow()
|
let shadow = NSShadow()
|
||||||
shadow.shadowColor = NSColor.black.withAlphaComponent(0.4)
|
shadow.shadowColor = NSColor.shadowColor.withAlphaComponent(0.4)
|
||||||
shadow.shadowBlurRadius = 20.0
|
shadow.shadowBlurRadius = 20.0
|
||||||
shadow.shadowOffset = CGSize(width: 0, height: -10)
|
shadow.shadowOffset = CGSize(width: 0, height: -10)
|
||||||
shadow.set()
|
shadow.set()
|
||||||
|
|||||||
Reference in New Issue
Block a user