Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Moved option toggle button
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Jul 9, 2012
1 parent aff69f3 commit 9c2210e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 22 deletions.
Expand Up @@ -374,12 +374,12 @@ private void setOptionsExpended(boolean shouldShowOptions){
if (shouldShowOptions)
{
display.setSidePanelVisible(true);
display.setOptionsToggleTooltip(messages.hideEditorOptions());
display.setOptionsToggleTooltip(messages.hideOptions());
}
else
{
display.setSidePanelVisible(false);
display.setOptionsToggleTooltip(messages.showEditorOptions());
display.setOptionsToggleTooltip(messages.showOptions());
}
}

Expand Down
Expand Up @@ -61,16 +61,16 @@ public interface WebTransMessages extends Messages
@DefaultMessage("Show Translation Suggestions")
String showTranslationMemoryPanel();

@DefaultMessage("Show Editor Options")
String showEditorOptions();
@DefaultMessage("Show Options")
String showOptions();

@DefaultMessage("Hide Editor Options")
String hideEditorOptions();
@DefaultMessage("Hide Options")
String hideOptions();

@DefaultMessage(" Options")
@DefaultMessage(" Options")
String showEditorOptionsLabel();

@DefaultMessage(" Options")
@DefaultMessage(" Options")
String hideEditorOptionsLabel();

@DefaultMessage("▼ Minimise")
Expand Down
Expand Up @@ -74,7 +74,7 @@ interface Styles extends CssResource
@UiField(provided = true)
ToggleButton southPanelToggleButton;

@UiField
@UiField(provided = true)
SplitLayoutPanel mainSplitPanel;

@UiField
Expand All @@ -85,6 +85,7 @@ interface Styles extends CssResource
SplitLayoutPanel tmGlossaryPanel;

