|
13 | 13 | import com.ss.editor.ui.component.asset.tree.context.menu.action.*; |
14 | 14 | import com.ss.editor.ui.component.asset.tree.resource.*; |
15 | 15 | import com.ss.editor.ui.util.UiUtils; |
| 16 | +import com.ss.editor.util.EditorUtil; |
16 | 17 | import com.ss.rlib.common.function.IntObjectConsumer; |
17 | 18 | import com.ss.rlib.common.util.StringUtils; |
18 | 19 | import com.ss.rlib.common.util.array.Array; |
19 | 20 | import com.ss.rlib.common.util.array.ArrayComparator; |
20 | 21 | import com.ss.rlib.common.util.array.ArrayFactory; |
21 | 22 | import com.ss.rlib.common.util.array.ConcurrentArray; |
| 23 | +import javafx.application.Platform; |
22 | 24 | import javafx.collections.FXCollections; |
23 | 25 | import javafx.event.EventHandler; |
24 | 26 | import javafx.scene.control.ContextMenu; |
@@ -264,6 +266,18 @@ private void processChangedExpands(@NotNull TreeModificationEvent<?> event) { |
264 | 266 |
|
265 | 267 | getExpandHandler().ifPresent(handler -> |
266 | 268 | handler.accept(getExpandedItemCount(), this)); |
| 269 | + |
| 270 | + repaint(); |
| 271 | + } |
| 272 | + |
| 273 | + private void repaint() { |
| 274 | + |
| 275 | + //FIXME temp fix how to refresh |
| 276 | + var stage = EditorUtil.getFxStage(); |
| 277 | + var old = stage.getWidth(); |
| 278 | + stage.setWidth(old + 1); |
| 279 | + |
| 280 | + Platform.runLater(() -> stage.setWidth(old)); |
267 | 281 | } |
268 | 282 |
|
269 | 283 | /** |
@@ -653,6 +667,8 @@ private void applyNewRoot(@NotNull TreeItem<ResourceElement> newRoot) { |
653 | 667 | if (onLoadHandler != null) { |
654 | 668 | onLoadHandler.accept(Boolean.TRUE); |
655 | 669 | } |
| 670 | + |
| 671 | + repaint(); |
656 | 672 | } |
657 | 673 |
|
658 | 674 | /** |
|
0 commit comments