Disable program text fields editable and remove auto complete popup.

This commit is contained in:
2025-07-13 13:18:11 -07:00
parent 58948e1614
commit 42fe921dbc
6 changed files with 21 additions and 15 deletions

View File

@@ -18,6 +18,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
window.delegate = self
// TODO: Move down.
// NOTE: Here we check wether the program was launched by the
// system (e.g. launch-at-login). If it was not, then display the
// window.

View File

@@ -86,11 +86,11 @@ $(EXEC).app: $(EXEC)
mkdir -p $@/Contents/Resources/ && \
cp Info.plist $@/Contents/ && \
cp resources/AppIcon.icns $@/Contents/Resources/ && \
cp $(EXEC) $@/Contents/MacOS/ && \
$(if $(DEBUG), codesign --entitlements Grapp.entitlements \
-s ${APPLE_DEVELOPMENT} -f --timestamp -o runtime $(EXEC).app, \
codesign -s ${APPLE_DEVELOPER_ID_APPLICATION} -f --timestamp \
-o runtime $(EXEC).app)
cp $(EXEC) $@/Contents/MacOS/
# $(if $(DEBUG), codesign --entitlements Grapp.entitlements \
# -s ${APPLE_DEVELOPMENT} -f --timestamp -o runtime $(EXEC).app, \
# codesign -s ${APPLE_DEVELOPER_ID_APPLICATION} -f --timestamp \
# -o runtime $(EXEC).app)
clean:
rm -rf $(EXEC) $(EXEC).app arm64 x86_64

View File

@@ -134,7 +134,6 @@ final class PathManager {
}
public func updateIndex() {
print("updateIndex()")
for path in paths {
rebuildIndex(at: path.key)
}

View File

@@ -22,6 +22,7 @@ class ProgramsTableViewCell: NSTableCellView {
public var indexLabel: NSTextField = {
let field = NSTextField(labelWithString: "-")
field.isEditable = false
field.alignment = .center
// field.drawsBackground = true
@@ -49,6 +50,7 @@ class ProgramsTableViewCell: NSTableCellView {
public var titleField: NSTextField = {
let field = NSTextField()
field.isEditable = false
field.isBordered = false
field.drawsBackground = false
field.lineBreakMode = .byTruncatingTail
@@ -59,6 +61,7 @@ class ProgramsTableViewCell: NSTableCellView {
public var progPathLabel: NSTextField = {
let field = NSTextField()
field.isEditable = false
field.isBordered = false
field.drawsBackground = false
field.lineBreakMode = .byTruncatingTail

View File

@@ -61,6 +61,7 @@ class SearchViewController: NSViewController, NSTextFieldDelegate,
textField.lineBreakMode = .byTruncatingHead
textField.focusRingType = .none
textField.placeholderString = "Program Search"
textField.isAutomaticTextCompletionEnabled = false
textField.bezelStyle = .roundedBezel
textField.font = NSFont
.systemFont(ofSize: NSFontDescriptor
@@ -346,7 +347,9 @@ class SearchViewController: NSViewController, NSTextFieldDelegate,
private func reloadProgramsTableViewData() {
if listIndex > 0 {
tableViewHeightAnchor?.constant = 210
// TODO: Why is this located here, randomly? Make it a global
// config variable.
tableViewHeightAnchor?.constant = 250
} else {
tableViewHeightAnchor?.constant = 0
}

View File

@@ -5,9 +5,8 @@ import ServiceManagement
// TODO: Rework the paths table and selection. Right now, it is very
// disfunctional and error-prone.
class SettingsViewController: NSViewController,
NSTextFieldDelegate, KeyDetectorButtonDelegate,
NSTableViewDataSource, NSTableViewDelegate,
PathsTableCellViewDelegate
NSTextFieldDelegate, KeyDetectorButtonDelegate, NSTableViewDataSource,
NSTableViewDelegate, PathsTableCellViewDelegate
{
private var keyboardEvents: EventMonitor?
@@ -15,6 +14,8 @@ class SettingsViewController: NSViewController,
// NOTE: This is the default shortcut. If you were to change it, don't
// forget to change other places in this file and delegate, too.
// TODO: Come up with a way where we don't have to specify these in
// multiple locations.
private var keyCode = Int(kVK_Space)
private var modifiers = Int(optionKey)
@@ -356,7 +357,7 @@ class SettingsViewController: NSViewController,
let modifiers = event.modifierFlags.rawValue
if modsContains(keys: OSCmd, in: modifiers) &&
key == kVK_ANSI_Q || modsContainsNone(in: modifiers)
key == kVK_ANSI_Q
{
NSApplication.shared.terminate(self)
}
@@ -623,7 +624,7 @@ class SettingsViewController: NSViewController,
func selectionButtonClicked(tag: Int) {
if dirPicker == nil {
dirPicker = NSOpenPanel()
dirPicker!.message = "Select a directory to search applications in..."
dirPicker!.message = "Select a directory with applications..."
dirPicker!.canChooseDirectories = true
dirPicker!.canChooseFiles = false
dirPicker!.allowsMultipleSelection = false
@@ -663,8 +664,7 @@ class SettingsViewController: NSViewController,
func tableView(_ tableView: NSTableView,
viewFor tableColumn: NSTableColumn?, row: Int) -> NSView?
{
let rect = NSRect(x: 0, y: 0, width: tableColumn!.width,
height: 20)
let rect = NSRect(x: 0, y: 0, width: tableColumn!.width, height: 20)
let cell = PathsTableCellView(frame: rect)
cell.titleField.stringValue = paths[row]
cell.delegate = self