From 9356086dccb36b1cd2952397c5ca2675ffb2d0db Mon Sep 17 00:00:00 2001 From: Exslims Date: Sat, 18 Mar 2017 17:29:00 +0400 Subject: [PATCH] Fixed invisible stash cells after exiting from settings --- .../platform/ui/frame/MovableComponentFrame.java | 2 +- .../platform/ui/frame/impl/ItemsGridFrame.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/MovableComponentFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/MovableComponentFrame.java index 4fec66f1..c34118f4 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/MovableComponentFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/MovableComponentFrame.java @@ -11,7 +11,7 @@ public abstract class MovableComponentFrame extends ComponentFrame { protected Container mainContainer; - private FrameConstraints prevConstraints; + protected FrameConstraints prevConstraints; protected UndecoratedFrameState moveState = UndecoratedFrameState.DEFAULT; protected boolean locationWasChanged = false; protected boolean sizeWasChanged = false; diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/ItemsGridFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/ItemsGridFrame.java index 92de9425..4375fcd1 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/ItemsGridFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/ItemsGridFrame.java @@ -83,12 +83,12 @@ protected void initialize() { this.setPreferredSize(this.getMaximumSize()); this.pack(); } + private ItemCell getGridCell(int x, int y){ JPanel cellPanel = new JPanel(); cellPanel.setOpaque(true); cellPanel.setBackground(AppThemeColor.TRANSPARENT); - ItemCell cell = new ItemCell(x+1,y+1,cellPanel); - return cell; + return new ItemCell(x+1,y+1,cellPanel); } private JPanel getHeaderPanel(){ @@ -125,6 +125,7 @@ public void initHandlers() { } navBar.add(cellHeader); tabButtons.put(nickname + message.getTabName(), cellHeader); + repaint(); pack(); } } @@ -225,6 +226,14 @@ private void closeGridItem(ItemMessage message) { } } + @Override + protected void onLock() { + super.onLock(); + if(navBar.getComponentCount() > 0){ + this.setVisible(true); + } + } + @Override protected JPanel panelWhenMove() { JPanel panel = componentsFactory.getTransparentPanel(new BorderLayout());