Przeglądaj źródła

add movable divider between vault list and vault detail view

Sebastian Stenzel 6 lat temu
rodzic
commit
01275fce9f

+ 5 - 4
main/ui/src/main/resources/fxml/main_window.fxml

@@ -6,6 +6,7 @@
 <?import javafx.scene.control.Tooltip?>
 <?import javafx.scene.layout.HBox?>
 <?import javafx.scene.layout.VBox?>
+<?import javafx.scene.control.SplitPane?>
 <VBox xmlns="http://javafx.com/javafx"
 	  xmlns:fx="http://javafx.com/fxml"
 	  fx:controller="org.cryptomator.ui.mainwindow.MainWindowController"
@@ -33,8 +34,8 @@
 			</Button>
 		</children>
 	</HBox>
-	<HBox VBox.vgrow="ALWAYS">
-		<fx:include source="/fxml/vault_list.fxml" HBox.hgrow="ALWAYS"/>
-		<fx:include source="/fxml/vault_detail.fxml" HBox.hgrow="NEVER"/>
-	</HBox>
+	<SplitPane VBox.vgrow="ALWAYS" dividerPositions="0.33">
+		<fx:include source="/fxml/vault_list.fxml" SplitPane.resizableWithParent="false"/>
+		<fx:include source="/fxml/vault_detail.fxml" SplitPane.resizableWithParent="true"/>
+	</SplitPane>
 </VBox>

+ 2 - 2
main/ui/src/main/resources/fxml/vault_detail.fxml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<?import javafx.geometry.Insets?>
 <?import javafx.scene.control.Label?>
 <?import javafx.scene.layout.VBox?>
-<?import javafx.geometry.Insets?>
 <VBox xmlns="http://javafx.com/javafx"
 	  xmlns:fx="http://javafx.com/fxml"
 	  fx:controller="org.cryptomator.ui.mainwindow.VaultDetailController"
-	  prefWidth="400.0">
+	  minWidth="300">
 	<padding>
 		<Insets bottom="6.0" left="6.0" right="6.0" top="6.0"/>
 	</padding>

+ 2 - 1
main/ui/src/main/resources/fxml/vault_list.fxml

@@ -13,7 +13,8 @@
 <?import javafx.scene.shape.Arc?>
 <VBox xmlns="http://javafx.com/javafx"
 	  xmlns:fx="http://javafx.com/fxml"
-	  fx:controller="org.cryptomator.ui.mainwindow.VaultListController">
+	  fx:controller="org.cryptomator.ui.mainwindow.VaultListController"
+	  minWidth="200">
 	<StackPane VBox.vgrow="ALWAYS">
 		<ListView fx:id="vaultList" editable="true"/>
 		<AnchorPane fx:id="onboardingOverlay">