stage cleanup

This commit is contained in:
Sebastian Stenzel
2019-09-19 11:00:24 +02:00
parent 24f13e2afe
commit 4d916cd5cc
4 changed files with 5 additions and 6 deletions

View File

@@ -52,7 +52,6 @@ public abstract class AddVaultModule {
Stage stage = new Stage();
stage.setTitle(resourceBundle.getString("addvaultwizard.title"));
stage.setResizable(false);
stage.initStyle(StageStyle.DECORATED);
stage.initModality(Modality.WINDOW_MODAL);
stage.initOwner(owner);
stage.sceneProperty().addListener(observable -> {

View File

@@ -42,14 +42,13 @@ abstract class MainWindowModule {
@MainWindow
@MainWindowScoped
static Stage provideStage(@Named("windowIcon") Optional<Image> windowIcon) {
Stage stage = new Stage();
Stage stage = new Stage(StageStyle.UNDECORATED);
// TODO: min/max values chosen arbitrarily. We might wanna take a look at the user's resolution...
stage.setMinWidth(650);
stage.setMinHeight(440);
stage.setMaxWidth(1000);
stage.setMaxHeight(700);
stage.setTitle("Cryptomator");
stage.initStyle(StageStyle.UNDECORATED);
windowIcon.ifPresent(stage.getIcons()::add);
return stage;
}

View File

@@ -16,6 +16,7 @@ import org.cryptomator.ui.common.FxController;
import org.cryptomator.ui.common.FxControllerKey;
import org.cryptomator.ui.common.FxmlFile;
import org.cryptomator.ui.common.FxmlScene;
import org.cryptomator.ui.mainwindow.MainWindow;
import javax.inject.Named;
import javax.inject.Provider;
@@ -36,11 +37,12 @@ abstract class RemoveVaultModule {
@Provides
@RemoveVault
@RemoveVaultScoped
static Stage provideStage(ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon) {
static Stage provideStage(@MainWindow Stage owner, ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon) {
Stage stage = new Stage();
stage.setTitle(resourceBundle.getString("removeVault.title"));
stage.setResizable(false);
stage.initModality(Modality.APPLICATION_MODAL);
stage.initModality(Modality.WINDOW_MODAL);
stage.initOwner(owner);
windowIcon.ifPresent(stage.getIcons()::add);
return stage;
}

View File

@@ -44,7 +44,6 @@ abstract class VaultOptionsModule {
Stage stage = new Stage();
stage.setTitle(vault.getDisplayableName());
stage.setResizable(false);
stage.initStyle(StageStyle.DECORATED);
stage.initModality(Modality.WINDOW_MODAL);
stage.initOwner(owner);
windowIcon.ifPresent(stage.getIcons()::add);