PCB // Add a leading symbol to keep layout integrity.
This commit is contained in:
parent
b8ebcfb253
commit
5a03fcc510
|
@ -62,6 +62,7 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
let attrString: NSMutableAttributedString = .init(string: state.displayedTextConverted)
|
let attrString: NSMutableAttributedString = .init(string: state.displayedTextConverted)
|
||||||
|
let attrPCBHeader: NSMutableAttributedString = .init(string: " ")
|
||||||
let verticalAttributes: [NSAttributedString.Key: Any] = [
|
let verticalAttributes: [NSAttributedString.Key: Any] = [
|
||||||
.verticalGlyphForm: true,
|
.verticalGlyphForm: true,
|
||||||
.paragraphStyle: {
|
.paragraphStyle: {
|
||||||
|
@ -77,6 +78,9 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
]
|
]
|
||||||
|
|
||||||
if isTypingDirectionVertical {
|
if isTypingDirectionVertical {
|
||||||
|
attrPCBHeader.setAttributes(
|
||||||
|
verticalAttributes, range: NSRange(location: 0, length: attrPCBHeader.length)
|
||||||
|
)
|
||||||
attrString.setAttributes(
|
attrString.setAttributes(
|
||||||
verticalAttributes, range: NSRange(location: 0, length: attrString.length)
|
verticalAttributes, range: NSRange(location: 0, length: attrString.length)
|
||||||
)
|
)
|
||||||
|
@ -128,6 +132,8 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
: NSMutableAttributedString(string: "_", attributes: cursorAttributes)
|
: NSMutableAttributedString(string: "_", attributes: cursorAttributes)
|
||||||
attrString.insert(attrCursor, at: state.u16Cursor)
|
attrString.insert(attrCursor, at: state.u16Cursor)
|
||||||
|
|
||||||
|
attrString.insert(attrPCBHeader, at: 0)
|
||||||
|
|
||||||
textShown = attrString
|
textShown = attrString
|
||||||
messageTextField.maximumNumberOfLines = 1
|
messageTextField.maximumNumberOfLines = 1
|
||||||
if let editor = messageTextField.currentEditor() {
|
if let editor = messageTextField.currentEditor() {
|
||||||
|
|
Loading…
Reference in New Issue