1515import com .ss .editor .ui .css .CSSIds ;
1616import com .ss .editor .ui .event .EventRedirector ;
1717import com .ss .editor .ui .scene .EditorFXScene ;
18- import javafx .application .Platform ;
1918import javafx .collections .ObservableList ;
20- import javafx .geometry .Insets ;
2119import javafx .scene .Group ;
2220import javafx .scene .canvas .Canvas ;
21+ import javafx .scene .layout .Pane ;
2322import javafx .scene .layout .StackPane ;
23+ import javafx .scene .layout .VBox ;
2424import javafx .stage .Stage ;
2525import org .jetbrains .annotations .NotNull ;
2626import rlib .ui .util .FXUtils ;
@@ -92,6 +92,7 @@ private static void build(@NotNull final EditorFXScene scene, @NotNull final Sta
9292
9393 final GlobalLeftToolSplitPane leftSplitContainer = new GlobalLeftToolSplitPane (scene );
9494 leftSplitContainer .setId (CSSIds .MAIN_SPLIT_PANEL );
95+ leftSplitContainer .prefHeightProperty ().bind (container .heightProperty ());
9596
9697 final GlobalBottomToolSplitPane bottomSplitContainer = new GlobalBottomToolSplitPane (scene );
9798 bottomSplitContainer .setId (CSSIds .MAIN_SPLIT_PANEL );
@@ -105,29 +106,17 @@ private static void build(@NotNull final EditorFXScene scene, @NotNull final Sta
105106 leftSplitContainer .initFor (globalLeftToolComponent , bottomSplitContainer );
106107 bottomSplitContainer .initFor (globalBottomToolComponent , editorAreaComponent );
107108
108- FXUtils .addToPane (leftSplitContainer , container );
109+ final Pane editorBarOffset = new Pane ();
110+ editorBarOffset .setId (CSSIds .EDITOR_BAR_COMPONENT_OFFSET );
111+
112+ FXUtils .addToPane (new VBox (editorBarOffset , leftSplitContainer ), container );
109113 FXUtils .addToPane (barComponent , container );
110114
111115 barComponent .createDrawer (container , stage );
112116 barComponent .toFront ();
113117
118+ FXUtils .bindFixedWidth (editorBarOffset , container .widthProperty ());
114119 FXUtils .bindFixedWidth (leftSplitContainer , container .widthProperty ());
115120 FXUtils .bindFixedWidth (barComponent , container .widthProperty ());
116-
117- barComponent .heightProperty ().addListener ((observable , oldValue , newValue ) ->
118- updateLayout (container , leftSplitContainer , newValue ));
119- }
120-
121- private static void updateLayout (@ NotNull final StackPane container ,
122- @ NotNull final GlobalLeftToolSplitPane leftSplitContainer ,
123- @ NotNull final Number newValue ) {
124-
125- StackPane .setMargin (leftSplitContainer , new Insets (newValue .doubleValue (), 0 , 0 , 0 ));
126- FXUtils .bindFixedHeight (leftSplitContainer , container .heightProperty ().subtract (newValue .doubleValue ()).add (2 ));
127-
128- Platform .runLater (() -> {
129- container .requestLayout ();
130- Platform .runLater (container ::requestLayout );
131- });
132121 }
133122}
0 commit comments