How do you remove defaul GWT style from CaptionPanel widget?

北城以北 提交于 2020-01-06 09:05:18

问题


How do you remove defaul GWT style from CaptionPanel widget ?

In my .ui.xml I tried pretty much everything. I tried setting stylePrimaryName and styleName to my classname. I also tried defining .gwt-CaptionPanel with no effect.

My .xml looks something like this:

<ui:style src="../common.css">
    .test {
        color: red;
    }

    .gwt-CaptionPanel {

    }
</ui:style>

<g:CaptionPanel captionText="Test" stylePrimaryName="{style.test}">
</g:CaptionPanel>

回答1:


CaptionPanel does not have a default style defined, so .gwt-CaptionPanel that you think exists, actually is not used. CaptionPanel is implemented as a <fieldset> tag so there should be no problem with the color text, but since you are not putting anything inside the caption panel you will not actually see anything.




回答2:


If you want to avoid issues for all controls you can open your AppName.gwt.xml and make sure you've commented out the default styles:

<inherits name='com.google.gwt.user.theme.standard.Standard'/> 
<inherits name='com.google.gwt.user.theme.chrome.Chrome'/> 
<inherits name='com.google.gwt.user.theme.dark.Dark'/>    


来源:https://stackoverflow.com/questions/9356117/how-do-you-remove-defaul-gwt-style-from-captionpanel-widget

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