How to restyle the draggers of the SplitLayoutPanel in GWT UIBinder template

与世无争的帅哥 提交于 2019-12-12 13:58:19

问题


can anyone tell me how I can change the style of the draggers in a UIBinder template for the SplitLayoutPanel.

Here is my 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>

The Resources/GlobalStyles.css looks like this:

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;
}

What's wrong here? My draggers are not visible and there is no cursus change.


回答1:


I think GWT doesn't like the nesting. So rewritting the css as follows should make it work:

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

Also GWT will probably complain about the .gwt- styles, in that case the following lines in your css:

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


来源:https://stackoverflow.com/questions/6845291/how-to-restyle-the-draggers-of-the-splitlayoutpanel-in-gwt-uibinder-template

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!