Skip to content

Commit

Permalink
Merge pull request #138 from Team-40-IDATT2003/126-min-vindu-størelse
Browse files Browse the repository at this point in the history
Now u can't shrink the view smaller then content
  • Loading branch information
tommyah authored May 26, 2026
2 parents 51c286c + b98c3bb commit 51a188b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public void start(final Stage stage) throws Exception {
stage.setScene(scene);
stage.setWidth(ConfigValues.VIEWPORT_WIDTH.getValue());
stage.setHeight(ConfigValues.VIEWPORT_HEIGHT.getValue());
stage.setMinWidth(ConfigValues.MIN_VIEWPORT_WIDTH.getValue());
stage.setMinHeight(ConfigValues.MIN_VIEWPORT_HEIGHT.getValue());

ThemeManager.getInstance().registerScene(scene);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,38 @@

/**
* Enum containing configuration values for the application.
* */
*/
public enum ConfigValues {
/**
* Standard viewport width.
* */
VIEWPORT_WIDTH(600),
*/
VIEWPORT_WIDTH(800),

/**
* Standard viewport height.
* */
VIEWPORT_HEIGHT(600);
*/
VIEWPORT_HEIGHT(700),

/**
* Minimum viewport width. The window cannot be resized smaller than this.
*/
MIN_VIEWPORT_WIDTH(800),

/**
* Minimum viewport height. The window cannot be resized smaller than this.
*/
MIN_VIEWPORT_HEIGHT(700);

/**
* Integer parameter of a config value.
* */
*/
private final int value;

/**
* Constructor.
*
* @param value the value to assign this configuration.
* */
*/
ConfigValues(final int value) {
this.value = value;
}
Expand All @@ -32,7 +42,7 @@ public enum ConfigValues {
* Getter method for value.
*
* @return value of the configuration.
* */
*/
public int getValue() {
return value;
}
Expand Down

0 comments on commit 51a188b

Please sign in to comment.