From 8527371945426185453401b0312129a858b2c3c7 Mon Sep 17 00:00:00 2001 From: igor Date: Sun, 9 Feb 2025 12:05:46 -0800 Subject: [PATCH] Design improvements. --- src/AboutViewController.swift | 14 +++++++------- src/PopoverPanel.swift | 20 +++++--------------- src/SearchViewController.swift | 10 ++++------ src/ShadowView.swift | 2 +- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/src/AboutViewController.swift b/src/AboutViewController.swift index b1b5e05..9320fe9 100644 --- a/src/AboutViewController.swift +++ b/src/AboutViewController.swift @@ -9,14 +9,14 @@ fileprivate enum AboutLinks { } enum Strings { - static let copyright = "Copyright © 2024\nGarikMI. All rights reserved." - static let evaluationTitle = "License - Evaluation" + static let copyright = "Copyright © 2024\nGarikMI. All rights reserved." + 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 activate = "Activate" - static let proTitle = "License - Activated" - static let proMessage = "Thank you for purchasing CmdBar! Enjoy!" - static let deactivate = "Deactivate" - static let activating = "Activating..." + static let activate = "Activate" + static let proTitle = "License - Activated" + static let proMessage = "Thank you for purchasing CmdBar! Enjoy!" + static let deactivate = "Deactivate" + static let activating = "Activating..." } class AboutViewController: NSViewController, NSTextFieldDelegate { diff --git a/src/PopoverPanel.swift b/src/PopoverPanel.swift index 6225d55..2c5954c 100644 --- a/src/PopoverPanel.swift +++ b/src/PopoverPanel.swift @@ -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 { diff --git a/src/SearchViewController.swift b/src/SearchViewController.swift index 4fa8ae4..4470cd7 100644 --- a/src/SearchViewController.swift +++ b/src/SearchViewController.swift @@ -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 @@ -292,8 +292,8 @@ class SearchViewController: NSViewController, NSTextFieldDelegate, NSPopoverDele if prog.name.lowercased().contains(searchInput.stringValue.lowercased()) { programsList[listIndex].path = prog.path programsList[listIndex].name = prog.name - programsList[listIndex].ext = prog.ext - programsList[listIndex].img = NSWorkspace.shared.icon(forFile: URL(fileURLWithPath: prog.path).appendingPathComponent(prog.name+prog.ext).path) + programsList[listIndex].ext = prog.ext + programsList[listIndex].img = NSWorkspace.shared.icon(forFile: URL(fileURLWithPath: prog.path).appendingPathComponent(prog.name+prog.ext).path) listIndex += 1 } } @@ -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() } diff --git a/src/ShadowView.swift b/src/ShadowView.swift index f29186d..74b40fa 100644 --- a/src/ShadowView.swift +++ b/src/ShadowView.swift @@ -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()