Window dimension is dynamic now

This commit is contained in:
2026-05-14 19:47:28 +02:00
parent 9de74b945b
commit ad49cb670c
2 changed files with 22 additions and 9 deletions
@@ -106,7 +106,6 @@ public class MainFXMLController {
renderBoard();
renderLower();
renderSidePanel();
if (Objects.equals(old_state_username, controller.myUsername)) {
renderMyHand();
}
+21 -7
View File
@@ -1,15 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<HBox fx:id="mainHBox" maxHeight="1080.0" maxWidth="1920.0" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1080.0" prefWidth="1920.0" xmlns="http://javafx.com/javafx/26" xmlns:fx="http://javafx.com/fxml/1" fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController" stylesheets="@styles.css">
<HBox fx:id="mainHBox"
maxHeight="Infinity" maxWidth="Infinity"
prefHeight="1080.0" prefWidth="1920.0"
xmlns="http://javafx.com/javafx/26"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController"
stylesheets="@styles.css">
<children>
<VBox prefHeight="1080.0" prefWidth="1486.0" fillWidth="false" alignment="CENTER">
<!-- VBox sinistra: si espande per riempire tutto lo spazio disponibile -->
<VBox alignment="CENTER"
fillWidth="false"
maxHeight="Infinity"
maxWidth="Infinity"
HBox.hgrow="ALWAYS">
<HBox.margin>
<Insets top="5" right="5" bottom="5" left="5" />
</HBox.margin>
@@ -37,8 +45,13 @@
</children>
</VBox>
<VBox fx:id="sidePanel" prefWidth="250.0" styleClass="side-panel">
<!-- VBox destra: dimensione fissa, non si espande -->
<VBox fx:id="sidePanel"
prefWidth="250.0"
maxWidth="250.0"
minWidth="250.0"
HBox.hgrow="NEVER"
styleClass="side-panel">
<HBox.margin>
<Insets bottom="10" left="10" right="10" top="10" />
</HBox.margin>
@@ -67,5 +80,6 @@
</HBox>
</children>
</VBox>
</children>
</HBox>