简体   繁体   English

如何从CaptionPanel小部件中删除默认的GWT样式?

[英]How do you remove defaul GWT style from CaptionPanel widget?

How do you remove defaul GWT style from CaptionPanel widget ? 如何从CaptionPanel小部件中删除默认的GWT样式?

In my .ui.xml I tried pretty much everything. 在我的.ui.xml中,我几乎尝试了所有操作。 I tried setting stylePrimaryName and styleName to my classname. 我尝试将stylePrimaryNamestyleName设置为我的类名。 I also tried defining .gwt-CaptionPanel with no effect. 我也尝试定义.gwt-CaptionPanel无效。

My .xml looks something like this: 我的.xml看起来像这样:

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

    .gwt-CaptionPanel {

    }
</ui:style>

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

CaptionPanel does not have a default style defined, so .gwt-CaptionPanel that you think exists, actually is not used. CaptionPanel没有定义默认样式,因此实际上没有使用您认为存在的.gwt-CaptionPanel 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. CaptionPanel是作为<fieldset>标记实现的,因此颜色文本应该没有问题,但是由于您没有在标题面板中放置任何内容,因此您实际上不会看到任何内容。

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: 如果要避免所有控件出现问题,可以打开AppName.gwt.xml并确保已注释掉默认样式:

<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'/>    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM