Skip to content

Commit

Permalink
For #396 - fixed incorrect collapsing of the 'Style' menu when screen…
Browse files Browse the repository at this point in the history
… width is small enough so the archive toolbar don't fit
  • Loading branch information
vitalidze committed Dec 10, 2015
1 parent c6b02b1 commit 1ced32c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/traccar/web/client/view/ArchiveView.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.sencha.gxt.widget.core.client.event.CloseEvent;
import com.sencha.gxt.widget.core.client.form.*;
import com.sencha.gxt.widget.core.client.menu.*;
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
import org.traccar.web.client.ApplicationContext;
import org.traccar.web.client.ArchiveStyle;
import org.traccar.web.client.i18n.Messages;
Expand Down Expand Up @@ -110,7 +111,7 @@ public ContentPanel getView() {
CheckBox snapToRoads;

@UiField(provided = true)
Label styleButtonTrackColor;
LabelToolItem styleButtonTrackColor;

@UiField
TextButton styleButton;
Expand Down Expand Up @@ -146,7 +147,7 @@ public ArchiveView(final ArchiveHandler archiveHandler, ListStore<Device> device
periodCombo = new PeriodComboBox();

// Element that displays the current track color
styleButtonTrackColor = new Label();
styleButtonTrackColor = new LabelToolItem();
styleButtonTrackColor.getElement().getStyle().setProperty("backgroundColor", "#".concat(ArchiveStyle.DEFAULT_COLOR));
// Menu with the small palette
smallColorMenu = new ExtColorMenu(ArchiveStyle.COLORS, ArchiveStyle.COLORS);
Expand Down
52 changes: 25 additions & 27 deletions src/main/java/org/traccar/web/client/view/ArchiveView.ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,31 @@
<toolbar:LabelToolItem width="2" />
<form:CheckBox ui:field="snapToRoads" boxLabel="{i18n.snapToRoads}" stateful="true" stateId="snapToRoads" />

<toolbar:ToolBar ui:field="styleToolbar">
<g:Label ui:field="styleButtonTrackColor" text="&nbsp;&nbsp;&nbsp;&nbsp;" />
<button:TextButton ui:field="styleButton" text="{i18n.style}">
<button:menu>
<menu:Menu ui:field="menu1">
<menu:CheckMenuItem ui:field="zoomToTrackMenu" text="{i18n.zoomToTrack}" />
<menu:SeparatorMenuItem />
<menu:MenuItem ui:field="markersMenu">
<menu:submenu>
<menu:Menu ui:field="routeMarkersType" />
</menu:submenu>
</menu:MenuItem>
<menu:SeparatorMenuItem />
<menu:MenuItem ui:field="fullPaletteMenu" text="{i18n.fullPalette}">
<menu:submenu>
<menu:ColorMenu ui:field="fullColorMenu" />
</menu:submenu>
</menu:MenuItem>
<menu:MenuItem ui:field="smallPaletteMenu" text="{i18n.smallPalette}">
<menu:submenu>
<menu:ColorMenu ui:field="smallColorMenu" />
</menu:submenu>
</menu:MenuItem>
</menu:Menu>
</button:menu>
</button:TextButton>
</toolbar:ToolBar>
<toolbar:LabelToolItem ui:field="styleButtonTrackColor" label="&nbsp;&nbsp;&nbsp;&nbsp;" />
<button:TextButton ui:field="styleButton" text="{i18n.style}">
<button:menu>
<menu:Menu ui:field="menu1">
<menu:CheckMenuItem ui:field="zoomToTrackMenu" text="{i18n.zoomToTrack}" />
<menu:SeparatorMenuItem />
<menu:MenuItem ui:field="markersMenu">
<menu:submenu>
<menu:Menu ui:field="routeMarkersType" />
</menu:submenu>
</menu:MenuItem>
<menu:SeparatorMenuItem />
<menu:MenuItem ui:field="fullPaletteMenu" text="{i18n.fullPalette}">
<menu:submenu>
<menu:ColorMenu ui:field="fullColorMenu" />
</menu:submenu>
</menu:MenuItem>
<menu:MenuItem ui:field="smallPaletteMenu" text="{i18n.smallPalette}">
<menu:submenu>
<menu:ColorMenu ui:field="smallColorMenu" />
</menu:submenu>
</menu:MenuItem>
</menu:Menu>
</button:menu>
</button:TextButton>

<toolbar:SeparatorToolItem />

Expand Down

0 comments on commit 1ced32c

Please sign in to comment.