Changed: Temp Fix Board Dim

This commit is contained in:
rubenpirreram
2026-05-25 18:09:19 +02:00
parent 01dec853e2
commit 1dc3052df1
3 changed files with 72 additions and 74 deletions
@@ -109,9 +109,6 @@ public class GUI extends Application implements IView {
double h = primaryStage.getHeight(); double h = primaryStage.getHeight();
primaryStage.setWidth(w); primaryStage.setWidth(w);
primaryStage.setHeight(h); primaryStage.setHeight(h);
primaryStage.setMinHeight(h);
primaryStage.setMinWidth(w);
primaryStage.setResizable(false);
primaryStage.setScene(mainScene); primaryStage.setScene(mainScene);
controllerMain.render(); controllerMain.render();
} }
@@ -41,6 +41,7 @@ import java.util.*;
public class MainFXMLController { public class MainFXMLController {
@FXML private GridPane leftGrid;
@FXML private ScrollPane playerSide; @FXML private ScrollPane playerSide;
@FXML private HBox mainHBox; @FXML private HBox mainHBox;
@FXML private ImageView backgroundImage; @FXML private ImageView backgroundImage;
@@ -157,7 +158,7 @@ public class MainFXMLController {
// ==== ELEMENTS ==== // ==== ELEMENTS ====
private StackPane createOrder(String num) { private StackPane createOrder(String num) {
ImageView img = new ImageView(loadImage("/GUIImages/Orders/order-" + num + ".png")); ImageView img = new ImageView(loadImage("/GUIImages/Orders/order-" + num + ".png"));
img.fitHeightProperty().bind(board.heightProperty().multiply(0.94)); img.fitHeightProperty().bind(board.sceneProperty().get().heightProperty().subtract(40).divide(4).multiply(0.94));
img.setPreserveRatio(true); img.setPreserveRatio(true);
addClip(img); addClip(img);
return new StackPane(img); return new StackPane(img);
@@ -166,7 +167,7 @@ public class MainFXMLController {
private StackPane createSlot(Slot slot, boolean withZoom, boolean withShadow) { private StackPane createSlot(Slot slot, boolean withZoom, boolean withShadow) {
ImageView img = new ImageView(loadImage("/GUIImages/Fronts/card-" + slot.getSlotId() + ".png")); ImageView img = new ImageView(loadImage("/GUIImages/Fronts/card-" + slot.getSlotId() + ".png"));
img.setPreserveRatio(true); img.setPreserveRatio(true);
img.fitHeightProperty().bind(board.heightProperty().multiply(0.94)); // TODO perchè è tutto moltiplicato per una costante ma in board facciamo -15? img.fitHeightProperty().bind(board.sceneProperty().get().heightProperty().subtract(40).divide(4).multiply(0.94)); // TODO perchè è tutto moltiplicato per una costante ma in board facciamo -15?
addClip(img); addClip(img);
StackPane wrapper = new StackPane(img); StackPane wrapper = new StackPane(img);
@@ -188,7 +189,7 @@ public class MainFXMLController {
private StackPane createCard(PlayableCard card, boolean withZoom, boolean withShadow, Region parent) { private StackPane createCard(PlayableCard card, boolean withZoom, boolean withShadow, Region parent) {
ImageView img = new ImageView(loadImage("/GUIImages/Fronts/card-" + card.getIdIMG() + ".png")); ImageView img = new ImageView(loadImage("/GUIImages/Fronts/card-" + card.getIdIMG() + ".png"));
img.setPreserveRatio(true); img.setPreserveRatio(true);
img.fitHeightProperty().bind(parent.heightProperty().multiply(0.90)); img.fitHeightProperty().bind(parent.getScene().heightProperty().subtract(40).divide(4).multiply(0.90));
addClip(img); addClip(img);
StackPane wrapper = new StackPane(img); StackPane wrapper = new StackPane(img);
if (withShadow) addShadow(wrapper); if (withShadow) addShadow(wrapper);
@@ -458,7 +459,7 @@ public class MainFXMLController {
default -> "/GUIImages/Backs/back-001.png"; default -> "/GUIImages/Backs/back-001.png";
}; };
ImageView back = new ImageView(loadImage(path)); ImageView back = new ImageView(loadImage(path));
back.fitHeightProperty().bind(board.heightProperty().multiply(0.94)); back.fitHeightProperty().bind(board.sceneProperty().get().heightProperty().divide(4).multiply(0.94));
back.setPreserveRatio(true); back.setPreserveRatio(true);
addClip(back); addClip(back);
addShadow(back); addShadow(back);
+67 -67
View File
@@ -13,78 +13,78 @@
fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController" fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController"
stylesheets="@styles.css"> stylesheets="@styles.css">
<children> <children>
<!-- VBox sinistra: si espande per riempire tutto lo spazio disponibile --> <!-- VBox sinistra: si espande per riempire tutto lo spazio disponibile -->
<VBox alignment="CENTER" <VBox alignment="CENTER"
fillWidth="false" fillWidth="false"
maxHeight="Infinity" maxHeight="Infinity"
maxWidth="Infinity" maxWidth="Infinity"
HBox.hgrow="ALWAYS"> HBox.hgrow="ALWAYS">
<HBox.margin> <HBox.margin>
<Insets top="5" right="5" bottom="5" left="5" /> <Insets top="5" right="5" bottom="5" left="5" />
</HBox.margin> </HBox.margin>
<children> <children>
<HBox fx:id="upperList" styleClass="card-list" VBox.vgrow="ALWAYS"> <HBox fx:id="upperList" styleClass="card-list" VBox.vgrow="ALWAYS">
<VBox.margin> <VBox.margin>
<Insets top="5" right="5" bottom="5" left="5" /> <Insets top="5" right="5" bottom="5" left="5" />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
<HBox fx:id="board" prefHeight="280" minHeight="280" maxHeight="280" styleClass="card-list" VBox.vgrow="NEVER"> <HBox fx:id="board" styleClass="card-list" VBox.vgrow="NEVER">
<VBox.margin> <VBox.margin>
<Insets top="5" right="5" bottom="5" left="5" /> <Insets top="5" right="5" bottom="5" left="5" />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
<HBox fx:id="lowerList" styleClass="card-list" VBox.vgrow="ALWAYS"> <HBox fx:id="lowerList" styleClass="card-list" VBox.vgrow="ALWAYS">
<VBox.margin> <VBox.margin>
<Insets top="5" right="5" bottom="5" left="5" /> <Insets top="5" right="5" bottom="5" left="5" />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
<HBox fx:id="myHand" styleClass="card-list" VBox.vgrow="ALWAYS"> <HBox fx:id="myHand" styleClass="card-list" VBox.vgrow="ALWAYS">
<VBox.margin> <VBox.margin>
<Insets top="5" right="5" bottom="5" left="5" /> <Insets top="5" right="5" bottom="5" left="5" />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
</children> </children>
</VBox> </VBox>
<!-- VBox destra: dimensione fissa, non si espande --> <!-- VBox destra: dimensione fissa, non si espande -->
<VBox fx:id="sidePanel" <VBox fx:id="sidePanel"
prefWidth="250.0" prefWidth="250.0"
maxWidth="250.0" maxWidth="250.0"
minWidth="250.0" minWidth="250.0"
HBox.hgrow="NEVER" HBox.hgrow="NEVER"
styleClass="side-panel"> styleClass="side-panel">
<HBox.margin> <HBox.margin>
<Insets bottom="10" left="10" right="10" top="10" /> <Insets bottom="10" left="10" right="10" top="10" />
</HBox.margin> </HBox.margin>
<children> <children>
<HBox fx:id="info" prefHeight="80.0" prefWidth="483.0" styleClass="frame" alignment="CENTER"> <HBox fx:id="info" prefHeight="80.0" prefWidth="483.0" styleClass="frame" alignment="CENTER">
<Label fx:id="infoText" styleClass="label-medium" text="VALORE" /> <Label fx:id="infoText" styleClass="label-medium" text="VALORE" />
</HBox> </HBox>
<ScrollPane fx:id="playerSide" fitToWidth="true" <ScrollPane fx:id="playerSide" fitToWidth="true"
style="-fx-background: transparent; -fx-background-color: transparent;" hbarPolicy="NEVER" style="-fx-background: transparent; -fx-background-color: transparent;" hbarPolicy="NEVER"
vbarPolicy="AS_NEEDED" VBox.vgrow="ALWAYS"> vbarPolicy="AS_NEEDED" VBox.vgrow="ALWAYS">
<VBox.margin> <VBox.margin>
<Insets top="5"/> <Insets top="5"/>
</VBox.margin> </VBox.margin>
</ScrollPane> </ScrollPane>
<Pane HBox.hgrow="ALWAYS"/> <Pane HBox.hgrow="ALWAYS"/>
<HBox alignment="CENTER" fx:id="buttonRow" > <HBox alignment="CENTER" fx:id="buttonRow" >
<HBox spacing="10"> <HBox spacing="10">
<Button fx:id="skipBtn" styleClass="action-button" text="Skip Turn"/> <Button fx:id="skipBtn" styleClass="action-button" text="Skip Turn"/>
<Button fx:id="detailsBtn" styleClass="action-button" text="Ending Details"/> <Button fx:id="detailsBtn" styleClass="action-button" text="Ending Details"/>
</HBox> </HBox>
<VBox.margin> <VBox.margin>
<Insets top="5" right="5" bottom="5" left="5"/> <Insets top="5" right="5" bottom="5" left="5"/>
</VBox.margin> </VBox.margin>
</HBox> </HBox>
</children> </children>
</VBox> </VBox>
</children> </children>
</HBox> </HBox>