public override void setStyle(ButtonStyle style) { Assert.isTrue(style is TextButtonStyle, "style must be a TextButtonStyle"); base.setStyle(style); this.style = (TextButtonStyle)style; if (label != null) { var textButtonStyle = (TextButtonStyle)style; var labelStyle = label.getStyle(); labelStyle.font = textButtonStyle.font; labelStyle.fontColor = textButtonStyle.fontColor; label.setStyle(labelStyle); } }
public void setStyle(ImageTextButtonStyle style) { Insist.isTrue(style is ImageTextButtonStyle, "style must be a ImageTextButtonStyle"); base.setStyle(style); if (image != null) { updateImage(); } if (label != null) { var labelStyle = label.getStyle(); labelStyle.font = style.font; labelStyle.fontColor = style.fontColor; label.setStyle(labelStyle); } }
public void setStyle(WindowStyle style) { this.style = style; setBackground(style.background); var labelStyle = titleLabel.getStyle(); labelStyle.font = style.titleFont ?? labelStyle.font; labelStyle.fontColor = style.titleFontColor; titleLabel.setStyle(labelStyle); invalidateHierarchy(); }