Panels resize properly now
This commit is contained in:
parent
25609a8822
commit
88aec67833
@ -37,7 +37,8 @@ public class WindowSwitchListener implements WindowListener, UpdateListener {
|
||||
|
||||
private Label[] tabs = new Label[contents.length];
|
||||
|
||||
private Panel tabsPanel = new Panel().setLayoutManager(new LinearLayout(Direction.HORIZONTAL));
|
||||
private Panel tabsPanel = new Panel()
|
||||
.setLayoutManager(new LinearLayout(Direction.HORIZONTAL));
|
||||
private Panel holderPanel = new Panel();
|
||||
|
||||
int current = contents.length - 1;
|
||||
@ -118,9 +119,11 @@ public class WindowSwitchListener implements WindowListener, UpdateListener {
|
||||
if(currentColumns < tabColumns)
|
||||
{
|
||||
holderPanel.addComponent(
|
||||
contents[current].getPanel().setPreferredSize(new TerminalSize(
|
||||
tabColumns - 2,
|
||||
contents[current].getPanel().getPreferredSize().getRows())));
|
||||
contents[current].getPanel()
|
||||
.setPreferredSize(
|
||||
new TerminalSize(
|
||||
tabColumns - 2,
|
||||
contents[current].getPanel().getPreferredSize().getRows())));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -195,7 +198,8 @@ public class WindowSwitchListener implements WindowListener, UpdateListener {
|
||||
@Override
|
||||
public void updatePanel() {
|
||||
holderPanel.removeAllComponents();
|
||||
// Todo find a way to resize the panel on screen
|
||||
contents[current].getPanel().setPreferredSize(contents[current].getPanel().calculatePreferredSize());
|
||||
setPanelPreferedSize();
|
||||
holderPanel.addComponent(contents[current].getPanel());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user