|
@ -23,6 +23,7 @@ public class MainLayout extends AppLayout { |
|
|
|
|
|
|
|
|
public MainLayout(SecurityService securityService) { |
|
|
public MainLayout(SecurityService securityService) { |
|
|
this.securityService = securityService; |
|
|
this.securityService = securityService; |
|
|
|
|
|
this.getStyle().set("background-image", "url('images/bckgnd.png')"); |
|
|
setPrimarySection(Section.DRAWER); |
|
|
setPrimarySection(Section.DRAWER); |
|
|
addDrawerContent(); |
|
|
addDrawerContent(); |
|
|
addHeaderContent(); |
|
|
addHeaderContent(); |
|
@ -31,6 +32,8 @@ public class MainLayout extends AppLayout { |
|
|
private void addHeaderContent() { |
|
|
private void addHeaderContent() { |
|
|
DrawerToggle toggle = new DrawerToggle(); |
|
|
DrawerToggle toggle = new DrawerToggle(); |
|
|
toggle.setAriaLabel("Menu toggle"); |
|
|
toggle.setAriaLabel("Menu toggle"); |
|
|
|
|
|
toggle.getStyle().set("border-radius", "50px"); |
|
|
|
|
|
toggle.getStyle().set("back-color", "red"); |
|
|
|
|
|
|
|
|
viewTitle = new H2(); |
|
|
viewTitle = new H2(); |
|
|
viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE); |
|
|
viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE); |
|
@ -43,18 +46,18 @@ public class MainLayout extends AppLayout { |
|
|
securityService.logout(); |
|
|
securityService.logout(); |
|
|
}); |
|
|
}); |
|
|
logoutButton.getStyle().set("margin-right", "50px"); |
|
|
logoutButton.getStyle().set("margin-right", "50px"); |
|
|
logoutButton.addThemeVariants(ButtonVariant.LUMO_ERROR); |
|
|
|
|
|
|
|
|
logoutButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY ,ButtonVariant.LUMO_ERROR); |
|
|
|
|
|
|
|
|
HorizontalLayout headerContent = new HorizontalLayout(); |
|
|
HorizontalLayout headerContent = new HorizontalLayout(); |
|
|
headerContent.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER); |
|
|
headerContent.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER); |
|
|
headerContent.setWidthFull(); |
|
|
headerContent.setWidthFull(); |
|
|
|
|
|
headerContent.setHeight("64px"); |
|
|
|
|
|
headerContent.getStyle().set("background-color", "#AA86E0"); |
|
|
headerContent.add(viewTitle); |
|
|
headerContent.add(viewTitle); |
|
|
headerContent.setFlexGrow(1, viewTitle); |
|
|
headerContent.setFlexGrow(1, viewTitle); |
|
|
headerContent.add(usrNameLabel, logoutButton); |
|
|
headerContent.add(usrNameLabel, logoutButton); |
|
|
|
|
|
|
|
|
addToNavbar(false, toggle, headerContent); |
|
|
addToNavbar(false, toggle, headerContent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void addDrawerContent() { |
|
|
private void addDrawerContent() { |
|
@ -64,7 +67,7 @@ public class MainLayout extends AppLayout { |
|
|
headerLayout.setAlignItems(FlexComponent.Alignment.CENTER); |
|
|
headerLayout.setAlignItems(FlexComponent.Alignment.CENTER); |
|
|
|
|
|
|
|
|
Image imgLogo = new Image("images/1027x160.png", "Logo"); |
|
|
Image imgLogo = new Image("images/1027x160.png", "Logo"); |
|
|
imgLogo.setWidth("300px"); |
|
|
|
|
|
|
|
|
imgLogo.setWidth("250px"); |
|
|
|
|
|
|
|
|
headerLayout.add(imgLogo); |
|
|
headerLayout.add(imgLogo); |
|
|
|
|
|
|
|
@ -76,8 +79,9 @@ public class MainLayout extends AppLayout { |
|
|
private SideNav createNavigation() { |
|
|
private SideNav createNavigation() { |
|
|
SideNav nav = new SideNav(); |
|
|
SideNav nav = new SideNav(); |
|
|
|
|
|
|
|
|
nav.addItem(new SideNavItem("Mantenimiento", MantenimientoView.class, VaadinIcon.COGS.create())); |
|
|
|
|
|
nav.addItem(new SideNavItem("Actividad Diaria", ActDiariaView.class, VaadinIcon.ALARM.create())); |
|
|
|
|
|
|
|
|
nav.addItem(new SideNavItem("Mantenimiento", MantenimientoView.class, VaadinIcon.WRENCH.create())); |
|
|
|
|
|
nav.addItem(new SideNavItem("Plan Anual", PlanAnualView.class, VaadinIcon.CALENDAR.create())); |
|
|
|
|
|
nav.addItem(new SideNavItem("Listado de Actividades", ActDiariaView.class, VaadinIcon.EDIT.create())); |
|
|
return nav; |
|
|
return nav; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|