如何在GWT UIBinder模板中重新设置SplitLayoutPanel的拖动器

时间:2011-07-27 13:39:29

标签: gwt uibinder

任何人都可以告诉我如何在SplitLayoutPanel的UIBinder模板中更改拖动器的样式。

这是我的MainMenu.ui.xml:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <ui:style src="Resources/GlobalStyles.css" />

    <g:SplitLayoutPanel width="100%" height="100%" styleName='{style.splitLayoutPanel}'>
        <g:north size="100">
            <g:HTMLPanel/>
        </g:north>
        <g:west size="250">
            <g:HTMLPanel/>
        </g:west>
        <g:center>
            <g:HTMLPanel/>
        </g:center>
        <g:south size="50">
            <g:HTMLPanel
                styleName='{style.footerPanel}'>
                <div>
                    <a href="#">Contact us</a>
                    <a href="#">Privacy</a>
                    <a href="#">About</a>
                </div>
            </g:HTMLPanel>
        </g:south>
    </g:SplitLayoutPanel>

</ui:UiBinder>

Resources / GlobalStyles.css看起来像这样:

body,table {
    font-size: small;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    color: #000;
    background: #red;
}

.splitLayoutPanel { 
    .gwt-SplitLayoutPanel-HDragger { 
        background:#d0e4f6;
        cursor: col-resize;
    }

    .gwt-SplitLayoutPanel-VDragger {
        background: #d0e4f6;
        cursor: row-resize;
    }

}

.footerPanel {
    margin-left: 11px;
    padding: 10px;
    border-top: 2px solid #5693d6;
    text-align: right;
}

这里有什么问题?我的拖拉机不可见,没有诅咒变化。

1 个答案:

答案 0 :(得分:3)

我认为GWT不喜欢嵌套。因此,如下重写css应该可以工作:

.splitLayoutPanel .gwt-SplitLayoutPanel-HDragger { 
    background:#d0e4f6;
    cursor: col-resize;
}
.splitLayoutPanel .gwt-SplitLayoutPanel-VDragger {
    background: #d0e4f6;
    cursor: row-resize;
}

同样GWT可能会抱怨.gwt-样式,在这种情况下你的css中有以下几行:

@external .gwt-SplitLayoutPanel-HDragger;
@external .gwt-SplitLayoutPanel-VDragger;