Browse Source

Changed design for quit screen as template for other dialogs

Armin Schrenk 2 năm trước cách đây
mục cha
commit
c7ad587aa2

+ 3 - 2
src/main/java/org/cryptomator/ui/quit/QuitModule.java

@@ -5,10 +5,10 @@ import dagger.Module;
 import dagger.Provides;
 import dagger.multibindings.IntoMap;
 import org.cryptomator.ui.common.DefaultSceneFactory;
-import org.cryptomator.ui.common.FxmlLoaderFactory;
 import org.cryptomator.ui.common.FxController;
 import org.cryptomator.ui.common.FxControllerKey;
 import org.cryptomator.ui.common.FxmlFile;
+import org.cryptomator.ui.common.FxmlLoaderFactory;
 import org.cryptomator.ui.common.FxmlScene;
 import org.cryptomator.ui.common.StageFactory;
 
@@ -32,8 +32,9 @@ abstract class QuitModule {
 	@Provides
 	@QuitWindow
 	@QuitScoped
-	static Stage provideStage(StageFactory factory) {
+	static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle) {
 		Stage stage = factory.create();
+		stage.setTitle(resourceBundle.getString("quit.windowTitle"));
 		stage.setMinWidth(300);
 		stage.setMinHeight(100);
 		stage.initModality(Modality.APPLICATION_MODAL);

+ 5 - 0
src/main/resources/css/dark_theme.css

@@ -103,6 +103,11 @@
 	-fx-font-size: 1.5em;
 }
 
+.label-large {
+	-fx-font-family: 'Open Sans SemiBold';
+	-fx-font-size: 1.2em;
+}
+
 .label-small {
 	-fx-font-size: 0.8em;
 }

+ 5 - 0
src/main/resources/css/light_theme.css

@@ -103,6 +103,11 @@
 	-fx-font-size: 1.5em;
 }
 
+.label-large {
+	-fx-font-family: 'Open Sans SemiBold';
+	-fx-font-size: 1.2em;
+}
+
 .label-small {
 	-fx-font-size: 0.8em;
 }

+ 24 - 9
src/main/resources/fxml/quit.fxml

@@ -6,30 +6,45 @@
 <?import javafx.scene.control.Button?>
 <?import javafx.scene.control.ButtonBar?>
 <?import javafx.scene.control.Label?>
+<?import javafx.scene.Group?>
 <?import javafx.scene.layout.HBox?>
+<?import javafx.scene.layout.Region?>
 <?import javafx.scene.layout.StackPane?>
 <?import javafx.scene.layout.VBox?>
 <?import javafx.scene.shape.Circle?>
-<VBox xmlns:fx="http://javafx.com/fxml"
+<HBox xmlns:fx="http://javafx.com/fxml"
 	  xmlns="http://javafx.com/javafx"
 	  fx:controller="org.cryptomator.ui.quit.QuitController"
 	  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"/>
+				<FontAwesome5IconView styleClass="glyph-icon-white" glyph="EXCLAMATION" glyphSize="24"/>
 			</StackPane>
-			<Label text="%quit.prompt" wrapText="true" textAlignment="LEFT" HBox.hgrow="ALWAYS"/>
-		</HBox>
+		</Group>
+
+		<VBox HBox.hgrow="ALWAYS">
+			<Label styleClass="label-large" text="%quit.title" wrapText="true" textAlignment="LEFT">
+				<padding>
+					<Insets bottom="6" top="6"/>
+				</padding>
+			</Label>
+
+			<Label text="%quit.prompt" wrapText="true" textAlignment="LEFT"/>
+
+			<Region VBox.vgrow="ALWAYS"/>
 
-		<VBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">
 			<ButtonBar buttonMinWidth="120" buttonOrder="+CI">
 				<buttons>
 					<Button text="%generic.button.cancel" ButtonBar.buttonData="CANCEL_CLOSE" defaultButton="true" cancelButton="true" onAction="#cancel"/>
@@ -42,4 +57,4 @@
 			</ButtonBar>
 		</VBox>
 	</children>
-</VBox>
+</HBox>

+ 3 - 1
src/main/resources/i18n/strings.properties

@@ -380,5 +380,7 @@ passwordStrength.messageLabel.3=Strong
 passwordStrength.messageLabel.4=Very strong
 
 # Quit
-quit.prompt=Quit application? There are unlocked vaults.
+quit.windowTitle=Quit Application
+quit.title=There are unlocked vaults
+quit.prompt=Please confirm that you want to quit. Cryptomator will gracefully lock all unlocked vaults to prevent data loss.
 quit.lockAndQuit=Lock and Quit