Skip to content

Commit

Permalink
initial work requiring for hiding the toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jun 27, 2011
1 parent 4ab3a96 commit 4a51b21
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 13 deletions.
Expand Up @@ -65,6 +65,8 @@ public interface ThemeResources extends ClientBundle
DataResource horizontalHandle();

ImageResource rstudio();
ImageResource rstudio_small();

@Source("backgroundGradient.png")
DataResource backgroundGradient();

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -17,4 +17,7 @@
public interface ApplicationHeader extends IsWidget
{
int getPreferredHeight();

boolean isToolbarVisible();
void showToolbar(boolean showToolbar);
}
Expand Up @@ -47,22 +47,23 @@ public ApplicationWindow(ApplicationHeader applicationHeader,
applicationPanel_ = new LayoutPanel();

// header bar
applicationHeader_ = applicationHeader.asWidget();
applicationHeader_.setWidth("100%");
applicationHeader_ = applicationHeader;
Widget applicationHeaderWidget = applicationHeader_.asWidget();
applicationHeaderWidget.setWidth("100%");
applicationPanel_.add(applicationHeader_);
headerHeight_ = applicationHeader.getPreferredHeight();
int headerHeight = applicationHeader.getPreferredHeight();
applicationPanel_.setWidgetTopHeight(applicationHeader_,
0,
Style.Unit.PX,
headerHeight_,
headerHeight,
Style.Unit.PX);
applicationPanel_.setWidgetLeftRight(applicationHeader_,
0,
Style.Unit.PX,
0,
Style.Unit.PX);

applicationHeader_.setVisible(false);
applicationHeaderWidget.setVisible(false);

// main view container
initWidget(applicationPanel_);
Expand Down Expand Up @@ -125,7 +126,7 @@ public void showWorkbenchView(Widget workbenchScreen)
{
workbenchScreen_ = workbenchScreen;

applicationHeader_.setVisible(true);
applicationHeader_.asWidget().setVisible(true);
applicationPanel_.add(workbenchScreen_);
updateWorkbenchTopBottom();
applicationPanel_.setWidgetLeftRight(workbenchScreen_,
Expand Down Expand Up @@ -171,7 +172,7 @@ private void updateWorkbenchTopBottom()
{
applicationPanel_.setWidgetTopBottom(
workbenchScreen_,
headerHeight_,
applicationHeader_.getPreferredHeight(),
Unit.PX,
workbenchBottom_,
Unit.PX);
Expand Down Expand Up @@ -248,8 +249,7 @@ public void onResize()

// main applilcation UI components
private LayoutPanel applicationPanel_ ;
private Widget applicationHeader_ ;
private int headerHeight_ ;
private ApplicationHeader applicationHeader_ ;

// active serialization progress message
private ApplicationSerializationProgress activeSerializationProgress_;
Expand Down
Expand Up @@ -104,6 +104,16 @@ public void onShowFolder(ShowFolderEvent event)
ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
toolbar_.addStyleName(styles.desktopGlobalToolbar());
}

public boolean isToolbarVisible()
{
return toolbar_.isVisible();
}

public void showToolbar(boolean showToolbar)
{

}

@Handler
void onUndoDummy()
Expand Down Expand Up @@ -155,7 +165,10 @@ void onShowAboutDialog()

public int getPreferredHeight()
{
return 32;
if (toolbar_.isVisible())
return 32;
else
return 5;
}

public Widget asWidget()
Expand Down
Expand Up @@ -146,11 +146,11 @@ public void onSessionInit(SessionInitEvent sie)
});

// create toolbar
GlobalToolbar toolbar = new GlobalToolbar(commands, fileTypeCommands);
toolbar.addStyleName(themeResources.themeStyles().webGlobalToolbar());
toolbar_ = new GlobalToolbar(commands, fileTypeCommands);
toolbar_.addStyleName(themeResources.themeStyles().webGlobalToolbar());

// add widgets to header panel
outerPanel.add(new HeaderPanel(headerBarPanel, toolbar));
outerPanel.add(new HeaderPanel(headerBarPanel, toolbar_));

// logo
Image logo = new Image(ThemeResources.INSTANCE.rstudio());
Expand All @@ -164,6 +164,16 @@ public void onSessionInit(SessionInitEvent sie)
// initialize widget
initWidget(outerPanel);
}

public boolean isToolbarVisible()
{
return toolbar_.isVisible();
}

public void showToolbar(boolean showToolbar)
{

}

private native final void suppressBrowserForwardBack() /*-{
var outerWindow = $wnd.parent;
Expand Down Expand Up @@ -333,6 +343,7 @@ public Widget asWidget()

private HorizontalPanel headerBarCommandsPanel_;
private AppMenuBar mainMenu_;
private GlobalToolbar toolbar_;
private EventBus eventBus_;
private GlobalDisplay globalDisplay_;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a51b21

Please sign in to comment.