-
Notifications
You must be signed in to change notification settings - Fork 436
Incorrect top padding for ToastBar when shown using Component.TOP (since recent update) #4720
Copy link
Copy link
Closed
Description
Describe the bug
There is an empty space above the ToastBar text when showing it at the top of screen using Component.TOP.
Reproduce with the below code. When using setPosition(Component.BOTTOM) instead, it is shown correctly.
Form hi = new Form("Test Toastbar", BorderLayout.center());
Button button = new Button(Command.create("Show toastbar",null,(e)->{
ToastBar.getInstance().setPosition(Component.TOP);
ToastBar.Status myFormToastBar = ToastBar.getInstance().createStatus();
myFormToastBar.setMessage("Test test test test test test test test test test test test test test test test test");
myFormToastBar.setExpires(5000);
myFormToastBar.show();
}));
hi.add(BorderLayout.CENTER, button);
hi.show();
The error has been introduced in one of the recent CN1 updates, and is probably due to these lines in ToastBar private ToastBarComponent getToastBarComponent(boolean create):
else if (position == Component.TOP && safeArea.getY() > 0) {
Style s = c.getAllStyles();
s.setPaddingUnit(Style.UNIT_TYPE_PIXELS);
s.setPaddingTop(safeArea.getY()); // <<-- probably not correct
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels