File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/test/java/com/flowingcode/addons/applayout Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 2020package com .flowingcode .addons .applayout ;
2121
2222import com .vaadin .flow .component .HasElement ;
23+ import com .vaadin .flow .component .html .Div ;
24+ import com .vaadin .flow .component .html .H4 ;
25+ import com .vaadin .flow .component .html .Image ;
26+ import com .vaadin .flow .component .html .Span ;
2327
2428public class AbstractLayoutDemo extends AbstractFcAppRouterLayout {
2529
2630 @ Override
2731 protected void configure (AppLayout app ) {
2832 app .setMenuItems (new MenuItem ("Item 1" ), new MenuItem ("Item 2" ));
33+
34+ // menu header
35+ Div container = new Div ();
36+ container .getElement ().setAttribute ("style" , "text-align: center;" );
37+ Image img = new Image ("frontend/images/avatar.png" , "avatar" );
38+ img .getStyle ().set ("width" , "80px" );
39+ img .getStyle ().set ("margin-top" , "20px" );
40+ H4 h4 = new H4 ("User" );
41+ container .add (img , h4 );
42+ app .setMenuHeader (container );
43+
44+ // logo
45+ Image imglogo = new Image ("frontend/images/applogo.png" , "applogo" );
46+ imglogo .setWidth ("25px" );
47+ app .addToTitleSection (imglogo );
48+
49+ // title
50+ app .addToTitleSection (new Div (new Span ("Test Application" )));
2951 }
3052
3153 @ Override
You can’t perform that action at this time.
0 commit comments