Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions Lib/KeyHolder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
090C241F2462DF49007746B4 /* ClearButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 090C241E2462DF49007746B4 /* ClearButton.swift */; };
093B1449245B262F00D00737 /* Magnet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA21712B2072183500A63D31 /* Magnet.framework */; };
312C0FDF1D13AA1F00973348 /* KeyHolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 312C0FDE1D13AA1F00973348 /* KeyHolder.h */; settings = {ATTRIBUTES = (Public, ); }; };
312C0FE61D13AA1F00973348 /* KeyHolder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 312C0FDB1D13AA1F00973348 /* KeyHolder.framework */; };
312C0FEB1D13AA1F00973348 /* KeyHolderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 312C0FEA1D13AA1F00973348 /* KeyHolderTests.swift */; };
31FAEB611D13CC39008A6D6E /* RecordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31FAEB601D13CC39008A6D6E /* RecordView.swift */; };
FA8D7841247AB738007BFAC1 /* NSColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8D7840247AB738007BFAC1 /* NSColorExtension.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -41,7 +39,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
090C241E2462DF49007746B4 /* ClearButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClearButton.swift; sourceTree = "<group>"; };
312C0FDB1D13AA1F00973348 /* KeyHolder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KeyHolder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
312C0FDE1D13AA1F00973348 /* KeyHolder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeyHolder.h; sourceTree = "<group>"; };
312C0FE01D13AA1F00973348 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -50,7 +47,6 @@
312C0FEC1D13AA1F00973348 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31FAEB601D13CC39008A6D6E /* RecordView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecordView.swift; sourceTree = "<group>"; };
FA2171252072183500A63D31 /* Magnet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Magnet.xcodeproj; path = ../Carthage/Checkouts/Magnet/Lib/Magnet.xcodeproj; sourceTree = "<group>"; };
FA8D7840247AB738007BFAC1 /* NSColorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSColorExtension.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -95,9 +91,7 @@
312C0FDD1D13AA1F00973348 /* KeyHolder */ = {
isa = PBXGroup;
children = (
FA8D783D247AB71C007BFAC1 /* Extensions */,
31FAEB601D13CC39008A6D6E /* RecordView.swift */,
090C241E2462DF49007746B4 /* ClearButton.swift */,
312C0FDE1D13AA1F00973348 /* KeyHolder.h */,
312C0FE01D13AA1F00973348 /* Info.plist */,
);
Expand All @@ -122,14 +116,6 @@
name = Products;
sourceTree = "<group>";
};
FA8D783D247AB71C007BFAC1 /* Extensions */ = {
isa = PBXGroup;
children = (
FA8D7840247AB738007BFAC1 /* NSColorExtension.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
FA99CB492072180B00B04AB9 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -272,9 +258,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
090C241F2462DF49007746B4 /* ClearButton.swift in Sources */,
31FAEB611D13CC39008A6D6E /* RecordView.swift in Sources */,
FA8D7841247AB738007BFAC1 /* NSColorExtension.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
87 changes: 0 additions & 87 deletions Lib/KeyHolder/ClearButton.swift

This file was deleted.

20 changes: 0 additions & 20 deletions Lib/KeyHolder/Extensions/NSColorExtension.swift

This file was deleted.

12 changes: 11 additions & 1 deletion Lib/KeyHolder/RecordView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ open class RecordView: NSView {
}
}

private let clearButton = ClearButton()
private let clearButton: NSButton = {
let button = NSButton()
button.isBordered = false
button.imagePosition = .imageOnly
button.imageScaling = .scaleProportionallyUpOrDown
button.focusRingType = .none
button.contentTintColor = .tertiaryLabelColor
button.image = NSImage(systemSymbolName: "xmark.circle.fill", accessibilityDescription: "clear")
return button
}()
private let modifierEventHandler = ModifierEventHandler()
private let validModifiers: [NSEvent.ModifierFlags] = [.shift, .control, .option, .command]
private let validModifiersText: [NSString] = ["⇧", "⌃", "⌥", "⌘"]
Expand Down Expand Up @@ -165,6 +174,7 @@ open class RecordView: NSView {
let x = bounds.width - clearSize - marginX
let y = (bounds.height - clearSize) / 2
clearButton.frame = NSRect(x: x, y: y, width: clearSize, height: clearSize)
clearButton.font = .systemFont(ofSize: floor(clearSize))
switch clearButtonMode {
case .always:
clearButton.isHidden = false
Expand Down