Sfoglia il codice sorgente

adjust remove vault dialog

Armin Schrenk 2 anni fa
parent
commit
677607d210

+ 3 - 2
src/main/java/org/cryptomator/ui/removevault/RemoveVaultModule.java

@@ -4,6 +4,7 @@ import dagger.Binds;
 import dagger.Module;
 import dagger.Provides;
 import dagger.multibindings.IntoMap;
+import org.cryptomator.common.vaults.Vault;
 import org.cryptomator.ui.common.DefaultSceneFactory;
 import org.cryptomator.ui.common.FxController;
 import org.cryptomator.ui.common.FxControllerKey;
@@ -33,9 +34,9 @@ abstract class RemoveVaultModule {
 	@Provides
 	@RemoveVaultWindow
 	@RemoveVaultScoped
-	static Stage provideStage(StageFactory factory, @PrimaryStage Stage primaryStage, ResourceBundle resourceBundle) {
+	static Stage provideStage(StageFactory factory, @PrimaryStage Stage primaryStage, @RemoveVaultWindow Vault v) {
 		Stage stage = factory.create();
-		stage.setTitle(resourceBundle.getString("removeVault.title"));
+		stage.setTitle(v.getDisplayName());
 		stage.setResizable(false);
 		stage.initModality(Modality.WINDOW_MODAL);
 		stage.initOwner(primaryStage);

+ 21 - 8
src/main/resources/fxml/remove_vault.fxml

@@ -9,26 +9,39 @@
 <?import javafx.scene.layout.StackPane?>
 <?import javafx.scene.layout.VBox?>
 <?import javafx.scene.shape.Circle?>
-<VBox xmlns:fx="http://javafx.com/fxml"
+<?import javafx.scene.Group?>
+<?import javafx.scene.layout.Region?>
+<HBox xmlns:fx="http://javafx.com/fxml"
 	  xmlns="http://javafx.com/javafx"
 	  fx:controller="org.cryptomator.ui.removevault.RemoveVaultController"
 	  minWidth="400"
 	  maxWidth="400"
 	  minHeight="145"
-	  spacing="12">
+	  spacing="12"
+	  alignment="TOP_LEFT">
 	<padding>
 		<Insets topRightBottomLeft="12"/>
 	</padding>
 	<children>
-		<HBox spacing="12" alignment="CENTER_LEFT" VBox.vgrow="ALWAYS">
-			<StackPane alignment="CENTER" HBox.hgrow="NEVER">
+		<Group>
+			<StackPane>
+				<padding>
+					<Insets topRightBottomLeft="6"/>
+				</padding>
 				<Circle styleClass="glyph-icon-primary" radius="24"/>
 				<FontAwesome5IconView styleClass="glyph-icon-white" glyph="QUESTION" glyphSize="24"/>
 			</StackPane>
-			<Label text="%removeVault.information" wrapText="true" textAlignment="LEFT" HBox.hgrow="ALWAYS"/>
-		</HBox>
+		</Group>
+		<VBox HBox.hgrow="ALWAYS">
+			<!-- TODO: migrate translations -->
+			<Label styleClass="label-large" text="%removeVault.title" wrapText="true" textAlignment="LEFT">
+				<padding>
+					<Insets bottom="6" top="6"/>
+				</padding>
+			</Label>
+			<Label text="%removeVault.description" wrapText="true" textAlignment="LEFT" HBox.hgrow="ALWAYS"/>
 
-		<VBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">
+			<Region VBox.vgrow="ALWAYS" minHeight="18"/>
 			<ButtonBar buttonMinWidth="120" buttonOrder="+CI">
 				<buttons>
 					<Button text="%generic.button.cancel" ButtonBar.buttonData="CANCEL_CLOSE" defaultButton="true" cancelButton="true" onAction="#close"/>
@@ -37,4 +50,4 @@
 			</ButtonBar>
 		</VBox>
 	</children>
-</VBox>
+</HBox>

+ 2 - 2
src/main/resources/i18n/strings.properties

@@ -85,8 +85,8 @@ addvaultwizard.success.nextStepsInstructions=Added vault "%s".\nYou need to unlo
 addvaultwizard.success.unlockNow=Unlock Now
 
 # Remove Vault
-removeVault.title=Remove Vault
-removeVault.information=This will only make Cryptomator forget about this vault. You can add it again later. No encrypted files will be deleted from your hard drive.
+removeVault.title=Remove Vault?
+removeVault.description=This will only make Cryptomator forget about this vault. You can add it again. No encrypted files will be deleted from your hard drive.
 removeVault.confirmBtn=Remove Vault
 
 # Change Password