Files
FluentTerminal/FluentTerminal.App/Views/TerminalView.xaml
T
Max HoraandFelix Seidl dec492e39a Reconnect failed tab. (#682)
* Reconnect failed tab.

* Reconnect session overlay; Reconnect tab command is removed from context menus.

* some ui changes + localization

Co-authored-by: Felix Seidl <f.seidl@me.com>
2020-03-31 20:01:09 +02:00

157 lines
6.8 KiB
XML

<UserControl
x:Class="FluentTerminal.App.Views.TerminalView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:actions="using:FluentTerminal.App.Actions"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:FluentTerminal.App.Views"
d:DesignHeight="300"
d:DesignWidth="600"
mc:Ignorable="d">
<Grid>
<Grid x:Name="TerminalContainer" />
<views:OverlayView x:Name="MessageOverlay" />
<controls:DropShadowPanel
Height="64"
Margin="12"
HorizontalAlignment="Right"
VerticalAlignment="Top"
ShadowOpacity="0.5"
Visibility="{x:Bind ViewModel.ShowSearchPanel, Mode=OneWay, Converter={StaticResource TrueToVisibleConverter}}"
Color="Black">
<StackPanel
Padding="6"
Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}"
CornerRadius="4"
Orientation="Horizontal">
<Viewbox
Width="16"
Height="16"
Margin="6,0,0,0">
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF78B;" />
</Viewbox>
<TextBox
Name="SearchTextBox"
x:Uid="SearchTextBox"
Width="200"
Margin="6,0,6,0"
Background="Transparent"
BorderThickness="0"
IsTabStop="True"
KeyUp="OnSearchTextBoxKeyUp"
PlaceholderText="Enter search term"
Text="{x:Bind ViewModel.SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{x:Bind ViewModel.ShowSearchPanel, Mode=OneWay}" Value="true">
<actions:FocusAction />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBox>
<ToggleButton
x:Uid="SearchCaseSensitive"
Background="Transparent"
IsChecked="{x:Bind ViewModel.SearchMatchCase, Mode=TwoWay}"
ToolTipService.ToolTip="Case sensitive">
<Viewbox Width="16" Height="16">
<TextBlock Text="Aa" />
</Viewbox>
</ToggleButton>
<ToggleButton
x:Uid="SearchWholeWord"
Margin="2,0,2,0"
Background="Transparent"
IsChecked="{x:Bind ViewModel.SearchWholeWord, Mode=TwoWay}"
ToolTipService.ToolTip="Whole word">
<Viewbox Width="16" Height="16">
<TextBlock Text="Ab" TextDecorations="Underline" />
</Viewbox>
</ToggleButton>
<ToggleButton
x:Uid="SearchWithRegex"
Background="Transparent"
IsChecked="{x:Bind ViewModel.SearchWithRegex, Mode=TwoWay}"
ToolTipService.ToolTip="Regex">
<Viewbox Width="16" Height="16">
<TextBlock Text=".*" />
</Viewbox>
</ToggleButton>
<Button
Name="PreviousButton"
x:Uid="FindPrevious"
Margin="6,0,0,0"
Background="Transparent"
Command="{x:Bind ViewModel.FindPreviousCommand}"
ToolTipService.ToolTip="Find previous">
<Button.Content>
<Viewbox Width="16" Height="16">
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE971;" />
</Viewbox>
</Button.Content>
</Button>
<Button
x:Uid="FindNext"
Margin="0,0,6,0"
Background="Transparent"
Command="{x:Bind ViewModel.FindNextCommand}"
ToolTipService.ToolTip="Find next">
<Button.Content>
<Viewbox Width="16" Height="16">
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE972;" />
</Viewbox>
</Button.Content>
</Button>
<Button
x:Uid="CloseSearchPanel"
Background="Transparent"
Command="{x:Bind ViewModel.CloseSearchPanelCommand}"
ToolTipService.ToolTip="Close search panel">
<Button.Content>
<Viewbox Width="16" Height="16">
<SymbolIcon Symbol="Cancel" />
</Viewbox>
</Button.Content>
</Button>
</StackPanel>
</controls:DropShadowPanel>
<controls:DropShadowPanel
Margin="12"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
ShadowOpacity="0.5"
Visibility="{x:Bind ViewModel.HasExitedWithError, Mode=OneWay, Converter={StaticResource TrueToVisibleConverter}}"
Color="Black">
<StackPanel
Padding="6"
CornerRadius="4"
Orientation="Horizontal">
<StackPanel.Background>
<SolidColorBrush Color="{ThemeResource SystemAccentColor}" />
</StackPanel.Background>
<TextBlock
x:Uid="SessionDisconnected"
Margin="6,0,24,0"
VerticalAlignment="Center"
Text="Session disconnected" />
<Button
x:Uid="RestartSession"
Margin="0,0,6,0"
Command="{x:Bind ViewModel.ReconnectTabCommand, Mode=OneWay}"
Content="Restart"
IsEnabled="{x:Bind ViewModel.HasExitedWithError, Mode=OneWay}" />
<Button Command="{x:Bind ViewModel.CloseCommand, Mode=OneWay}" Content="{x:Bind Converter={StaticResource I18NConverter}, ConverterParameter=Close}" />
</StackPanel>
</controls:DropShadowPanel>
</Grid>
</UserControl>