In my GWT app I'm using a dock panel in which DockPanel.NORTH
is a MenuBar
component, implementing my navigation bar while the component in the DockPanel.CENTER
position displays different panels according to the option selected in the navigation bar (is a DeckPanel
).
My problem is that the navigation bar on DockPanel.NORTH
is always aligned to the left. When the DeckPanel switches to a wider component the navigation bar moves too. So for each panel in the DeckPanel
the navigation bar could be in a different position, which is annoying for the user. It would be great to me is this component in DockPanel.NORTH
could be always centered, but it seems that I can center the DockPanel
itself, but not the component in DockPanel.NORTH
.
All the components in this DockPanel are styled with
.navigationPanel{
margin-left: auto;
margin-right: auto;
text-align:justify;
}
The GWT UI Binder for the MenuBar
item is:
<g:DockPanel>
<g:Dock direction='NORTH' >
<g:MenuBar ui:field="mainMenu"/>
</g:Dock>
</g:DockPanel>
I have tried playing with other properties, like .setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
with no success. Either, I haven't been able to tweak the right properties for the
.gwt-MenuBar{
align: center !important;
}
style property at the MenuBar
component UiBinder
interface.
Could anybody help me correct this behavior?