<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2014 Sebastian Stenzel
  This file is licensed under the terms of the MIT license.
  See the LICENSE.txt file for more info.
  
  Contributors:
      Sebastian Stenzel - initial API and implementation
-->
<?import java.net.URL?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.control.ToolBar?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.geometry.Insets?>

<HBox fx:id="rootPane" prefHeight="440.0" prefWidth="640.0" fx:controller="org.cryptomator.ui.controllers.MainController" xmlns:fx="http://javafx.com/fxml">

	<padding><Insets top="20" right="20" bottom="20" left="20.0"/></padding>

	<fx:define>
		<fx:include fx:id="welcomeView" source="welcome.fxml" />
		<ContextMenu fx:id="vaultListCellContextMenu">
			<items>
				<MenuItem text="%main.directoryList.contextMenu.remove" onAction="#didClickRemoveSelectedEntry" />
				<MenuItem text="%main.directoryList.contextMenu.changePassword" onAction="#didClickChangePassword" />
			</items>
		</ContextMenu>
		<ContextMenu fx:id="addVaultContextMenu" onShowing="#willShowAddVaultContextMenu" onHidden="#didHideAddVaultContextMenu">
			<items>
				<MenuItem text="%main.addDirectory.contextMenu.new" onAction="#didClickCreateNewVault" />
				<MenuItem text="%main.addDirectory.contextMenu.open" onAction="#didClickAddExistingVaults" />
			</items>
		</ContextMenu>
	</fx:define>

	<children>
		<VBox prefWidth="200.0">
			<children>
				<ListView fx:id="vaultList" VBox.vgrow="ALWAYS" focusTraversable="false" />
				<ToolBar VBox.vgrow="NEVER" styleClass="list-related-toolbar">
					<items>
						<ToggleButton text="+" fx:id="addVaultButton" onAction="#didClickAddVault" focusTraversable="false"/>
					</items>
				</ToolBar>
			</children>
		</VBox>
		<Pane fx:id="contentPane">
			<children>
				<fx:reference source="welcomeView" />
			</children>
		</Pane>
	</children>

</HBox>

