<?xml version="1.0" encoding="UTF-8"?>
<!--
    This file is part of QTTabBar, a shell extension for Microsoft
    Windows Explorer.
    Copyright (C) 2007-2021  Quizo, Paul Accisano

    QTTabBar is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    QTTabBar is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with QTTabBar.  If not, see <http://www.gnu.org/licenses/>.
-->

<qt:OptionsDialogTab
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:qt="clr-namespace:QTTabBarLib"
    x:Class="QTTabBarLib.Options03_Tweaks"
    x:ClassModifier="internal"
    DataContext="{Binding Path=WorkingConfig.tweaks, RelativeSource={RelativeSource Self}}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="OptionsDialogResources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel
        Margin="14,5,10,0"
        Orientation="Vertical">
        <StackPanel
            Margin="0,0,0,4"
            Orientation="Horizontal">
            <Image
                Source="{Binding Source={x:Static qt:Resources_Image.imgTabTweaks}, Converter={StaticResource BitmapToImageSourceConverter}}"
                Style="{StaticResource PageHeaderImageStyle}"/>
            <Label
                Content="{qt:Resx Key=Options_Page03_Tweaks, Index=0}"
                FontSize="13"
                VerticalAlignment="Bottom"/>
        </StackPanel>
        <Label
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=1}"
            Style="{StaticResource SectionHeaderStyle}"/>
        <CheckBox x:Name="chkAlwaysShowHeaders"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=2}"
            IsChecked="{Binding Path=AlwaysShowHeaders}"
            IsEnabled="{x:Static qt:Options03_Tweaks.IsNotXP}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkRedirectLibraryFolders"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=3}"
            IsChecked="{Binding Path=RedirectLibraryFolders}"
            IsEnabled="{x:Static qt:Options03_Tweaks.IsWin7}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkKillExtWhileRenaming"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=4}"
            IsChecked="{Binding Path=KillExtWhileRenaming}"
            IsEnabled="{x:Static qt:Options03_Tweaks.IsXP}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkF2Selection"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=5}"
            IsChecked="{Binding Path=F2Selection}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkWrapArrowKeySelection"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=6}"
            IsChecked="{Binding Path=WrapArrowKeySelection}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkBackspaceUpLevel"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=7}"
            IsChecked="{Binding Path=BackspaceUpLevel}"
            IsEnabled="{x:Static qt:Options03_Tweaks.IsNotXP}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkHorizontalScroll"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=8}"
            IsChecked="{Binding Path=HorizontalScroll}"
            Style="{StaticResource CheckStyle}"/>
        <Label
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=9}"
            Style="{StaticResource SectionHeaderStyle}"/>
        <CheckBox x:Name="chkForceSysListView"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=10}"
            IsChecked="{Binding Path=ForceSysListView}"
            IsEnabled="{x:Static qt:Options03_Tweaks.IsWin7}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkToggleFullRowSelect"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=11}"
            IsChecked="{Binding ToggleFullRowSelect}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkForceSysListView}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkDetailsGridLines"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=12}"
            IsChecked="{Binding Path=DetailsGridLines}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkForceSysListView}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkAlternateRowColors"
            Content="{qt:Resx Key=Options_Page03_Tweaks, Index=13}"
            IsChecked="{Binding Path=AlternateRowColors}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkForceSysListView}"
            Style="{StaticResource CheckStyle}"/>
        <Grid Margin="31,2,5,2">
            <Grid.IsEnabled>
                <MultiBinding Converter="{StaticResource LogicalAndMultiConverter}">
                    <Binding Path="IsChecked" ElementName="chkAlternateRowColors"/>
                    <Binding Path="IsEnabled" ElementName="chkAlternateRowColors"/>
                </MultiBinding>
            </Grid.IsEnabled>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label
                Content="{qt:Resx Key=Options_Page03_Tweaks, Index=14}"
                Grid.Column="0"
                Grid.Row="0"/>
            <Label
                Content="{qt:Resx Key=Options_Page03_Tweaks, Index=15}"
                Grid.Column="0"
                Grid.Row="1"/>
            <Button x:Name="btnAltRowForeground"
                Background="{Binding Path=Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource ColorToBrushConverter}}"
                Click="btnAltRowColor_Click"
                Grid.Column="1"
                Grid.Row="0"
                Height="22"
                Tag="{Binding Path=AltRowForegroundColor, Mode=TwoWay}"
                Width="22"/>
            <Button x:Name="btnAltRowBackground"
                Background="{Binding Path=Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource ColorToBrushConverter}}"
                Click="btnAltRowColor_Click"
                Grid.Column="1"
                Grid.Row="1"
                Height="22"
                Tag="{Binding Path=AltRowBackgroundColor, Mode=TwoWay}"
                Width="22" />
        </Grid>
    </StackPanel>
</qt:OptionsDialogTab>
