From a7d5377e69db6154c3dacfbd98c00fa892f37f47 Mon Sep 17 00:00:00 2001 From: JJ Allaire Date: Sat, 12 Nov 2011 16:13:57 -0500 Subject: [PATCH] ensure that the FontSizeManager is initialized after UIPrefs --- .../client/vcs/ui/VCSApplicationWindow.java | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/gwt/src/org/rstudio/studio/client/vcs/ui/VCSApplicationWindow.java b/src/gwt/src/org/rstudio/studio/client/vcs/ui/VCSApplicationWindow.java index 340a1a17ae0..f6058117083 100644 --- a/src/gwt/src/org/rstudio/studio/client/vcs/ui/VCSApplicationWindow.java +++ b/src/gwt/src/org/rstudio/studio/client/vcs/ui/VCSApplicationWindow.java @@ -33,12 +33,14 @@ public class VCSApplicationWindow extends Composite @Inject public VCSApplicationWindow(Provider pReviewPresenter, Provider pHistoryPresenter, - EventBus eventBus, - FontSizeManager fontSizeManager) + Provider pEventBus, + Provider pFontSizeManager) { // save references pReviewPresenter_ = pReviewPresenter; pHistoryPresenter_ = pHistoryPresenter; + pEventBus_ = pEventBus; + pFontSizeManager_ = pFontSizeManager; // occupy full client area of the window Window.enableScrolling(false); @@ -46,8 +48,17 @@ public VCSApplicationWindow(Provider pReviewPresenter, // create application panel applicationPanel_ = new LayoutPanel(); - + + // init widget + initWidget(applicationPanel_); + } + + + @Override + public void show() + { // react to font size changes + EventBus eventBus = pEventBus_.get(); eventBus.addHandler(ChangeFontSizeEvent.TYPE, new ChangeFontSizeHandler() { public void onChangeFontSize(ChangeFontSizeEvent event) @@ -55,17 +66,10 @@ public void onChangeFontSize(ChangeFontSizeEvent event) FontSizer.setNormalFontSize(Document.get(), event.getFontSize()); } }); + FontSizeManager fontSizeManager = pFontSizeManager_.get(); FontSizer.setNormalFontSize(Document.get(), fontSizeManager.getSize()); - - // init widget - initWidget(applicationPanel_); - } - - - @Override - public void show() - { + // show the popup VCSPopup.show(pReviewPresenter_.get(), pHistoryPresenter_.get(), false); @@ -86,5 +90,7 @@ public void onResize() private final Provider pReviewPresenter_; private final Provider pHistoryPresenter_; + private final Provider pEventBus_; + private final Provider pFontSizeManager_; private LayoutPanel applicationPanel_; }