mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Serialize root view font size
This commit is contained in:
@@ -530,6 +530,12 @@ describe "RootView", ->
|
|||||||
rootView.setFontSize(0)
|
rootView.setFontSize(0)
|
||||||
expect(rootView.getFontSize()).toBe 1
|
expect(rootView.getFontSize()).toBe 1
|
||||||
|
|
||||||
|
it "is serialized and set when deserialized", ->
|
||||||
|
rootView.setFontSize(100)
|
||||||
|
rootView.remove()
|
||||||
|
newRootView = RootView.deserialize(rootView.serialize())
|
||||||
|
expect(newRootView.getFontSize()).toBe(100)
|
||||||
|
|
||||||
describe ".open(path, options)", ->
|
describe ".open(path, options)", ->
|
||||||
describe "when there is no active editor", ->
|
describe "when there is no active editor", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
|
|||||||
@@ -22,9 +22,10 @@ class RootView extends View
|
|||||||
@div id: 'vertical', outlet: 'vertical', =>
|
@div id: 'vertical', outlet: 'vertical', =>
|
||||||
@div id: 'panes', outlet: 'panes'
|
@div id: 'panes', outlet: 'panes'
|
||||||
|
|
||||||
@deserialize: ({ projectPath, panesViewState, extensionStates }) ->
|
@deserialize: ({ projectPath, panesViewState, extensionStates, fontSize }) ->
|
||||||
rootView = new RootView(projectPath, extensionStates: extensionStates, suppressOpen: true)
|
rootView = new RootView(projectPath, extensionStates: extensionStates, suppressOpen: true)
|
||||||
rootView.setRootPane(rootView.deserializeView(panesViewState)) if panesViewState
|
rootView.setRootPane(rootView.deserializeView(panesViewState)) if panesViewState
|
||||||
|
rootView.setFontSize(fontSize) if fontSize > 0
|
||||||
rootView
|
rootView
|
||||||
|
|
||||||
extensions: null
|
extensions: null
|
||||||
@@ -47,6 +48,7 @@ class RootView extends View
|
|||||||
projectPath: @project?.getPath()
|
projectPath: @project?.getPath()
|
||||||
panesViewState: @panes.children().view()?.serialize()
|
panesViewState: @panes.children().view()?.serialize()
|
||||||
extensionStates: @serializeExtensions()
|
extensionStates: @serializeExtensions()
|
||||||
|
fontSize: @getFontSize()
|
||||||
|
|
||||||
handleEvents: ->
|
handleEvents: ->
|
||||||
@on 'toggle-dev-tools', => atom.toggleDevTools()
|
@on 'toggle-dev-tools', => atom.toggleDevTools()
|
||||||
|
|||||||
Reference in New Issue
Block a user