2012-02-20 82 views
0

如何從CaptionPanel控件中刪除默認的GWT風格?如何從CaptionPanel控件中刪除默認的GWT風格?

在我的.ui.xml中,我嘗試了幾乎所有的東西。我嘗試將stylePrimaryNamestyleName設置爲我的類名。我也試着定義.gwt-CaptionPanel沒有效果。

我的.xml看起來是這樣的:

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

    .gwt-CaptionPanel { 

    } 
</ui:style> 

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

回答

2

CaptionPanel沒有定義默認樣式,所以.gwt-CaptionPanel你認爲存在的,實際上沒有使用。 CaptionPanel是作爲<fieldset>標籤實現的,所以顏色文本應該沒有問題,但由於您沒有在標題面板內放置任何東西,所以實際上看不到任何東西。

1

如果你想避免對所有的控制問題,您可以打開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'/>