Skip to content

Commit

Permalink
- Turn settings window into a proper modal.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trenair committed Jun 26, 2024
1 parent 1e9b127 commit 03974d1
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 03974d1

Please sign in to comment.