[FEATURE] FontAwesome Icons
CI / build-and-test (pull_request) Successful in 1m9s

This commit is contained in:
Pit Friedrich
2026-07-19 23:39:10 +02:00
parent 38d3cbe38a
commit aca411ca9e
8 changed files with 74 additions and 11 deletions
@@ -1,5 +1,6 @@
package com.example.views;
import com.example.components.Fa;
import com.example.js.CommonJS;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.applayout.AppLayout;
@@ -7,7 +8,6 @@ import com.vaadin.flow.component.applayout.DrawerToggle;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.menubar.MenuBar;
import com.vaadin.flow.component.menubar.MenuBarVariant;
import com.vaadin.flow.component.sidenav.SideNav;
@@ -20,7 +20,7 @@ import java.util.Locale;
@Layout
public class MainLayout extends AppLayout {
private final Button themeToggle = new Button(VaadinIcon.MOON.create());
private final Button themeToggle = new Button(Fa.MOON.create());
public MainLayout() {
DrawerToggle toggle = new DrawerToggle();
@@ -44,11 +44,11 @@ public class MainLayout extends AppLayout {
SideNav nav = new SideNav();
nav.addItem(new SideNavItem(getTranslation("nav.dashboard"), DashboardView.class,
VaadinIcon.DASHBOARD.create()));
Fa.DASHBOARD.create()));
nav.addItem(new SideNavItem(getTranslation("nav.form"), FormView.class,
VaadinIcon.FORM.create()));
Fa.FORM.create()));
nav.addItem(new SideNavItem(getTranslation("nav.table"), TableView.class,
VaadinIcon.TABLE.create()));
Fa.TABLE.create()));
addToDrawer(nav);
}
@@ -57,7 +57,7 @@ public class MainLayout extends AppLayout {
MenuBar menuBar = new MenuBar();
menuBar.addThemeVariants(MenuBarVariant.LUMO_TERTIARY_INLINE);
var root = menuBar.addItem(VaadinIcon.GLOBE_WIRE.create());
var root = menuBar.addItem(Fa.GLOBE.create());
root.setAriaLabel(getTranslation("action.language"));
root.getSubMenu().addItem(getTranslation("lang.de"), e -> switchLanguage(Locale.GERMAN));
@@ -73,6 +73,6 @@ public class MainLayout extends AppLayout {
}
private void applyIconFor(String theme) {
themeToggle.setIcon("dark".equals(theme) ? VaadinIcon.SUN_O.create() : VaadinIcon.MOON.create());
themeToggle.setIcon("dark".equals(theme) ? Fa.SUN.create() : Fa.MOON.create());
}
}
@@ -1,9 +1,9 @@
package com.example.views;
import com.example.components.Card;
import com.example.components.Fa;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.grid.dataview.GridListDataView;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.data.value.ValueChangeMode;
@@ -45,7 +45,7 @@ public class TableView extends VerticalLayout implements HasDynamicTitle {
TextField suche = new TextField();
suche.setPlaceholder(getTranslation("table.search"));
suche.setPrefixComponent(VaadinIcon.SEARCH.create());
suche.setPrefixComponent(Fa.SEARCH.create());
suche.setClearButtonVisible(true);
suche.setValueChangeMode(ValueChangeMode.EAGER);
suche.setWidthFull();