private static double SIDE_PANEL_WIDTH = 20;
private static double MIN_SIDE_PANEL_WIDTH = 20;
private static double SOUTH_PANEL_HEIGHT = 150;
private static double MIN_SOUTH_PANEL_HEIGHT = 26;
private final static double GLOSSARY_PANEL_WIDTH = 500;
Expand Down Expand Up @@ -124,15 +125,18 @@ public TranslationView(Resources resources, WebTransMessages messages, Translati
tmGlossaryPanel = new SplitLayoutPanel(3);

optionsToggleButton = new ToggleButton(messages.hideEditorOptionsLabel(), messages.showEditorOptionsLabel());
optionsToggleButton.setTitle(messages.hideEditorOptions());
optionsToggleButton.setTitle(messages.hideOptions());
optionsToggleButton.setDown(true);

southPanelToggleButton = new ToggleButton(messages.restoreLabel(), messages.minimiseLabel());
southPanelToggleButton.setDown(true);

mainSplitPanel = new SplitLayoutPanel(3);

initWidget(uiBinder.createAndBindUi(this));
mainSplitPanel.setWidgetMinSize(sidePanelOuterContainer, (int) SIDE_PANEL_WIDTH);
mainSplitPanel.setWidgetMinSize(southPanelContainer, (int) SOUTH_PANEL_HEIGHT);
// setSplitterHeight("3px");
mainSplitPanel.setWidgetMinSize(sidePanelOuterContainer, (int) MIN_SIDE_PANEL_WIDTH);
mainSplitPanel.setWidgetMinSize(southPanelContainer, (int) MIN_SOUTH_PANEL_HEIGHT);

southPanelTab.add(tmGlossaryPanel, messages.tmGlossaryHeading());
southPanelTab.add(userPanel, messages.nUsersOnline(0));
Expand All @@ -146,6 +150,20 @@ public TranslationView(Resources resources, WebTransMessages messages, Translati

setWorkspaceUsersView(workspaceUsersView.asWidget());
}

// public void setSplitterHeight (String height)
// {
// int widgetCount = mainSplitPanel.getWidgetCount ();
// for (int i = 0; i < widgetCount; i++) {
// Widget w = mainSplitPanel.getWidget (i);
// if (w.getStyleName ().equals ("gwt-SplitLayoutPanel-VDragger")) {
// w.setHeight (height);
// }
// if (w.getStyleName ().equals ("gwt-SplitLayoutPanel-HDragger")) {
// w.setWidth(height);
// }
// }
// }

private void setTranslationMemoryView(Widget translationMemoryView)
{
Expand Down Expand Up @@ -216,7 +234,7 @@ public void setSidePanelVisible(boolean visible)
else
{
SIDE_PANEL_WIDTH = mainSplitPanel.getWidgetContainerElement(sidePanelOuterContainer).getOffsetWidth();
SplitLayoutPanelHelper.setSplitPosition(mainSplitPanel, sidePanelOuterContainer, 0);
SplitLayoutPanelHelper.setSplitPosition(mainSplitPanel, sidePanelOuterContainer, MIN_SIDE_PANEL_WIDTH);
}
splitter.setVisible(visible);
mainSplitPanel.animate(ANIMATE_DURATION);
Expand Down
Expand Up @@ -12,11 +12,25 @@
outline:none;
}

.option-button
{
height:10px;
font-size:10px;
border-radius:5px;
outline:none;
width:52px;
margin-top:23px;
margin-left:-23px;
-webkit-transform:rotate(90deg);
-moz-transform:rotate(90deg);
-o-transform:rotate(90deg);
}

.messageAlert
{
color:#FFA500;
}

</ui:style>

<g:LayoutPanel styleName="translationContainer">
Expand All @@ -41,16 +55,22 @@
<g:LayoutPanel ui:field="editorContainer" />
</g:layer>

<g:layer height="18px" width="70px" right="5px" top="5px">
<g:FlowPanel>
<g:ToggleButton ui:field="optionsToggleButton" addStyleNames="{style.small-button}"/>
</g:FlowPanel>
</g:layer>
<!-- <g:layer height="18px" width="70px" right="5px" top="5px"> -->
<!-- <g:FlowPanel> -->
<!-- <g:ToggleButton ui:field="optionsToggleButton" addStyleNames="{style.small-button}"/> -->
<!-- </g:FlowPanel> -->
<!-- </g:layer> -->
</g:LayoutPanel>
</g:center>
<g:east size="208">
<g:LayoutPanel ui:field="sidePanelOuterContainer">
<g:layer top="0px" bottom="0px">
<g:layer height="66px" width="22px" top="5px">
<g:FlowPanel>
<g:ToggleButton ui:field="optionsToggleButton" addStyleNames="{style.option-button}"/>
</g:FlowPanel>
</g:layer>

<g:layer top="0px" bottom="0px" left="18px" right="0">
<g:LayoutPanel ui:field="sidePanelContainer" />
</g:layer>
</g:LayoutPanel>
Expand Down
Expand Up @@ -542,8 +542,8 @@ private void setupDefaultMockExpectations(Map<EditorClientId, PersonSessionDetai
expect(mockMessages.navigateToPreviousRow()).andReturn(TEST_HIDE_OPTIONS_TOOLTIP).anyTimes();
expect(mockMessages.openEditorInSelectedRow()).andReturn(TEST_HIDE_OPTIONS_TOOLTIP).anyTimes();

expect(mockMessages.showEditorOptions()).andReturn(TEST_SHOW_OPTIONS_TOOLTIP).anyTimes();
expect(mockMessages.hideEditorOptions()).andReturn(TEST_HIDE_OPTIONS_TOOLTIP).anyTimes();
expect(mockMessages.showOptions()).andReturn(TEST_SHOW_OPTIONS_TOOLTIP).anyTimes();
expect(mockMessages.hideOptions()).andReturn(TEST_HIDE_OPTIONS_TOOLTIP).anyTimes();

expect(mockKeyShortcutPresenter.register(capture(capturedKeyShortcuts))).andReturn(mockHandlerRegistration()).times(5);

Expand Down

0 comments on commit 9c2210e

Please sign in to comment.