Design improvements.

This commit is contained in:
2025-02-09 12:05:46 -08:00
parent e13df96b68
commit 8527371945
4 changed files with 17 additions and 29 deletions

View File

@@ -7,8 +7,7 @@ class PopoverPanel: NSPanel {
init(viewController: NSViewController) {
super.init(
contentRect: CGRect(x: 0, y: 0, width: 100, height: 100),
styleMask: [.borderless, .nonactivatingPanel, .utilityWindow,
.fullSizeContentView],
styleMask: [.borderless, .nonactivatingPanel, .utilityWindow, .fullSizeContentView],
backing: .buffered,
defer: false
)
@@ -26,8 +25,7 @@ class PopoverPanel: NSPanel {
titlebarAppearsTransparent = true
animationBehavior = .none
collectionBehavior = [.moveToActiveSpace, .fullScreenAuxiliary,
.transient]
collectionBehavior = [.moveToActiveSpace, .fullScreenAuxiliary, .transient]
isReleasedWhenClosed = false
hidesOnDeactivate = false
}
@@ -37,21 +35,13 @@ class PopoverPanel: NSPanel {
let key = event.keyCode
if event.type == NSEvent.EventType.keyDown {
if modsContains(keys: OSCmd, in: modifiers) &&
key == kVK_ANSI_Q
{
if modsContains(keys: OSCmd, in: modifiers) && key == kVK_ANSI_Q {
NSApplication.shared.terminate(self)
return true
} else if modsContains(keys: OSCmd, in: modifiers) &&
key == kVK_ANSI_W
{
} else if modsContains(keys: OSCmd, in: modifiers) && key == kVK_ANSI_W {
resignKey()
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()
return true
} else if key == kVK_Escape {

View File

@@ -44,7 +44,7 @@ class SearchViewController: NSViewController, NSTextFieldDelegate, NSPopoverDele
effect.wantsLayer = 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?.cornerRadius = windowCornerRadius
@@ -336,9 +336,7 @@ class SearchViewController: NSViewController, NSTextFieldDelegate, NSPopoverDele
return listIndex
}
func tableView(_ tableView: NSTableView,
rowViewForRow row: Int) -> NSTableRowView?
{
func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
return ProgramsTableRowView()
}

View File

@@ -15,7 +15,7 @@ class ShadowView: NSView {
guard let layer = layer else { return }
let shadow = NSShadow()
shadow.shadowColor = NSColor.black.withAlphaComponent(0.4)
shadow.shadowColor = NSColor.shadowColor.withAlphaComponent(0.4)
shadow.shadowBlurRadius = 20.0
shadow.shadowOffset = CGSize(width: 0, height: -10)
shadow.set()