Skip to content

Commit

Permalink
Turn settings window into a proper modal. (#3217)
Browse files Browse the repository at this point in the history
- Turn settings window into a proper modal.

Co-authored-by: SimonB <[email protected]>
  • Loading branch information
DotNetSimon and Trenair committed Jun 26, 2024
1 parent bcaf163 commit 1fc2fbb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.faforever.client.theme.UiService;
import com.faforever.client.ui.StageHolder;
import javafx.scene.control.MenuButton;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -73,12 +74,13 @@ public void onSettingsSelected() {
SettingsController settingsController = uiService.loadFxml("theme/settings/settings.fxml");
FxStage fxStage = FxStage.create(settingsController.getRoot())
.initOwner(menuButton.getScene().getWindow())
.withSceneFactory(themeService::createScene)
.withSceneFactory(themeService::createScene)
.allowMinimize(false)
.apply()
.setTitleBar(settingsController.settingsHeader);

Stage stage = fxStage.getStage();
stage.initModality(Modality.WINDOW_MODAL);

stage.setTitle(i18n.get("settings.windowTitle"));
stage.show();
Expand Down

0 comments on commit 1fc2fbb

Please sign in to comment.