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

@@ -9,14 +9,14 @@ fileprivate enum AboutLinks {
} }
enum Strings { enum Strings {
static let copyright = "Copyright © 2024\nGarikMI. All rights reserved." static let copyright = "Copyright © 2024\nGarikMI. All rights reserved."
static let evaluationTitle = "License - Evaluation" static let evaluationTitle = "License - Evaluation"
static let evaluationMessage = "You are currently using evaluation license. CmdBar will quit after 20 minutes. If you already own a license, enter it below or purchase a license." static let evaluationMessage = "You are currently using evaluation license. CmdBar will quit after 20 minutes. If you already own a license, enter it below or purchase a license."
static let activate = "Activate" static let activate = "Activate"
static let proTitle = "License - Activated" static let proTitle = "License - Activated"
static let proMessage = "Thank you for purchasing CmdBar! Enjoy!" static let proMessage = "Thank you for purchasing CmdBar! Enjoy!"
static let deactivate = "Deactivate" static let deactivate = "Deactivate"
static let activating = "Activating..." static let activating = "Activating..."
} }
class AboutViewController: NSViewController, NSTextFieldDelegate { class AboutViewController: NSViewController, NSTextFieldDelegate {

View File

@@ -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 {

View File

@@ -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
@@ -292,8 +292,8 @@ class SearchViewController: NSViewController, NSTextFieldDelegate, NSPopoverDele
if prog.name.lowercased().contains(searchInput.stringValue.lowercased()) { if prog.name.lowercased().contains(searchInput.stringValue.lowercased()) {
programsList[listIndex].path = prog.path programsList[listIndex].path = prog.path
programsList[listIndex].name = prog.name programsList[listIndex].name = prog.name
programsList[listIndex].ext = prog.ext programsList[listIndex].ext = prog.ext
programsList[listIndex].img = NSWorkspace.shared.icon(forFile: URL(fileURLWithPath: prog.path).appendingPathComponent(prog.name+prog.ext).path) programsList[listIndex].img = NSWorkspace.shared.icon(forFile: URL(fileURLWithPath: prog.path).appendingPathComponent(prog.name+prog.ext).path)
listIndex += 1 listIndex += 1
} }
} }
@@ -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()
} }

View File

@@ -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()