CodenameOne
CodenameOne copied to clipboard
RFE: add setTitleComponent method to Sheet
I need to slightly customize the title area of a Sheet by adding a small picture above the title.
If it was a Form, I would trick the problem by using the setTitleComponent method and passing it a Container with the title and the image above the title.
In this case, since there isn't this method, for the moment I tricked the problem with this code, which relies on implementation details:
Sheet sheet = new Sheet(null, "Login-Choice-Email-Confirm-Intro", "MySheet");
sheet.hideBackButton();
sheet.getCommandsContainer().getParent().add(BorderLayout.NORTH, FlowLayout.encloseCenter(new Label(UI.getThemeImage("handle.png"), "MySheetHandle")));
sheet.getContentPane().setUIID("MySheetContentPane");
sheet.getContentPane().addAll(okBtn, cancelBtn, dialogBody);
sheet.show();
Of course the trick is sheet.getCommandsContainer().getParent(), but I would prefer to use a more appropriate code.
Thank you