-
Notifications
You must be signed in to change notification settings - Fork 8.5k
/
Copy pathTermControl.xaml
136 lines (126 loc) · 6.22 KB
/
TermControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!--
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<UserControl x:Class="Microsoft.Terminal.Control.TermControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.Terminal.Control"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
d:DesignHeight="768"
d:DesignWidth="1024"
AllowDrop="True"
AllowFocusOnInteraction="True"
Background="Transparent"
CharacterReceived="_CharacterHandler"
DragOver="_DragOverHandler"
Drop="_DragDropHandler"
GotFocus="_GotFocusHandler"
IsTabStop="True"
KeyUp="_KeyUpHandler"
LostFocus="_LostFocusHandler"
PointerWheelChanged="_MouseWheelHandler"
PreviewKeyDown="_KeyDownHandler"
TabNavigation="Cycle"
Tapped="_TappedHandler"
mc:Ignorable="d">
<!--
TODO GH#4031: We've investigated whether we should be using KeyDown or PreviewKeyDown
but not necessarily come to a consensus. It's possible that moving input to the SwapChainPanel
will solve a bunch of the search input issues we found last time we switched.
-->
<Grid x:Name="RootGrid">
<Grid.Lights>
<local:VisualBellLight x:Name="BellLight" />
</Grid.Lights>
<Image x:Name="BackgroundImage"
AutomationProperties.AccessibilityView="Raw" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0"
Background="Transparent"
PointerExited="_PointerExitedHandler"
PointerMoved="_PointerMovedHandler"
PointerPressed="_PointerPressedHandler"
PointerReleased="_PointerReleasedHandler"
Visibility="Visible">
<SwapChainPanel x:Name="SwapChainPanel"
CompositionScaleChanged="_SwapChainScaleChanged"
SizeChanged="_SwapChainSizeChanged">
<Canvas x:Name="OverlayCanvas"
Visibility="Visible">
<Border x:Name="HyperlinkTooltipBorder"
BorderBrush="Transparent">
<ToolTipService.ToolTip>
<ToolTip x:Name="LinkTip"
Placement="Mouse">
<TextBlock IsTextSelectionEnabled="True"
TextWrapping="Wrap">
<Run x:Name="HoveredUri" /> <LineBreak />
<Run x:Uid="HowToOpenRun"
FontStyle="Italic" />
</TextBlock>
</ToolTip>
</ToolTipService.ToolTip>
</Border>
</Canvas>
</SwapChainPanel>
<!--
Putting this in a grid w/ the SwapChainPanel
ensures that it's always aligned w/ the scrollbar
-->
<local:SearchBoxControl x:Name="SearchBox"
HorizontalAlignment="Right"
VerticalAlignment="Top"
x:Load="False"
Closed="_CloseSearchBoxControl"
Search="_Search"
Visibility="Collapsed" />
</Grid>
<ScrollBar x:Name="ScrollBar"
Grid.Column="1"
HorizontalAlignment="Right"
VerticalAlignment="Stretch"
IndicatorMode="MouseIndicator"
IsTabStop="False"
LargeChange="4"
Maximum="1"
Orientation="Vertical"
PointerPressed="_CapturePointer"
PointerReleased="_ReleasePointerCapture"
SmallChange="1"
ValueChanged="_ScrollbarChangeHandler"
ViewportSize="10" />
</Grid>
<local:TSFInputControl x:Name="TSFInputControl"
CompositionCompleted="_CompositionCompleted"
CurrentCursorPosition="_CurrentCursorPositionHandler"
CurrentFontInfo="_FontInfoHandler" />
<Grid x:Name="RendererFailedNotice"
HorizontalAlignment="Center"
VerticalAlignment="Center"
x:Load="False">
<Border Margin="8,8,8,8"
Padding="8,8,8,8"
Background="{ThemeResource SystemControlBackgroundAltHighBrush}"
BorderBrush="{ThemeResource SystemAccentColor}"
BorderThickness="2,2,2,2"
CornerRadius="{ThemeResource OverlayCornerRadius}">
<StackPanel>
<TextBlock x:Uid="TermControl_RendererFailedTextBlock"
HorizontalAlignment="Center"
TextWrapping="WrapWholeWords" />
<Button x:Uid="TermControl_RendererRetryButton"
HorizontalAlignment="Right"
Click="_RenderRetryButton_Click" />
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>