From 8393af2cd6adde2ceeaeb76be24a08d753c865b7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 20 Sep 2012 09:31:04 -0700 Subject: [PATCH] Serialize root view font size --- spec/app/root-view-spec.coffee | 6 ++++++ src/app/root-view.coffee | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/app/root-view-spec.coffee b/spec/app/root-view-spec.coffee index 574892413..bf1a1af3b 100644 --- a/spec/app/root-view-spec.coffee +++ b/spec/app/root-view-spec.coffee @@ -530,6 +530,12 @@ describe "RootView", -> rootView.setFontSize(0) 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 "when there is no active editor", -> beforeEach -> diff --git a/src/app/root-view.coffee b/src/app/root-view.coffee index 316f69fc3..4f77e2356 100644 --- a/src/app/root-view.coffee +++ b/src/app/root-view.coffee @@ -22,9 +22,10 @@ class RootView extends View @div id: 'vertical', outlet: 'vertical', => @div id: 'panes', outlet: 'panes' - @deserialize: ({ projectPath, panesViewState, extensionStates }) -> + @deserialize: ({ projectPath, panesViewState, extensionStates, fontSize }) -> rootView = new RootView(projectPath, extensionStates: extensionStates, suppressOpen: true) rootView.setRootPane(rootView.deserializeView(panesViewState)) if panesViewState + rootView.setFontSize(fontSize) if fontSize > 0 rootView extensions: null @@ -47,6 +48,7 @@ class RootView extends View projectPath: @project?.getPath() panesViewState: @panes.children().view()?.serialize() extensionStates: @serializeExtensions() + fontSize: @getFontSize() handleEvents: -> @on 'toggle-dev-tools', => atom.toggleDevTools()