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

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import org.controlsfx.control.StatusBar?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.shape.Rectangle?>
<?import com.sparrowwallet.sparrow.control.UnlabeledToggleSwitch?>
<?import com.sparrowwallet.drongo.BitcoinUnit?>
<?import com.sparrowwallet.sparrow.Theme?>

<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="200" minWidth="350" prefHeight="770.0" prefWidth="1020.0" fx:controller="com.sparrowwallet.sparrow.AppController" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1">
    <children>
        <MenuBar useSystemMenuBar="true">
            <menus>
                <Menu fx:id="fileMenu" mnemonicParsing="false" text="File">
                    <items>
                        <MenuItem mnemonicParsing="false" text="New Wallet" accelerator="Shortcut+N" onAction="#newWallet"/>
                        <MenuItem mnemonicParsing="false" text="Open Wallet..." accelerator="Shortcut+O" onAction="#openWallet"/>
                        <Menu mnemonicParsing="false" text="Open Transaction">
                            <items>
                                <MenuItem text="File..." onAction="#openTransactionFromFile" accelerator="Shortcut+F"/>
                                <MenuItem fx:id="openTransactionIdItem" text="From ID..." onAction="#openTransactionFromId" accelerator="Shortcut+I"/>
                                <MenuItem text="From Text..." onAction="#openTransactionFromText" accelerator="Shortcut+T"/>
                                <MenuItem text="From QR..." onAction="#openTransactionFromQR" accelerator="Shortcut+U"/>
                                <!-- <MenuItem text="Examples" onAction="#openExamples"/> -->
                            </items>
                        </Menu>
                        <MenuItem fx:id="saveTransaction" mnemonicParsing="false" text="Save Transaction..." accelerator="Shortcut+S" onAction="#saveTransaction"/>
                        <Menu fx:id="savePSBT" mnemonicParsing="false" text="Save PSBT">
                            <MenuItem text="As Binary..." onAction="#savePSBTBinary" accelerator="Shortcut+S"/>
                            <MenuItem text="As Base64..." onAction="#savePSBTText"/>
                        </Menu>
                        <SeparatorMenuItem />
                        <MenuItem mnemonicParsing="false" text="Import Wallet..." onAction="#importWallet"/>
                        <MenuItem fx:id="exportWallet" mnemonicParsing="false" text="Export Wallet..." onAction="#exportWallet"/>
                        <SeparatorMenuItem styleClass="osxHide" />
                        <MenuItem styleClass="osxHide" mnemonicParsing="false" text="Preferences..." accelerator="Shortcut+P" onAction="#openPreferences"/>
                        <SeparatorMenuItem />
                        <MenuItem mnemonicParsing="false" text="Close Tab" accelerator="Shortcut+W" onAction="#closeTab"/>
                        <MenuItem styleClass="osxHide" mnemonicParsing="false" text="Quit" accelerator="Shortcut+Q" onAction="#quit"/>
                    </items>
                </Menu>
                <fx:define>
                    <ToggleGroup fx:id="bitcoinUnit"/>
                </fx:define>
                <fx:define>
                    <ToggleGroup fx:id="theme"/>
                </fx:define>
                <Menu fx:id="viewMenu" mnemonicParsing="false" text="View">
                    <items>
                        <Menu mnemonicParsing="false" text="Bitcoin Unit">
                            <items>
                                <RadioMenuItem mnemonicParsing="false" text="Auto" toggleGroup="$bitcoinUnit" onAction="#setBitcoinUnit">
                                    <userData>
                                        <BitcoinUnit fx:constant="AUTO" />
                                    </userData>
                                </RadioMenuItem>
                                <RadioMenuItem mnemonicParsing="false" text="BTC" toggleGroup="$bitcoinUnit" onAction="#setBitcoinUnit">
                                    <userData>
                                        <BitcoinUnit fx:constant="BTC" />
                                    </userData>
                                </RadioMenuItem>
                                <RadioMenuItem mnemonicParsing="false" text="sats" toggleGroup="$bitcoinUnit" onAction="#setBitcoinUnit">
                                    <userData>
                                        <BitcoinUnit fx:constant="SATOSHIS" />
                                    </userData>
                                </RadioMenuItem>
                            </items>
                        </Menu>
                        <Menu mnemonicParsing="false" text="Theme">
                            <items>
                                <RadioMenuItem mnemonicParsing="false" text="Light" toggleGroup="$theme" onAction="#setTheme">
                                    <userData>
                                        <Theme fx:constant="LIGHT" />
                                    </userData>
                                </RadioMenuItem>
                                <RadioMenuItem mnemonicParsing="false" text="Dark" toggleGroup="$theme" onAction="#setTheme">
                                    <userData>
                                        <Theme fx:constant="DARK" />
                                    </userData>
                                </RadioMenuItem>
                            </items>
                        </Menu>
                        <SeparatorMenuItem />
                        <CheckMenuItem fx:id="openWalletsInNewWindows" mnemonicParsing="false" text="Open Wallets in New Windows" onAction="#openWalletsInNewWindows"/>
                        <CheckMenuItem fx:id="hideEmptyUsedAddresses" mnemonicParsing="false" text="Hide Empty Used Addresses" onAction="#hideEmptyUsedAddresses"/>
                        <CheckMenuItem fx:id="useHdCameraResolution" mnemonicParsing="false" text="Use HD Camera Resolution" onAction="#useHdCameraResolution"/>
                        <CheckMenuItem fx:id="showTxHex" mnemonicParsing="false" text="Show Transaction Hex" onAction="#showTxHex"/>
                        <SeparatorMenuItem />
                        <MenuItem fx:id="minimizeToTray" mnemonicParsing="false" text="Minimize to System Tray" accelerator="Shortcut+Y" onAction="#minimizeToTray"/>
                        <MenuItem fx:id="refreshWallet" mnemonicParsing="false" text="Refresh Wallet" accelerator="Shortcut+R" onAction="#refreshWallet"/>
                    </items>
                </Menu>
                <Menu fx:id="toolsMenu" mnemonicParsing="false" text="Tools">
                    <MenuItem mnemonicParsing="false" text="Sign/Verify Message" accelerator="Shortcut+M" onAction="#signVerifyMessage"/>
                    <MenuItem styleClass="osxHide,windowsHide" mnemonicParsing="false" text="Install Udev Rules" onAction="#installUdevRules"/>
                </Menu>
                <Menu fx:id="helpMenu" mnemonicParsing="false" text="Help">
                    <MenuItem mnemonicParsing="false" text="Show Introduction" onAction="#showIntroduction"/>
                    <MenuItem mnemonicParsing="false" text="Show Online Documentation" onAction="#showDocumentation"/>
                    <MenuItem mnemonicParsing="false" text="Show Log File" onAction="#showLogFile"/>
                    <MenuItem styleClass="osxHide" mnemonicParsing="false" text="About Sparrow" onAction="#showAbout"/>
                </Menu>
            </menus>
        </MenuBar>
        <StackPane fx:id="rootStack" VBox.vgrow="ALWAYS">
            <Rectangle styleClass="background-box" width="400" height="125" />
            <Text styleClass="background-text" text="Drag files here to open" />
            <TabPane fx:id="tabs" />
        </StackPane>

        <StatusBar fx:id="statusBar" text="" minHeight="36">
            <rightItems>
                <UnlabeledToggleSwitch fx:id="serverToggle">
                    <tooltip>
                        <Tooltip text="Disconnected" />
                    </tooltip>
                </UnlabeledToggleSwitch>
            </rightItems>
        </StatusBar>
    </children>
</VBox>
