mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Add Fontawesome Icon support
This commit is contained in:
parent
ee7c79fe6a
commit
50239b69bc
2 changed files with 17 additions and 0 deletions
|
@ -43,6 +43,7 @@ dependencies {
|
|||
compile 'de.jensd:fontawesomefx:8.0.0'
|
||||
compile 'de.jensd:fontawesomefx-commons:8.15'
|
||||
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'
|
||||
compile 'de.jensd:fontawesomefx-fontawesome:4.7.0-5'
|
||||
compile 'com.googlecode.jcsv:jcsv:1.4.0'
|
||||
compileOnly 'org.projectlombok:lombok:1.16.16'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.16.16'
|
||||
|
|
|
@ -78,11 +78,13 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
|
||||
import de.jensd.fx.glyphs.GlyphIcons;
|
||||
import de.jensd.fx.glyphs.fontawesome.utils.FontAwesomeIconFactory;
|
||||
import de.jensd.fx.glyphs.materialdesignicons.utils.MaterialDesignIconFactory;
|
||||
|
||||
public class FormBuilder {
|
||||
private static final Logger log = LoggerFactory.getLogger(FormBuilder.class);
|
||||
public static final String MATERIAL_DESIGN_ICONS = "'Material Design Icons'";
|
||||
public static final String FONTAWESOME_ICONS = "FontAwesome";
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1209,6 +1211,20 @@ public class FormBuilder {
|
|||
return getIconForLabel(icon, "0.769em", label);
|
||||
}
|
||||
|
||||
public static Text getIcon(GlyphIcons icon) {
|
||||
Text textIcon;
|
||||
|
||||
if (icon.fontFamily().equals(MATERIAL_DESIGN_ICONS)) {
|
||||
textIcon = MaterialDesignIconFactory.get().createIcon(icon);
|
||||
} else if (icon.fontFamily().equals(FONTAWESOME_ICONS)) {
|
||||
textIcon = FontAwesomeIconFactory.get().createIcon(icon);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Not supported icon type");
|
||||
}
|
||||
|
||||
return textIcon;
|
||||
}
|
||||
|
||||
public static Button getIconButton(GlyphIcons icon) {
|
||||
if (icon.fontFamily().equals(MATERIAL_DESIGN_ICONS)) {
|
||||
final Button textIcon = MaterialDesignIconFactory.get().createIconButton(icon, "","2em", null, ContentDisplay.CENTER);
|
||||
|
|
Loading…
Add table
Reference in a new issue