## Summary of the Pull Request Introduces read-only panes. When pane is marked as read-only: 1. Attempt to provide user input results in a warning 2. Attempt to close pane - shows dialog 3. Attempt to close hosting tab shows dialog 4. The hosting tab has no close button ## PR Checklist * [x] Closes #6981 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated - not yet. * [x] Schema updated. * [ ] I've discussed this with core contributors already. ## Detailed Description of the Pull Request / Additional comments 1. The readonly logic implemented in `TermControl` (and prevents any send input) 2. Special handling is required to allow key-bindings 3. The "close-readonly" protections are in TerminalPage. 4. The indication that the pane is readonly is done using lock glyph 5. The indication that the tab contains readonly pane is done by hiding the close button of the tab 6. The readonly mode is enabled by keyboard shortcut (the followup might add this to the context menu) ## Validation Steps Performed
137 lines
5 KiB
XML
137 lines
5 KiB
XML
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
|
the MIT License. See LICENSE in the project root for license information. -->
|
|
<Page
|
|
x:Class="TerminalApp.TerminalPage"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="using:TerminalApp"
|
|
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
|
|
<Grid x:Name="Root" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<local:TabRowControl x:Name="TabRow" Grid.Row="0" />
|
|
|
|
<Grid x:Name="TabContent" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="AboutDialog"
|
|
x:Uid="AboutDialog"
|
|
DefaultButton="Close">
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock IsTextSelectionEnabled="True">
|
|
<Run Text="{x:Bind ApplicationDisplayName}" /> <LineBreak />
|
|
<Run x:Uid="AboutDialog_VersionLabel" />
|
|
<Run Text="{x:Bind ApplicationVersion}" />
|
|
</TextBlock>
|
|
<HyperlinkButton
|
|
x:Uid="AboutDialog_DocumentationLink"
|
|
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125416" />
|
|
<HyperlinkButton
|
|
x:Uid="AboutDialog_ReleaseNotesLink"
|
|
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125417" />
|
|
<HyperlinkButton
|
|
x:Uid="AboutDialog_PrivacyPolicyLink"
|
|
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125418" />
|
|
<HyperlinkButton
|
|
x:Uid="AboutDialog_ThirdPartyNoticesLink"
|
|
Click="_ThirdPartyNoticesOnClick" />
|
|
</StackPanel>
|
|
</ContentDialog>
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="CloseAllDialog"
|
|
x:Uid="CloseAllDialog"
|
|
DefaultButton="Primary">
|
|
</ContentDialog>
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="CloseReadOnlyDialog"
|
|
x:Uid="CloseReadOnlyDialog"
|
|
DefaultButton="Primary">
|
|
</ContentDialog>
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="MultiLinePasteDialog"
|
|
x:Uid="MultiLinePasteDialog"
|
|
DefaultButton="Primary">
|
|
<StackPanel>
|
|
<TextBlock
|
|
x:Uid="MultiLineWarningText"
|
|
TextWrapping="Wrap">
|
|
</TextBlock>
|
|
<TextBlock
|
|
x:Uid="ClipboardTextHeader"
|
|
Margin="0,16,0,0">
|
|
</TextBlock>
|
|
<ScrollViewer
|
|
Margin="0,8,0,0"
|
|
x:Name="ClipboardContentScrollViewer"
|
|
MaxHeight="100">
|
|
<TextBlock
|
|
x:Name="ClipboardText"
|
|
TextWrapping="Wrap"
|
|
FontFamily="Cascadia Mono">
|
|
</TextBlock>
|
|
</ScrollViewer>
|
|
</StackPanel>
|
|
</ContentDialog>
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="LargePasteDialog"
|
|
x:Uid="LargePasteDialog"
|
|
DefaultButton="Primary">
|
|
</ContentDialog>
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="ControlNoticeDialog"
|
|
x:Uid="ControlNoticeDialog"
|
|
DefaultButton="Primary">
|
|
<TextBlock IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords">
|
|
<Run x:Name="NoticeMessage"/>
|
|
</TextBlock>
|
|
</ContentDialog>
|
|
|
|
<ContentDialog
|
|
x:Load="False"
|
|
x:Name="CouldNotOpenUriDialog"
|
|
x:Uid="CouldNotOpenUriDialog"
|
|
DefaultButton="Primary">
|
|
<TextBlock IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords">
|
|
<Run x:Name="CouldNotOpenUriReason" /> <LineBreak />
|
|
<Run
|
|
x:Name="UnopenedUri"
|
|
FontFamily="Cascadia Mono">
|
|
</Run>
|
|
</TextBlock>
|
|
</ContentDialog>
|
|
|
|
<local:CommandPalette
|
|
x:Name="CommandPalette"
|
|
Grid.Row="1"
|
|
Visibility="Collapsed"
|
|
PreviewKeyDown ="_KeyDownHandler"
|
|
VerticalAlignment="Stretch" />
|
|
|
|
<mux:InfoBar x:Name="KeyboardWarningInfoBar"
|
|
x:Load="False"
|
|
IsClosable="True"
|
|
IsIconVisible="True"
|
|
IsOpen="False"
|
|
Severity="Warning"
|
|
Message="{x:Bind KeyboardServiceDisabledText, Mode=OneWay}"/>
|
|
</Grid>
|
|
</Page>
|