@ -28,6 +28,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.main.Form ;
import com.fr.form.main.WidgetGather ;
import com.fr.form.parameter.FormSubmitButton ;
import com.fr.form.ui.AbstractBorderStyleWidget ;
import com.fr.form.ui.Button ;
import com.fr.form.ui.CardAddButton ;
import com.fr.form.ui.CardSwitchButton ;
@ -232,7 +233,7 @@ public class XCreatorUtils {
JTemplate < ? , ? > template = HistoryTemplateListCache . getInstance ( ) . getCurrentEditingTemplate ( ) ;
TemplateTheme theme = template . getTemplateTheme ( ) ;
if ( theme instanceof FormTheme ) {
setupTemplateTheme ( creator , ( FormTheme ) theme , TemplateThemeCompatible . NONE ) ;
setupTemplateTheme ( creator , true , ( FormTheme ) theme , TemplateThemeCompatible . NONE ) ;
}
return creator ;
}
@ -378,12 +379,15 @@ public class XCreatorUtils {
return null ;
}
public static void setupTemplateTheme ( XCreator container , final FormTheme currentTemplateUsingTheme , TemplateThemeCompatible compatible ) {
public static void setupTemplateTheme ( XCreator container , final boolean forceFollowingTheme , final FormTheme currentTemplateUsingTheme , TemplateThemeCompatible compatible ) {
FineColorGather colorGather = new FineColorManager . FineColorReplaceByTheme ( currentTemplateUsingTheme , compatible ) ;
Form . traversalWidget ( container . toData ( ) , new WidgetGather ( ) {
@Override
public void dealWith ( Widget widget ) {
TemplateThemeAware < FormTheme > themedWidget = ( TemplateThemeAware ) widget ;
if ( forceFollowingTheme & & widget instanceof AbstractBorderStyleWidget ) {
( ( AbstractBorderStyleWidget ) widget ) . setBorderStyleFollowingTheme ( true ) ;
}
themedWidget . onTemplateUsingThemeChange ( currentTemplateUsingTheme , compatible ) ;
}