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

<?import com.marvinelsen.willow.config.*?>
<?import com.marvinelsen.willow.ui.converters.*?>
<?import javafx.collections.FXCollections?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<DialogPane styleClass="preferences-dialog" xmlns="http://javafx.com/javafx/23" xmlns:fx="http://javafx.com/fxml/1"
            stylesheets="/css/preferences.css"
            fx:controller="com.marvinelsen.willow.ui.controllers.dialogs.PreferencesDialogController">
    <fx:define>
        <FXCollections fx:factory="observableArrayList" fx:id="phoneticAlphabets">
            <Pronunciation fx:value="PINYIN_WITH_TONE_MARKS"/>
            <Pronunciation fx:value="PINYIN_WITH_TONE_NUMBERS"/>
            <Pronunciation fx:value="ZHUYIN"/>
        </FXCollections>
        <FXCollections fx:factory="observableArrayList" fx:id="themes">
            <Theme fx:value="SYSTEM"/>
            <Theme fx:value="LIGHT"/>
            <Theme fx:value="DARK"/>
        </FXCollections>
        <FXCollections fx:factory="observableArrayList" fx:id="scripts">
            <Script fx:value="SIMPLIFIED"/>
            <Script fx:value="TRADITIONAL"/>
        </FXCollections>
    </fx:define>
    <content>
        <TabPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
                 tabClosingPolicy="UNAVAILABLE">
            <Tab closable="false" text="General">
                <GridPane alignment="TOP_CENTER" hgap="8.0" vgap="8.0">
                    <columnConstraints>
                        <ColumnConstraints halignment="RIGHT" hgrow="ALWAYS"/>
                        <ColumnConstraints halignment="LEFT" hgrow="ALWAYS"/>
                    </columnConstraints>
                    <rowConstraints>
                        <RowConstraints minHeight="10.0" prefHeight="30.0" valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints minHeight="10.0" prefHeight="30.0" valignment="BASELINE" vgrow="NEVER"/>
                    </rowConstraints>
                    <padding>
                        <Insets bottom="12.0" left="12.0" right="12.0" top="12.0"/>
                    </padding>
                    <Label text="Script:" GridPane.rowIndex="3"/>
                    <ComboBox fx:id="comboBoxScript" items="$scripts" GridPane.columnIndex="1" GridPane.rowIndex="3">
                        <value>
                            <Script fx:value="SIMPLIFIED"/>
                        </value>
                        <converter>
                            <ScriptStringConverter/>
                        </converter>
                    </ComboBox>
                    <Separator prefWidth="200.0" GridPane.columnSpan="2147483647" GridPane.rowIndex="2"/>
                    <Label text="Language:" GridPane.rowIndex="0"/>
                    <ComboBox fx:id="comboBoxLocale" GridPane.rowIndex="0" GridPane.columnIndex="1">
                        <converter>
                            <LocaleStringConverter/>
                        </converter>
                    </ComboBox>
                    <Label text="Theme:" GridPane.rowIndex="1"/>
                    <ComboBox fx:id="comboBoxTheme" items="$themes" GridPane.rowIndex="1" GridPane.columnIndex="1">
                        <value>
                            <Theme fx:value="SYSTEM"/>
                        </value>
                        <converter>
                            <ThemeStringConverter/>
                        </converter>
                    </ComboBox>
                </GridPane>
            </Tab>
            <Tab closable="false" text="Details View">
                <GridPane alignment="TOP_CENTER" hgap="8.0" vgap="8.0">
                    <columnConstraints>
                        <ColumnConstraints halignment="RIGHT" hgrow="ALWAYS"/>
                        <ColumnConstraints halignment="LEFT" hgrow="ALWAYS"/>
                    </columnConstraints>
                    <rowConstraints>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                    </rowConstraints>
                    <padding>
                        <Insets bottom="12.0" left="12.0" right="12.0" top="12.0"/>
                    </padding>
                    <Label text="Pronunciation:"/>
                    <ComboBox fx:id="comboBoxPronunciationDetails" items="$phoneticAlphabets" GridPane.columnIndex="1">
                        <value>
                            <Pronunciation fx:value="PINYIN_WITH_TONE_MARKS"/>
                        </value>
                        <converter>
                            <PronunciationStringConverter/>
                        </converter>
                    </ComboBox>
                    <Label text="Headword font size:" GridPane.rowIndex="2"/>
                    <Label text="Pronunciation font size:" GridPane.rowIndex="3"/>
                    <Spinner fx:id="spinnerPronunciationFontSizeDetails" editable="true" GridPane.columnIndex="1"
                             GridPane.rowIndex="3">
                        <valueFactory>
                            <SpinnerValueFactory.IntegerSpinnerValueFactory amountToStepBy="1" max="300" min="1"/>
                        </valueFactory>
                    </Spinner>
                    <Spinner fx:id="spinnerHeadwordFontSizeDetails" editable="true" GridPane.columnIndex="1"
                             GridPane.rowIndex="2">
                        <valueFactory>
                            <SpinnerValueFactory.IntegerSpinnerValueFactory amountToStepBy="1" max="300" min="1"/>
                        </valueFactory>
                    </Spinner>
                    <Separator prefWidth="200.0" GridPane.columnSpan="2147483647" GridPane.rowIndex="1"/>
                </GridPane>
            </Tab>
            <Tab closable="false" text="Search Results">
                <GridPane alignment="TOP_CENTER" hgap="8.0" vgap="8.0">
                    <columnConstraints>
                        <ColumnConstraints halignment="RIGHT" hgrow="ALWAYS"/>
                        <ColumnConstraints halignment="LEFT" hgrow="ALWAYS"/>
                    </columnConstraints>
                    <rowConstraints>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                        <RowConstraints valignment="BASELINE" vgrow="NEVER"/>
                    </rowConstraints>
                    <padding>
                        <Insets bottom="12.0" left="12.0" right="12.0" top="12.0"/>
                    </padding>
                    <Label text="Pronunciation:"/>
                    <ComboBox fx:id="comboBoxPronunciationSearchResults" items="$phoneticAlphabets"
                              GridPane.columnIndex="1">
                        <value>
                            <Pronunciation fx:value="PINYIN_WITH_TONE_MARKS"/>
                        </value>
                        <converter>
                            <PronunciationStringConverter/>
                        </converter>
                    </ComboBox>
                    <Label text="Headword font size:" GridPane.rowIndex="5"/>
                    <Label text="Pronunciation font size:" GridPane.rowIndex="6"/>
                    <Spinner fx:id="spinnerPronunciationFontSizeSearchResults" editable="true" GridPane.columnIndex="1"
                             GridPane.rowIndex="6">
                        <valueFactory>
                            <SpinnerValueFactory.IntegerSpinnerValueFactory amountToStepBy="1" max="300" min="1"/>
                        </valueFactory>
                    </Spinner>
                    <Spinner fx:id="spinnerHeadwordFontSizeSearchResults" editable="true" GridPane.columnIndex="1"
                             GridPane.rowIndex="5">
                        <valueFactory>
                            <SpinnerValueFactory.IntegerSpinnerValueFactory amountToStepBy="1" max="300" min="1"/>
                        </valueFactory>
                    </Spinner>
                    <Spinner fx:id="spinnerDefinitionFontSizeSearchResults" editable="true" GridPane.columnIndex="1"
                             GridPane.rowIndex="7">
                        <valueFactory>
                            <SpinnerValueFactory.IntegerSpinnerValueFactory amountToStepBy="1" max="300" min="1"/>
                        </valueFactory>
                    </Spinner>
                    <Separator prefWidth="200.0" GridPane.columnSpan="2147483647" GridPane.rowIndex="4"/>
                    <Label text="Definition font size:" GridPane.rowIndex="7"/>
                    <Label text="Display:" GridPane.rowIndex="2"/>
                    <CheckBox fx:id="checkBoxShowPronunciationSearchResults" mnemonicParsing="false" selected="true"
                              text="Show pronunciation" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
                    <CheckBox fx:id="checkBoxShowDefinitionSearchResults" mnemonicParsing="false" selected="true"
                              text="Show definition" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
                    <Separator prefWidth="200.0" GridPane.columnSpan="2147483647" GridPane.rowIndex="1"/>
                </GridPane>
            </Tab>
        </TabPane>
    </content>
    <ButtonType fx:constant="APPLY"/>
    <ButtonType fx:constant="CANCEL"/>
</DialogPane>
