Skip to content

Commit

Permalink
Feat: Maximize/minimize control support(goxr3plus#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawn9988 committed Nov 17, 2023
1 parent 97bdc69 commit 0205c7e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class BorderlessController {

/** The maximized. */
private SimpleBooleanProperty maximized;
/** The maximizable and minimizable */
private SimpleBooleanProperty maximizable;

/** The resizable **/
private SimpleBooleanProperty resizable;
Expand Down Expand Up @@ -93,6 +95,7 @@ public BorderlessController() {
prevSize = new Delta();
prevPos = new Delta();
maximized = new SimpleBooleanProperty(false);
maximizable = new SimpleBooleanProperty(true);
resizable = new SimpleBooleanProperty(true);
snap = new SimpleBooleanProperty(true);
snapped = false;
Expand Down Expand Up @@ -175,6 +178,9 @@ protected void setStage(Stage primaryStage) {
* Maximize on/off the application.
*/
protected void maximize() {
if (!maximizable.get()) {
return;
}
Rectangle2D screen;

try {
Expand Down Expand Up @@ -626,6 +632,15 @@ protected void setResizable(boolean bool) {
resizable.set(bool);
}

/**
* Diable/enable the maximizable of you stage. Enabled by default.
*
* @param bool false to disable, true to enable
*/
protected void setMaximizable(boolean bool) {
maximizable.set(bool);
}

/**
* Disable/enable the Aero Snap property of your stage. Enabled by default.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ public void setResizable(boolean bool) {
controller.setResizable(bool);
}

/**
* Diable/enable the maximizable of you stage. Enabled by default.
*
* @param bool false to disable, true to enable
*/
public void setMaximizable(boolean bool) {
controller.setMaximizable(bool);
}

/**
* Disable/enable the Aero Snap of your stage. Enabled by default.
*
Expand Down

0 comments on commit 0205c7e

Please sign in to comment.