1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 07:13:24 +03:00

GH-436 Store the uses theme option in user defaults

This commit is contained in:
Tae Won Ha 2017-06-27 06:47:45 +02:00
parent 7a4c5f955e
commit 3ba2d93f48
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 4 additions and 1 deletions

View File

@ -30,6 +30,7 @@ class Keys {
static let key = "appearance"
static let usesTheme = "uses-theme"
static let editorFontName = "editor-font-name"
static let editorFontSize = "editor-font-size"
static let editorLinespacing = "editor-linespacing"

View File

@ -165,7 +165,6 @@ struct AppearanceState: SerializableState {
var linespacing: CGFloat = 1
var usesLigatures = false
// FIXME GH-436: set to false and make it an option
var usesTheme = true
var theme = Marked(Theme.default)
@ -182,6 +181,8 @@ struct AppearanceState: SerializableState {
return nil
}
self.usesTheme = PrefUtils.bool(from: dict, for: Keys.Appearance.usesTheme, default: true)
self.font = PrefUtils.saneFont(editorFontName, fontSize: CGFloat(fEditorFontSize))
self.linespacing = CGFloat(fEditorLinespacing)
self.usesLigatures = editorUsesLigatures
@ -189,6 +190,7 @@ struct AppearanceState: SerializableState {
func dict() -> [String: Any] {
return [
Keys.Appearance.usesTheme: self.usesTheme,
Keys.Appearance.editorFontName: self.font.fontName,
Keys.Appearance.editorFontSize: Float(self.font.pointSize),
Keys.Appearance.editorLinespacing: Float(self.linespacing),