<UserControl
    Height="{CompiledBinding MainWindow.TitlebarHeight.Value,
                             Mode=OneWay}"
    ToolTip.Tip="{Binding PicViewer.TitleTooltip.Value, Mode=OneWay}"
    Width="{CompiledBinding MainWindow.TitleMaxWidth.Value,
                            Mode=OneWay}"
    d:DesignHeight="450"
    d:DesignWidth="800"
    mc:Ignorable="d"
    x:Class="PicView.Avalonia.Views.UC.EditableTitlebar"
    x:DataType="viewModels:MainViewModel"
    xmlns="https://github.com/avaloniaui"
    xmlns:customControls="clr-namespace:PicView.Avalonia.CustomControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="clr-namespace:PicView.Avalonia.ViewModels"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Panel>
        <TextBlock
            FontFamily="avares://PicView.Avalonia/Assets/Fonts/Roboto-Medium.ttf#Roboto"
            FontSize="13"
            FontWeight="Medium"
            Height="{CompiledBinding MainWindow.TitlebarHeight.Value,
                                     Mode=OneWay}"
            IsTabStop="False"
            IsVisible="{CompiledBinding !MainWindow.IsEditableTitlebarOpen.Value}"
            Padding="0,7,0,5"
            Text="{CompiledBinding PicViewer.Title.Value,
                                   Mode=OneWay}"
            TextAlignment="Center"
            TextTrimming="CharacterEllipsis"
            VerticalAlignment="Center"
            x:Name="TextBlock" />
        <Border
            BorderBrush="{DynamicResource AccentColor}"
            BorderThickness="1"
            IsVisible="{CompiledBinding MainWindow.IsEditableTitlebarOpen.Value}">
            <customControls:FuncTextBox
                FontFamily="avares://PicView.Avalonia/Assets/Fonts/Roboto-Medium.ttf#Roboto"
                FontSize="13"
                FontWeight="Medium"
                Height="{CompiledBinding MainWindow.TitlebarHeight.Value,
                                         Mode=OneWay}"
                IsTabStop="False"
                Padding="0,7,0,5"
                SelectionForegroundBrush="{DynamicResource SecondaryTextColor}"
                TextAlignment="Center"
                VerticalAlignment="Center"
                x:Name="TextBox" />
        </Border>
    </Panel>
</UserControl>
