【问题标题】:How to restyle the draggers of the SplitLayoutPanel in GWT UIBinder template如何在 GWT UIBinder 模板中重新设置 SplitLayoutPanel 的拖动器样式
【发布时间】:2011-07-27 13:39:28
【问题描述】:

谁能告诉我如何在 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;
}

这里有什么问题?我的拖动器不可见,也没有更改。

【问题讨论】:

    标签: gwt uibinder


    【解决方案1】:

    我认为 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;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多