Skip to content

Commit

Permalink
ensure that the FontSizeManager is initialized after UIPrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 12, 2011
1 parent 46d6e6e commit a7d5377
Showing 1 changed file with 18 additions and 12 deletions.
Expand Up @@ -33,39 +33,43 @@ public class VCSApplicationWindow extends Composite
@Inject
public VCSApplicationWindow(Provider<ReviewPresenter> pReviewPresenter,
Provider<HistoryPresenter> pHistoryPresenter,
EventBus eventBus,
FontSizeManager fontSizeManager)
Provider<EventBus> pEventBus,
Provider<FontSizeManager> pFontSizeManager)
{
// save references
pReviewPresenter_ = pReviewPresenter;
pHistoryPresenter_ = pHistoryPresenter;
pEventBus_ = pEventBus;
pFontSizeManager_ = pFontSizeManager;

// occupy full client area of the window
Window.enableScrolling(false);
Window.setMargin("0px");

// 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)
{
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);
Expand All @@ -86,5 +90,7 @@ public void onResize()

private final Provider<ReviewPresenter> pReviewPresenter_;
private final Provider<HistoryPresenter> pHistoryPresenter_;
private final Provider<EventBus> pEventBus_;
private final Provider<FontSizeManager> pFontSizeManager_;
private LayoutPanel applicationPanel_;
}

0 comments on commit a7d5377

Please sign in to comment.