IMEState // Add tooltip duration property.
This commit is contained in:
parent
1f7be00263
commit
401b79a831
|
@ -22,6 +22,7 @@ public protocol IMEStateProtocol {
|
|||
var displayedTextConverted: String { get }
|
||||
var textToCommit: String { get set }
|
||||
var tooltip: String { get set }
|
||||
var tooltipDuration: Double { get set }
|
||||
var attributedString: NSAttributedString { get }
|
||||
var convertedToInputting: IMEStateProtocol { get }
|
||||
var isFilterable: Bool { get }
|
||||
|
@ -53,6 +54,7 @@ public protocol IMEStateDataProtocol {
|
|||
var displayedTextConverted: String { get }
|
||||
var tooltipBackupForInputting: String { get set }
|
||||
var tooltip: String { get set }
|
||||
var tooltipDuration: Double { get set }
|
||||
var attributedStringNormal: NSAttributedString { get }
|
||||
var attributedStringMarking: NSAttributedString { get }
|
||||
var attributedStringPlaceholder: NSAttributedString { get }
|
||||
|
|
|
@ -225,4 +225,9 @@ extension IMEState {
|
|||
get { data.tooltipBackupForInputting }
|
||||
set { data.tooltipBackupForInputting = newValue }
|
||||
}
|
||||
|
||||
public var tooltipDuration: Double {
|
||||
get { type == .ofMarking ? 0 : data.tooltipDuration }
|
||||
set { data.tooltipDuration = newValue }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ public struct IMEStateData: IMEStateDataProtocol {
|
|||
public var candidates = [(String, String)]()
|
||||
public var textToCommit: String = ""
|
||||
public var tooltip: String = ""
|
||||
public var tooltipDuration: Double = 1.0
|
||||
public var tooltipBackupForInputting: String = ""
|
||||
public var attributedStringPlaceholder: NSAttributedString = .init(
|
||||
string: " ",
|
||||
|
|
Loading…
Reference in New Issue