Disable program text fields editable and remove auto complete popup.
This commit is contained in:
@@ -18,6 +18,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
|
|||||||
|
|
||||||
window.delegate = self
|
window.delegate = self
|
||||||
|
|
||||||
|
// TODO: Move down.
|
||||||
// NOTE: Here we check wether the program was launched by the
|
// NOTE: Here we check wether the program was launched by the
|
||||||
// system (e.g. launch-at-login). If it was not, then display the
|
// system (e.g. launch-at-login). If it was not, then display the
|
||||||
// window.
|
// window.
|
||||||
|
|||||||
10
src/Makefile
10
src/Makefile
@@ -86,11 +86,11 @@ $(EXEC).app: $(EXEC)
|
|||||||
mkdir -p $@/Contents/Resources/ && \
|
mkdir -p $@/Contents/Resources/ && \
|
||||||
cp Info.plist $@/Contents/ && \
|
cp Info.plist $@/Contents/ && \
|
||||||
cp resources/AppIcon.icns $@/Contents/Resources/ && \
|
cp resources/AppIcon.icns $@/Contents/Resources/ && \
|
||||||
cp $(EXEC) $@/Contents/MacOS/ && \
|
cp $(EXEC) $@/Contents/MacOS/
|
||||||
$(if $(DEBUG), codesign --entitlements Grapp.entitlements \
|
# $(if $(DEBUG), codesign --entitlements Grapp.entitlements \
|
||||||
-s ${APPLE_DEVELOPMENT} -f --timestamp -o runtime $(EXEC).app, \
|
# -s ${APPLE_DEVELOPMENT} -f --timestamp -o runtime $(EXEC).app, \
|
||||||
codesign -s ${APPLE_DEVELOPER_ID_APPLICATION} -f --timestamp \
|
# codesign -s ${APPLE_DEVELOPER_ID_APPLICATION} -f --timestamp \
|
||||||
-o runtime $(EXEC).app)
|
# -o runtime $(EXEC).app)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(EXEC) $(EXEC).app arm64 x86_64
|
rm -rf $(EXEC) $(EXEC).app arm64 x86_64
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ final class PathManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func updateIndex() {
|
public func updateIndex() {
|
||||||
print("updateIndex()")
|
|
||||||
for path in paths {
|
for path in paths {
|
||||||
rebuildIndex(at: path.key)
|
rebuildIndex(at: path.key)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class ProgramsTableViewCell: NSTableCellView {
|
|||||||
|
|
||||||
public var indexLabel: NSTextField = {
|
public var indexLabel: NSTextField = {
|
||||||
let field = NSTextField(labelWithString: "-")
|
let field = NSTextField(labelWithString: "-")
|
||||||
|
field.isEditable = false
|
||||||
field.alignment = .center
|
field.alignment = .center
|
||||||
|
|
||||||
// field.drawsBackground = true
|
// field.drawsBackground = true
|
||||||
@@ -49,6 +50,7 @@ class ProgramsTableViewCell: NSTableCellView {
|
|||||||
|
|
||||||
public var titleField: NSTextField = {
|
public var titleField: NSTextField = {
|
||||||
let field = NSTextField()
|
let field = NSTextField()
|
||||||
|
field.isEditable = false
|
||||||
field.isBordered = false
|
field.isBordered = false
|
||||||
field.drawsBackground = false
|
field.drawsBackground = false
|
||||||
field.lineBreakMode = .byTruncatingTail
|
field.lineBreakMode = .byTruncatingTail
|
||||||
@@ -59,6 +61,7 @@ class ProgramsTableViewCell: NSTableCellView {
|
|||||||
|
|
||||||
public var progPathLabel: NSTextField = {
|
public var progPathLabel: NSTextField = {
|
||||||
let field = NSTextField()
|
let field = NSTextField()
|
||||||
|
field.isEditable = false
|
||||||
field.isBordered = false
|
field.isBordered = false
|
||||||
field.drawsBackground = false
|
field.drawsBackground = false
|
||||||
field.lineBreakMode = .byTruncatingTail
|
field.lineBreakMode = .byTruncatingTail
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class SearchViewController: NSViewController, NSTextFieldDelegate,
|
|||||||
textField.lineBreakMode = .byTruncatingHead
|
textField.lineBreakMode = .byTruncatingHead
|
||||||
textField.focusRingType = .none
|
textField.focusRingType = .none
|
||||||
textField.placeholderString = "Program Search"
|
textField.placeholderString = "Program Search"
|
||||||
|
textField.isAutomaticTextCompletionEnabled = false
|
||||||
textField.bezelStyle = .roundedBezel
|
textField.bezelStyle = .roundedBezel
|
||||||
textField.font = NSFont
|
textField.font = NSFont
|
||||||
.systemFont(ofSize: NSFontDescriptor
|
.systemFont(ofSize: NSFontDescriptor
|
||||||
@@ -346,7 +347,9 @@ class SearchViewController: NSViewController, NSTextFieldDelegate,
|
|||||||
|
|
||||||
private func reloadProgramsTableViewData() {
|
private func reloadProgramsTableViewData() {
|
||||||
if listIndex > 0 {
|
if listIndex > 0 {
|
||||||
tableViewHeightAnchor?.constant = 210
|
// TODO: Why is this located here, randomly? Make it a global
|
||||||
|
// config variable.
|
||||||
|
tableViewHeightAnchor?.constant = 250
|
||||||
} else {
|
} else {
|
||||||
tableViewHeightAnchor?.constant = 0
|
tableViewHeightAnchor?.constant = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import ServiceManagement
|
|||||||
// TODO: Rework the paths table and selection. Right now, it is very
|
// TODO: Rework the paths table and selection. Right now, it is very
|
||||||
// disfunctional and error-prone.
|
// disfunctional and error-prone.
|
||||||
class SettingsViewController: NSViewController,
|
class SettingsViewController: NSViewController,
|
||||||
NSTextFieldDelegate, KeyDetectorButtonDelegate,
|
NSTextFieldDelegate, KeyDetectorButtonDelegate, NSTableViewDataSource,
|
||||||
NSTableViewDataSource, NSTableViewDelegate,
|
NSTableViewDelegate, PathsTableCellViewDelegate
|
||||||
PathsTableCellViewDelegate
|
|
||||||
{
|
{
|
||||||
private var keyboardEvents: EventMonitor?
|
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
|
// 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.
|
// 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 keyCode = Int(kVK_Space)
|
||||||
private var modifiers = Int(optionKey)
|
private var modifiers = Int(optionKey)
|
||||||
|
|
||||||
@@ -356,7 +357,7 @@ class SettingsViewController: NSViewController,
|
|||||||
let modifiers = event.modifierFlags.rawValue
|
let modifiers = event.modifierFlags.rawValue
|
||||||
|
|
||||||
if modsContains(keys: OSCmd, in: modifiers) &&
|
if modsContains(keys: OSCmd, in: modifiers) &&
|
||||||
key == kVK_ANSI_Q || modsContainsNone(in: modifiers)
|
key == kVK_ANSI_Q
|
||||||
{
|
{
|
||||||
NSApplication.shared.terminate(self)
|
NSApplication.shared.terminate(self)
|
||||||
}
|
}
|
||||||
@@ -623,7 +624,7 @@ class SettingsViewController: NSViewController,
|
|||||||
func selectionButtonClicked(tag: Int) {
|
func selectionButtonClicked(tag: Int) {
|
||||||
if dirPicker == nil {
|
if dirPicker == nil {
|
||||||
dirPicker = NSOpenPanel()
|
dirPicker = NSOpenPanel()
|
||||||
dirPicker!.message = "Select a directory to search applications in..."
|
dirPicker!.message = "Select a directory with applications..."
|
||||||
dirPicker!.canChooseDirectories = true
|
dirPicker!.canChooseDirectories = true
|
||||||
dirPicker!.canChooseFiles = false
|
dirPicker!.canChooseFiles = false
|
||||||
dirPicker!.allowsMultipleSelection = false
|
dirPicker!.allowsMultipleSelection = false
|
||||||
@@ -663,8 +664,7 @@ class SettingsViewController: NSViewController,
|
|||||||
func tableView(_ tableView: NSTableView,
|
func tableView(_ tableView: NSTableView,
|
||||||
viewFor tableColumn: NSTableColumn?, row: Int) -> NSView?
|
viewFor tableColumn: NSTableColumn?, row: Int) -> NSView?
|
||||||
{
|
{
|
||||||
let rect = NSRect(x: 0, y: 0, width: tableColumn!.width,
|
let rect = NSRect(x: 0, y: 0, width: tableColumn!.width, height: 20)
|
||||||
height: 20)
|
|
||||||
let cell = PathsTableCellView(frame: rect)
|
let cell = PathsTableCellView(frame: rect)
|
||||||
cell.titleField.stringValue = paths[row]
|
cell.titleField.stringValue = paths[row]
|
||||||
cell.delegate = self
|
cell.delegate = self
|
||||||
|
|||||||
Reference in New Issue
Block a user