Files
FoxBrowser/MainWindow.xaml
T
2026-10-01 02:41:50 +03:00

175 lines
10 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<Window x:Class="FoxBrowser.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="FoxBrowser" Width="1180" Height="760" MinWidth="760" MinHeight="480"
Background="{StaticResource WindowBg}" Foreground="{StaticResource TextPrimary}"
Closing="Window_Closing" StateChanged="Window_StateChanged"
UseLayoutRounding="True" SnapsToDevicePixels="True"
TextOptions.TextFormattingMode="Display"
RenderOptions.ClearTypeHint="Enabled">
<Window.Resources>
<DataTemplate x:Key="TabTemplate">
<Grid MinWidth="126" MaxWidth="250" Height="34">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Ellipse Width="6" Height="6" Fill="{StaticResource TextMuted}" Margin="0,0,8,0" />
<TextBlock Text="{Binding DisplayTitle}"
TextTrimming="CharacterEllipsis"
VerticalAlignment="Center"
FontSize="12"
FontWeight="SemiBold"
Foreground="{StaticResource TextSecondary}" />
</StackPanel>
<Button Grid.Column="1"
Content="×"
Tag="{Binding}"
Click="CloseTab_Click"
ToolTip="Закрити вкладку"
Width="22" Height="22"
Padding="0"
Margin="8,0,0,0"
FontSize="14"
FontWeight="Bold"
Background="Transparent"
BorderBrush="Transparent"
Foreground="{StaticResource TextMuted}">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="CloseBorder" Background="{TemplateBinding Background}" CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-1,0,0" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="CloseBorder" Property="Background" Value="{StaticResource DangerBg}" />
<Setter Property="Foreground" Value="{StaticResource DangerText}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</DataTemplate>
<Style TargetType="TabItem">
<Setter Property="Background" Value="#191F28" />
<Setter Property="BorderBrush" Value="{StaticResource BorderDark}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{StaticResource TextSecondary}" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="12,0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border x:Name="TabBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8"
Padding="{TemplateBinding Padding}"
Margin="0,0,6,2">
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="TabBorder" Property="Background" Value="#222A35" />
<Setter TargetName="TabBorder" Property="BorderBrush" Value="{StaticResource BorderMedium}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="TabBorder" Property="Background" Value="#26354B" />
<Setter TargetName="TabBorder" Property="BorderBrush" Value="{StaticResource AurBlue}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{StaticResource TextPrimary}" />
<Setter Property="FontWeight" Value="SemiBold" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<DockPanel>
<!-- Tab strip -->
<Border DockPanel.Dock="Top" Background="{StaticResource HeaderBg}" Padding="12,10,12,8" BorderBrush="{StaticResource BorderDark}" BorderThickness="0,0,0,1">
<DockPanel>
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center" Margin="2,0,18,0">
<Border Width="32" Height="32" CornerRadius="9" Background="{StaticResource AurBlueSoft}">
<TextBlock Text="🦊" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</StackPanel>
<Button DockPanel.Dock="Right" Content="+" ToolTip="Нова вкладка" Click="NewTab_Click" Style="{StaticResource IconButton}" Margin="8,0,0,0" />
<TabControl x:Name="TabStrip"
ItemsSource="{Binding Tabs}"
ItemTemplate="{StaticResource TabTemplate}"
SelectionChanged="TabStrip_SelectionChanged"
Background="Transparent"
BorderThickness="0"
Padding="0"
Margin="0,0,0,0">
<TabControl.ContentTemplate>
<DataTemplate><Grid Visibility="Collapsed" /></DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</DockPanel>
</Border>
<!-- Browser controls -->
<Border DockPanel.Dock="Top" Background="{StaticResource HeaderBgElevated}" Padding="12,9" BorderBrush="{StaticResource BorderDark}" BorderThickness="0,0,0,1">
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,10,0">
<Button Content="←" ToolTip="Назад" Click="Back_Click" Style="{StaticResource IconButton}" />
<Button Content="→" ToolTip="Вперед" Click="Forward_Click" Style="{StaticResource IconButton}" />
<Button Content="⟳" ToolTip="Оновити" Click="Reload_Click" Style="{StaticResource IconButton}" Margin="4,0,0,0" />
</StackPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0">
<ItemsControl x:Name="PinnedExtensionStrip" Margin="0,0,5,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><StackPanel Orientation="Horizontal" /></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Tag="{Binding}" Click="PinnedExtension_Click" Width="32" Height="32" Padding="0" Margin="0,0,4,0" ToolTip="{Binding Name}" Style="{StaticResource IconButton}">
<Grid>
<Image Source="{Binding IconPath}" Width="18" Height="18" Stretch="Uniform" />
<TextBlock Text="{Binding Glyph}" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Content="♫" ToolTip="Режим лише аудіо" Click="AudioOnly_Click" Height="32" Width="36" Padding="0" Margin="0,0,4,0" />
<Button Content="Розширення" ToolTip="Керування unpacked extensions" Click="Extensions_Click" Height="32" Padding="11,0" />
</StackPanel>
<Grid VerticalAlignment="Center">
<TextBox x:Name="AddressBox"
VerticalContentAlignment="Center"
Height="32"
Padding="12,0,86,0"
KeyDown="AddressBox_KeyDown" />
<Button Content="Перейти" ToolTip="Відкрити адресу" Click="Go_Click" Style="{StaticResource PrimaryButton}" Height="26" Padding="12,0" HorizontalAlignment="Right" Margin="0,0,3,0" />
</Grid>
</DockPanel>
</Border>
<!-- Web content -->
<Grid x:Name="WebViewHost" Background="#0B0E12">
<TextBlock x:Name="BrowserStatus"
Text="Ініціалізація WebView2…"
Foreground="{StaticResource TextSecondary}"
FontSize="13"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Visibility="Collapsed" />
</Grid>
</DockPanel>
</Window>