ctlIME // Move kMinKeyLabelSize to mgrPrefs.
This commit is contained in:
parent
e2be81865e
commit
80a1c11cbd
|
@ -27,9 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
import Cocoa
|
import Cocoa
|
||||||
import InputMethodKit
|
import InputMethodKit
|
||||||
|
|
||||||
/// 最小選字鍵字號。
|
|
||||||
private let kMinKeyLabelSize: CGFloat = 10
|
|
||||||
|
|
||||||
/// 目前在用的的選字窗副本。
|
/// 目前在用的的選字窗副本。
|
||||||
private var ctlCandidateCurrent = ctlCandidateUniversal.init(.horizontal)
|
private var ctlCandidateCurrent = ctlCandidateUniversal.init(.horizontal)
|
||||||
|
|
||||||
|
@ -488,7 +485,7 @@ extension ctlInputMethod {
|
||||||
|
|
||||||
// set the attributes for the candidate panel (which uses NSAttributedString)
|
// set the attributes for the candidate panel (which uses NSAttributedString)
|
||||||
let textSize = mgrPrefs.candidateListTextSize
|
let textSize = mgrPrefs.candidateListTextSize
|
||||||
let keyLabelSize = max(textSize / 2, kMinKeyLabelSize)
|
let keyLabelSize = max(textSize / 2, mgrPrefs.minKeyLabelSize)
|
||||||
|
|
||||||
func labelFont(name: String?, size: CGFloat) -> NSFont {
|
func labelFont(name: String?, size: CGFloat) -> NSFont {
|
||||||
if let name = name {
|
if let name = name {
|
||||||
|
|
|
@ -75,7 +75,7 @@ struct UserDef {
|
||||||
}
|
}
|
||||||
|
|
||||||
private let kDefaultCandidateListTextSize: CGFloat = 18
|
private let kDefaultCandidateListTextSize: CGFloat = 18
|
||||||
private let kMinKeyLabelSize: CGFloat = 10
|
private let kDefaultMinKeyLabelSize: CGFloat = 10
|
||||||
private let kMinCandidateListTextSize: CGFloat = 12
|
private let kMinCandidateListTextSize: CGFloat = 12
|
||||||
private let kMaxCandidateListTextSize: CGFloat = 196
|
private let kMaxCandidateListTextSize: CGFloat = 196
|
||||||
|
|
||||||
|
@ -331,6 +331,8 @@ public enum mgrPrefs {
|
||||||
@CandidateListTextSize(key: UserDef.kCandidateListTextSize)
|
@CandidateListTextSize(key: UserDef.kCandidateListTextSize)
|
||||||
static var candidateListTextSize: CGFloat
|
static var candidateListTextSize: CGFloat
|
||||||
|
|
||||||
|
static var minKeyLabelSize: CGFloat { kDefaultMinKeyLabelSize }
|
||||||
|
|
||||||
@UserDefault(key: UserDef.kShouldAutoReloadUserDataFiles, defaultValue: true)
|
@UserDefault(key: UserDef.kShouldAutoReloadUserDataFiles, defaultValue: true)
|
||||||
static var shouldAutoReloadUserDataFiles: Bool
|
static var shouldAutoReloadUserDataFiles: Bool
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue