fix: keep notes formatting controls visible
This commit is contained in:
@@ -97,13 +97,9 @@ final class NotesController: NSViewController, NSTextViewDelegate {
|
||||
formatting.addArrangedSubview(button)
|
||||
}
|
||||
formatting.spacing = 8
|
||||
let toggle = iconButton("xmark.circle.fill", label: "Hide formatting", action: #selector(toggleFormatting(_:)))
|
||||
let separator = NSBox()
|
||||
separator.boxType = .separator
|
||||
let footer = NSStackView(views: [formatting, NSView(), separator, toggle])
|
||||
let footer = NSStackView(views: [formatting, NSView()])
|
||||
footer.alignment = .centerY
|
||||
footer.spacing = 8
|
||||
separator.heightAnchor.constraint(equalToConstant: 22).isActive = true
|
||||
editor.delegate = self
|
||||
editor.isRichText = true
|
||||
editor.importsGraphics = true
|
||||
@@ -196,13 +192,6 @@ final class NotesController: NSViewController, NSTextViewDelegate {
|
||||
}
|
||||
|
||||
|
||||
@objc private func toggleFormatting(_ sender: NSButton) {
|
||||
formatting.isHidden.toggle()
|
||||
sender.image = NSImage(systemSymbolName: formatting.isHidden ? "textformat" : "xmark.circle.fill", accessibilityDescription: nil)
|
||||
sender.toolTip = formatting.isHidden ? "Show formatting" : "Hide formatting"
|
||||
sender.setAccessibilityLabel(sender.toolTip)
|
||||
focusEditor()
|
||||
}
|
||||
|
||||
@objc private func formatNote(_ sender: NSButton) {
|
||||
guard editor.isEditable else { return }
|
||||
|
||||
Reference in New Issue
Block a user