3939import javafx .scene .layout .HBox ;
4040import javafx .scene .layout .StackPane ;
4141import javafx .scene .layout .VBox ;
42- import javafx .scene .shape .Rectangle ;
4342import javafx .scene .text .TextFlow ;
4443import javafx .util .Duration ;
4544import org .jackhuang .hmcl .Metadata ;
@@ -207,10 +206,8 @@ public final class MainPage extends StackPane implements DecoratorPage {
207206 updatePane .getChildren ().setAll (hBox , closeUpdateButton );
208207 }
209208
210- StackPane launchPane = new StackPane ();
209+ HBox launchPane = new HBox ();
211210 launchPane .getStyleClass ().add ("launch-pane" );
212- launchPane .setMaxWidth (230 );
213- launchPane .setMaxHeight (55 );
214211 FXUtils .onScroll (launchPane , versions , list -> {
215212 String currentId = getCurrentGame ();
216213 return Lang .indexWhere (list , instance -> instance .getId ().equals (currentId ));
@@ -219,16 +216,11 @@ public final class MainPage extends StackPane implements DecoratorPage {
219216 StackPane .setAlignment (launchPane , Pos .BOTTOM_RIGHT );
220217 {
221218 JFXButton launchButton = new JFXButton ();
222- launchButton .setPrefWidth (230 );
223- launchButton .setPrefHeight (55 );
224- //launchButton.setButtonType(JFXButton.ButtonType.RAISED);
219+ launchButton .getStyleClass ().add ("launch-button" );
225220 launchButton .setDefaultButton (true );
226- launchButton .setClip (new Rectangle (-100 , -100 , 310 , 200 ));
227221 {
228222 VBox graphic = new VBox ();
229223 graphic .setAlignment (Pos .CENTER );
230- graphic .setTranslateX (-7 );
231- graphic .setMaxWidth (200 );
232224 Label launchLabel = new Label ();
233225 launchLabel .setStyle ("-fx-font-size: 16px;" );
234226 Label currentLabel = new Label ();
@@ -261,26 +253,11 @@ public void accept(String currentGame) {
261253 launchButton .setGraphic (graphic );
262254 }
263255
264- Rectangle separator = new Rectangle ();
265- separator .setWidth (1 );
266- separator .setHeight (57 );
267- separator .setTranslateX (95 );
268- separator .setMouseTransparent (true );
269-
270256 menuButton = new JFXButton ();
271- menuButton .setPrefHeight (55 );
272- menuButton .setPrefWidth (230 );
273- //menuButton.setButtonType(JFXButton.ButtonType.RAISED);
274- menuButton .setStyle ("-fx-font-size: 15px;" );
257+ menuButton .getStyleClass ().add ("menu-button" );
275258 menuButton .setOnAction (e -> onMenu ());
276- menuButton .setClip (new Rectangle (211 , -100 , 100 , 200 ));
277- StackPane graphic = new StackPane ();
278- Node svg = SVG .ARROW_DROP_UP .createIcon (30 );
279- StackPane .setAlignment (svg , Pos .CENTER_RIGHT );
280- graphic .getChildren ().setAll (svg );
281- graphic .setTranslateX (6 );
282259 FXUtils .installFastTooltip (menuButton , i18n ("version.switch" ));
283- menuButton .setGraphic (graphic );
260+ menuButton .setGraphic (SVG . ARROW_DROP_UP . createIcon ( 30 ) );
284261
285262 EventHandler <MouseEvent > secondaryClickHandle = event -> {
286263 if (event .getButton () == MouseButton .SECONDARY && event .getClickCount () == 1 ) {
@@ -291,7 +268,7 @@ public void accept(String currentGame) {
291268 launchButton .addEventHandler (MouseEvent .MOUSE_CLICKED , secondaryClickHandle );
292269 menuButton .addEventHandler (MouseEvent .MOUSE_CLICKED , secondaryClickHandle );
293270
294- launchPane .getChildren ().setAll (launchButton , separator , menuButton );
271+ launchPane .getChildren ().setAll (launchButton , menuButton );
295272 }
296273
297274 getChildren ().addAll (updatePane , launchPane );
0 commit comments