java - How to style DockPanel.NORTH element independently of DockPanel.CENTER in GWT -
java - How to style DockPanel.NORTH element independently of DockPanel.CENTER in GWT -
in gwt app i'm using dock panel in dockpanel.north
menubar
component, implementing navigation bar while component in dockpanel.center
position displays different panels according alternative selected in navigation bar (is deckpanel
).
my problem navigation bar on dockpanel.north
aligned left. when deckpanel switches wider component navigation bar moves too. each panel in deckpanel
navigation bar in different position, annoying user. great me component in dockpanel.north
centered, seems can center dockpanel
itself, not component in dockpanel.north
.
all components in dockpanel styled with
.navigationpanel{ margin-left: auto; margin-right: auto; text-align:justify; }
the gwt ui binder menubar
item is:
<g:dockpanel> <g:dock direction='north' > <g:menubar ui:field="mainmenu"/> </g:dock> </g:dockpanel>
i have tried playing other properties, .sethorizontalalignment(hashorizontalalignment.align_center);
no success. either, haven't been able tweak right properties
.gwt-menubar{ align: center !important; }
style property @ menubar
component uibinder
interface.
could help me right behavior?
just thought may help don't know without seeing whole template. seek wrapping menu bar within simplepanel or flowpanel , add together style display:block. guess not sure problem looks like. should set width on dockpanel too, maintain resizing time. best if had width knows center menu bar. otherwise move when container grows or shrinks.
<style> .menubar-wrapper { width: 100px; margin: 0 auto; } </style> <g:dockpanel> <g:dock direction='north' > <g:simplepanel stylename="{style.menubar-wrapper}"> <g:menubar ui:field="mainmenu"/> </g:simplepanel> </g:dock> </g:dockpanel>
if doesn't help may seek add together style menu bar float:left;
java html css gwt dockpanel
Comments
Post a Comment