<?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.Options04_Tooltips"
    x:ClassModifier="internal"
    DataContext="{Binding Path=WorkingConfig.tips, 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.imgTabTooltips}, Converter={StaticResource BitmapToImageSourceConverter}}"
                Style="{StaticResource PageHeaderImageStyle}"/>
            <Label
                Content="{qt:Resx Key=Options_Page04_Tooltips, Index=0}"
                FontSize="13"
                VerticalAlignment="Bottom"/>
        </StackPanel>
        <Label
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=1}"
            Style="{StaticResource SectionHeaderStyle}"/>
        <CheckBox x:Name="chkShowSubDirTips"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=2}"
            IsChecked="{Binding Path=ShowSubDirTips}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkSubDirTipsWithShift"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=3}"
            IsChecked="{Binding Path=SubDirTipsWithShift}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowSubDirTips}"
            Style="{StaticResource IndentedCheckStyle}"/>
        <CheckBox x:Name="chkSubDirTipsFiles"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=4}"
            IsChecked="{Binding Path=SubDirTipsFiles}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowSubDirTips}"
            Style="{StaticResource IndentedCheckStyle}"/>
        <CheckBox x:Name="chkSubDirTipsPreview"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=5}"
            IsChecked="{Binding Path=SubDirTipsPreview}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowSubDirTips}"
            Style="{StaticResource IndentedCheckStyle}"/>
        <Label
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=6}"
            Style="{StaticResource SectionHeaderStyle}"/>
        <CheckBox x:Name="chkShowTooltipPreviews"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=7}"
            IsChecked="{Binding Path=ShowTooltipPreviews}"
            Style="{StaticResource CheckStyle}"/>
        <CheckBox x:Name="chkShowPreviewsWithShift"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=8}"
            IsChecked="{Binding Path=ShowPreviewsWithShift}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowTooltipPreviews}"
            Style="{StaticResource IndentedCheckStyle}"/>
        <CheckBox x:Name="chkShowPreviewInfo"
            Content="{qt:Resx Key=Options_Page04_Tooltips, Index=9}"
            IsChecked="{Binding Path=ShowPreviewInfo}"
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowTooltipPreviews}"
            Style="{StaticResource IndentedCheckStyle}"/>
        <StackPanel
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowTooltipPreviews}"
            Margin="31,1,0,1"
            Orientation="Horizontal">
            <Label
                Content="{qt:Resx Key=Options_Page04_Tooltips, Index=10}"
                Height="16"
                Padding="0"/>
            <qt:Spinner
                Min="128"
                Max="1920"
                Margin="8,1"
                Value="{Binding Path=PreviewMaxWidth}"/>
            <Label
                Content="x"
                Height="16"
                Margin="0"
                Padding="0"/>
            <qt:Spinner
                Min="96"
                Max="1200"
                Margin="8,1"
                Value="{Binding Path=PreviewMaxHeight}"/>
        </StackPanel>
        <StackPanel
            IsEnabled="{Binding Path=IsChecked, ElementName=chkShowTooltipPreviews}"
            Margin="31,1,0,1"
            Orientation="Horizontal">
            <Label
                Content="{qt:Resx Key=Options_Page04_Tooltips, Index=11}"
                Height="16"
                Padding="0"/>
            <Button
                Click="btnFontChoose_Click"
                Content="{Binding Path=Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource FontStringConverter}}"
                Height="23"
                Margin="8,1"
                Tag="{Binding Path=PreviewFont, Mode=TwoWay}"
                Width="200"/>
        </StackPanel>
        <Grid Margin="13,15,0,1">
            <Grid.Resources>
                <!-- DataTemplate for the file extension listboxes -->
                <DataTemplate x:Key="FileTypeItemTemplate">
                    <StackPanel Orientation="Horizontal">
                        <Image
                            Source="{Binding Path=Icon, Converter={StaticResource BitmapToImageSourceConverter}}"
                            Width="16"
                            Height="16"
                            Stretch="Fill"/>
                        <qt:EditableHeader
                            Text="{Binding Path=Extension}"
                            IsEditing="{Binding Path=IsEditing}"
                            Padding="2,0"
                            Margin="0,2"
                            Container="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"/>
                        <TextBlock
                            Text="{Binding Path=FriendlyName}"
                            VerticalAlignment="Center"
                            Margin="0,2,0,0"
                            FontSize="10">
                            <TextBlock.Style>
                                <Style TargetType="{x:Type TextBlock}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Path=IsSelected}" Value="False">
                                            <Setter Property="Foreground" Value="Gray"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </TextBlock.Style>
                        </TextBlock>
                    </StackPanel>
                </DataTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="80"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Label
                Content="{qt:Resx Key=Options_Page04_Tooltips, Index=12}"
                Height="16"
                Padding="0"
                Margin="2,0"
                FontWeight="Bold"/>
            <Label
                Content="{qt:Resx Key=Options_Page04_Tooltips, Index=13}"
                Height="16"
                Padding="0"
                Margin="2,0"
                FontWeight="Bold"
                Grid.Column="2"/>
            <ListBox x:Name="lstTextFileTypes"
                ItemTemplate="{StaticResource FileTypeItemTemplate}"
                Width="175"
                Height="200"
                Grid.Row="1"
                Grid.RowSpan="3"
                Grid.Column="0"
                Margin="2"
                SelectionMode="Extended"
                KeyDown="lstTextFileTypes_OnKeyDown">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                        <Setter Property="Tag" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}" />
                        <EventSetter Event="Selected" Handler="ListViewItem_Selected" />
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>
            <Button
                x:Name="btnAddTextFileTypes"
                Content="{qt:Resx Key=DialogButtons, Index=7}"
                Grid.Column="1"
                Grid.Row="1"
                Height="23"
                HorizontalAlignment="Left"
                Margin="2"
                VerticalAlignment="Top"
                Width="60"
                Click="btnAddTextFileTypes_Click"/>
            <Button
                x:Name="btnRemoveTextFileTypes"
                Content="{qt:Resx Key=DialogButtons, Index=9}"
                Grid.Column="1"
                Grid.Row="2"
                Height="23"
                HorizontalAlignment="Left"
                Margin="2"
                VerticalAlignment="Top"
                Width="60"
                Click="btnRemoveTextFileTypes_Click"/>
            <Button
                x:Name="btnResetTextFileTypes"
                Content="{qt:Resx Key=DialogButtons, Index=6}"
                Grid.Column="1"
                Grid.Row="3"
                Height="23"
                HorizontalAlignment="Left"
                Margin="2"
                VerticalAlignment="Bottom"
                Width="60"
                Click="btnResetTextFileTypes_Click"/>
            <ListBox x:Name="lstMediaFileTypes"
                ItemTemplate="{StaticResource FileTypeItemTemplate}"
                Width="175"
                Height="200"
                Grid.Row="1"
                Grid.RowSpan="3"
                Grid.Column="2"
                Margin="2"
                SelectionMode="Extended"
                KeyDown="lstMediaFileTypes_OnKeyDown">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                        <Setter Property="Tag" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}" />
                        <EventSetter Event="Selected" Handler="ListViewItem_Selected" />
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>
            <Button
                x:Name="btnAddMediaFileTypes"
                Content="{qt:Resx Key=DialogButtons, Index=7}"
                Grid.Column="3"
                Grid.Row="1"
                Height="23"
                HorizontalAlignment="Left"
                Margin="2"
                VerticalAlignment="Top"
                Width="60"
                Click="btnAddMediaFileTypes_Click"/>
            <Button
                x:Name="btnRemoveMediaFileTypes"
                Content="{qt:Resx Key=DialogButtons, Index=9}"
                Grid.Column="3"
                Grid.Row="2"
                Height="23"
                HorizontalAlignment="Left"
                Margin="2"
                VerticalAlignment="Top"
                Width="60"
                Click="btnRemoveMediaFileTypes_Click"/>
            <Button
                x:Name="btnResetMediaFileTypes"
                Content="{qt:Resx Key=DialogButtons, Index=6}"
                Grid.Column="3"
                Grid.Row="3"
                Height="23"
                HorizontalAlignment="Left"
                Margin="2"
                VerticalAlignment="Bottom"
                Width="60" Click="btnResetMediaFileTypes_Click" />
        </Grid>
    </StackPanel>
</qt:OptionsDialogTab>