<?xml version="1.0" encoding="UTF-8"?>

<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.layout.HBox?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.shape.Arc?>
<?import javafx.scene.control.Button?>
<StackPane xmlns:fx="http://javafx.com/fxml"
		   xmlns="http://javafx.com/javafx"
		   fx:id="root"
		   fx:controller="org.cryptomator.ui.mainwindow.VaultListController"
		   minWidth="206">
	<VBox>
		<StackPane VBox.vgrow="ALWAYS">
			<VBox>
				<ListView fx:id="vaultList" editable="true" fixedCellSize="${controller.cellSize}">
					<contextMenu>
						<fx:include source="vault_list_contextmenu.fxml"/>
					</contextMenu>
				</ListView>
				<Region VBox.vgrow="ALWAYS" styleClass="list-view"/>
			</VBox>
			<VBox visible="${controller.emptyVaultList}" spacing="6" alignment="CENTER">
				<Region VBox.vgrow="ALWAYS"/>
				<Label VBox.vgrow="NEVER" text="%main.vaultlist.emptyList.onboardingInstruction" textAlignment="CENTER" wrapText="true"/>
				<HBox>
					<Arc styleClass="onboarding-overlay-arc" translateX="20" radiusY="100" radiusX="50" length="-60"/>
				</HBox>
			</VBox>
		</StackPane>
		<HBox styleClass="button-bar">
			<Button fx:id="addVaultButton" onMouseClicked="#toggleMenu" styleClass="button-left" alignment="CENTER" minWidth="20" contentDisplay="GRAPHIC_ONLY">
				<graphic>
					<FontAwesome5IconView glyph="PLUS" glyphSize="16"/>
				</graphic>
			</Button>
			<Region HBox.hgrow="ALWAYS"/>
			<Button onMouseClicked="#showPreferences" styleClass="button-right" alignment="CENTER" minWidth="20" contentDisplay="GRAPHIC_ONLY">
				<graphic>
					<FontAwesome5IconView glyph="COG" glyphSize="16"/>
				</graphic>
			</Button>
		</HBox>
	</VBox>
	<Region styleClass="drag-n-drop-border" visible="${controller.draggingVaultOver}"/>
	<fx:define>
		<ContextMenu fx:id="addVaultContextMenu">
			<items>
				<MenuItem styleClass="add-vault-menu-item" text="%main.vaultlist.addVaultBtn.menuItemNew" onAction="#didClickAddNewVault" >
					<graphic>
						<FontAwesome5IconView glyph="PLUS" textAlignment="CENTER" wrappingWidth="14" />
					</graphic>
				</MenuItem>
				<MenuItem styleClass="add-vault-menu-item" text="%main.vaultlist.addVaultBtn.menuItemExisting" onAction="#didClickAddExistingVault" >
					<graphic>
						<FontAwesome5IconView glyph="FOLDER_OPEN" textAlignment="CENTER" wrappingWidth="14" />
					</graphic>
				</MenuItem>
			</items>
		</ContextMenu>
	</fx:define>
</StackPane>
