mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-25 23:02:35 +03:00
GH-436 Store the uses theme option in user defaults
This commit is contained in:
parent
7a4c5f955e
commit
3ba2d93f48
@ -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"
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user