|
|
@ -47,6 +47,7 @@ public class XCardSwitchButton extends XButton { |
|
|
|
//设置的图片类型
|
|
|
|
//设置的图片类型
|
|
|
|
private static final String COLORBACKGROUNDTYPE = "ColorBackground"; |
|
|
|
private static final String COLORBACKGROUNDTYPE = "ColorBackground"; |
|
|
|
private static final String DEFAULTTYPE = "default"; |
|
|
|
private static final String DEFAULTTYPE = "default"; |
|
|
|
|
|
|
|
private static final String DEFAULT_FONT_NAME = "SimSun"; |
|
|
|
|
|
|
|
|
|
|
|
//默认颜色
|
|
|
|
//默认颜色
|
|
|
|
public static final Color NORMAL_GRAL = new Color(236,236,236); |
|
|
|
public static final Color NORMAL_GRAL = new Color(236,236,236); |
|
|
@ -65,6 +66,7 @@ public class XCardSwitchButton extends XButton { |
|
|
|
private static final int FONT_SIZE_ADJUST = 2; |
|
|
|
private static final int FONT_SIZE_ADJUST = 2; |
|
|
|
|
|
|
|
|
|
|
|
private static final int SIDE_OFFSET = 57; |
|
|
|
private static final int SIDE_OFFSET = 57; |
|
|
|
|
|
|
|
private static final int FONT_SIZE = 9; |
|
|
|
|
|
|
|
|
|
|
|
private XWCardLayout cardLayout; |
|
|
|
private XWCardLayout cardLayout; |
|
|
|
private XWCardTagLayout tagLayout; |
|
|
|
private XWCardTagLayout tagLayout; |
|
|
@ -320,6 +322,9 @@ public class XCardSwitchButton extends XButton { |
|
|
|
// 标题部分
|
|
|
|
// 标题部分
|
|
|
|
WidgetTitle title = style.getTitle(); |
|
|
|
WidgetTitle title = style.getTitle(); |
|
|
|
FRFont font = button.getFont(); |
|
|
|
FRFont font = button.getFont(); |
|
|
|
|
|
|
|
if (font == null) { |
|
|
|
|
|
|
|
font = FRFont.getInstance(DEFAULT_FONT_NAME, 0, FONT_SIZE); |
|
|
|
|
|
|
|
} |
|
|
|
FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); |
|
|
|
FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); |
|
|
|
UILabel label = this.getContentLabel(); |
|
|
|
UILabel label = this.getContentLabel(); |
|
|
|
label.setFont(newFont); |
|
|
|
label.setFont(newFont); |
|
|
@ -398,6 +403,9 @@ public class XCardSwitchButton extends XButton { |
|
|
|
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); |
|
|
|
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); |
|
|
|
CardSwitchButton cardSwitchButton = (CardSwitchButton) temp.toData(); |
|
|
|
CardSwitchButton cardSwitchButton = (CardSwitchButton) temp.toData(); |
|
|
|
FRFont frFont = cardSwitchButton.getFont(); |
|
|
|
FRFont frFont = cardSwitchButton.getFont(); |
|
|
|
|
|
|
|
if (frFont == null) { |
|
|
|
|
|
|
|
frFont = FRFont.getInstance(DEFAULT_FONT_NAME, 0, FONT_SIZE); |
|
|
|
|
|
|
|
} |
|
|
|
UILabel label = temp.getContentLabel(); |
|
|
|
UILabel label = temp.getContentLabel(); |
|
|
|
label.setSize(dimension); |
|
|
|
label.setSize(dimension); |
|
|
|
label.setFont(frFont.applyResolutionNP(ScreenResolution.getScreenResolution())); |
|
|
|
label.setFont(frFont.applyResolutionNP(ScreenResolution.getScreenResolution())); |
|
|
|