<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:vm="using:VeloeMinecraftLauncher.ViewModels"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:titlebars="using:VeloeMinecraftLauncher.Views.TitleBar"
        mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="450"
		Width="600" Height="450"
		MaxWidth="600" MaxHeight="450"
        x:Class="VeloeMinecraftLauncher.Views.SettingsWindow"
        Icon="/Assets/avalonia-logo.ico"
        Title="Settings"
		TransparencyLevelHint="AcrylicBlur"
		Background="Transparent"
		CanResize="False"
		ExtendClientAreaToDecorationsHint="True"
		ExtendClientAreaChromeHints="NoChrome"
		ExtendClientAreaTitleBarHeightHint="-1">

	<Window.Styles>
		<Style Selector="TabItem">
			<Setter Property="FontSize" Value="16"/>
		</Style>
	</Window.Styles>
	<Design.DataContext>
		<vm:SettingsWindowViewModel/>
	</Design.DataContext>
	<Panel>
		<ExperimentalAcrylicBorder IsHitTestVisible="False">
			<ExperimentalAcrylicBorder.Material>
				<ExperimentalAcrylicMaterial
					BackgroundSource="Digger"
					TintColor="{Binding InterfaceColor}"
					TintOpacity="1"
					MaterialOpacity="{Binding MaterialOpacity}" />
			</ExperimentalAcrylicBorder.Material>
		</ExperimentalAcrylicBorder>
		<DockPanel>
			<titlebars:TitleBarWindow
			  IsSeamless="False"
			  IsIconVisible="False"
			  IsMaximizeVisible="False"
			  TitleText="Settings"
			  DockPanel.Dock="Top">
			</titlebars:TitleBarWindow>
			<TabControl
				HorizontalAlignment="Stretch" DockPanel.Dock="Top">
				<TabItem
					Header="Game"
					VerticalContentAlignment="Center">
					<Grid Margin="10 0 10 5" ShowGridLines="false" RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto">
						
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="250"></ColumnDefinition>
							<ColumnDefinition Width="*"></ColumnDefinition>
							<ColumnDefinition Width="70"></ColumnDefinition>
						</Grid.ColumnDefinitions>

						<CheckBox Grid.Row="1" Grid.Column="0" IsChecked="true" IsEnabled="False">Set path to minecraft folder</CheckBox>
						<TextBox Grid.Row="1" Grid.Column="1" Margin="5" Text="{Binding MinecraftFolderPath}" IsEnabled="{Binding SetMinecraftFolder}"></TextBox>
						<Button Grid.Row="1" Grid.Column="2" Content="Open" Command="{Binding OpenMinecraftPathDialog}" CommandParameter="{Binding $parent[Window]}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"></Button>

						<CheckBox Grid.Row="2" Grid.Column="0" IsChecked="{Binding UseCustomJava}">Use custom java</CheckBox>
						<TextBox Grid.Row="2" Grid.Column="1" Margin="5" Text="{Binding JavaPath}" IsEnabled="{Binding UseCustomJava}"></TextBox>
						<Button Grid.Row="2" Grid.Column="2" Content="Open" Command="{Binding OpenJavaPathDialog}" CommandParameter="{Binding $parent[Window]}" IsEnabled="{Binding UseCustomJava}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"></Button>

						<CheckBox Grid.Row="3" Grid.Column="0" IsChecked="{Binding SetMaxRam}">Set max RAM</CheckBox>
						<TextBox Grid.Row="3" Grid.Column="1" Margin="5" Name="MaxRam" Text="{Binding MaxRam}" IsEnabled="{Binding SetMaxRam}" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBox>

						<CheckBox Grid.Row="4" Grid.ColumnSpan="2" IsChecked="{Binding CheckAssets}" IsEnabled="True">Check vanilla game files before start</CheckBox>
					</Grid>
				</TabItem>
				<TabItem
					Header="Log"
					VerticalContentAlignment="Center">
					<Grid Margin="10 0 10 5" ShowGridLines="false" RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto">
						
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="250"></ColumnDefinition>
							<ColumnDefinition Width="*"></ColumnDefinition>
							<ColumnDefinition Width="70"></ColumnDefinition>
						</Grid.ColumnDefinitions>
						
						<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">Console log event level</TextBlock>
						<ComboBox Grid.Row="1" Grid.Column="1" Margin="5" ItemsSource="{Binding LogEventLevels}" PlaceholderText="Select level" SelectedItem="{Binding ConsoleLogEventLevel}" HorizontalAlignment="Stretch"></ComboBox>
						
						<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">File log event level</TextBlock>
						<ComboBox Grid.Row="2" Grid.Column="1" Margin="5" ItemsSource="{Binding LogEventLevels}" PlaceholderText="Select level" SelectedItem="{Binding FileLogEventLevel}" HorizontalAlignment="Stretch"></ComboBox>
						
						<CheckBox Grid.Row="3" Grid.Column="0" IsChecked="{Binding SetMaxLog}">Set max log size</CheckBox>
						<TextBox Grid.Row="3" Grid.Column="1" Margin="5" Name="MaxLog" Text="{Binding MaxLog}" IsEnabled="{Binding SetMaxLog}" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBox>

						<CheckBox Grid.Row="4" Grid.ColumnSpan="2" IsChecked="{Binding GameLogToLauncher}">Show game log in launcher (performace issues)</CheckBox>
						<Button Grid.Row="5" Grid.ColumnSpan="2" Content="Open log" Command="{Binding OpenLogFile}"></Button>
					</Grid>
				</TabItem>
				
			</TabControl>
			<Button Command="{Binding SaveSettings}" IsEnabled="{Binding IsValid}" Content="Save" VerticalAlignment="Bottom" Margin="10 0 0 10"></Button>
			<TextBlock Text="{Binding LauncherVersion}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 10 10"></TextBlock>			
		</DockPanel>
	</Panel>
</Window>
