Compare commits

..

22 Commits

Author SHA1 Message Date
Mike Griese
62c47cf8fb Merge remote-tracking branch 'origin/main' into dev/migrie/f/overview-view 2026-05-14 10:25:34 -05:00
Lucas Trzesniewski
fb71a0462e Add safeUriSchemes setting (#20207)
This adds a `safeUriSchemes` global setting which lets you define
hyperlink URI schemes which the user considers safe. No confirmation
dialog will be shown when trying to open hyperlinks which use these
schemes.

- This solves the root issue, but doesn't introduce any UI or
  documentation changes. I wanted to validate the approach and
  implementation with you first.
- I closely followed the code handling the `disabledProfileSources`
  setting, which is of the same type.
- This feature does not change the behavior of `http`, `https` and
  `file` schemes.

Validation

I ran the dev terminal, and tested the behavior by clicking on `vscode`
hyperlinks generated by ripgrep with various `safeUriSchemes` settings:

- Setting not defined - asks for confirmation
- `["vscode"]` - does not ask for confirmation
- `["foo", "vscode"]` - does not ask for confirmation
- `["foo"]` - asks for confirmation
- `null` - asks for confirmation
- `[]` - asks for confirmation
- `[""]` - asks for confirmation
- `[{"foo": "bar"}]` - fails to deserialize (as expected)

A few uinit tests failed, but they seem unrelated to these changes:
- `KeyBindingTests` in `UnitTests_SettingsModel`, probably because I use
  an AZERTY keyboard.
- A few `Conhost` tests, but I didn't touch this part

Refs #20065
Closes #20191
2026-05-12 21:32:56 +00:00
Dustin L. Howett
c829d4ca54 sixel: prevent allocating an absurd amount of memory or writing OOB (#20213)
This commit implements two fixes for the integer overflow/out-of-bounds
write reported in #20149.

First, it catches any exception generated in sixel char processing
(which will prevent `out_of_memory` or `bad_alloc` from being ignored
sight-unseen, and will prevent the consumption of further DCS content).

Second, it prevents us from allocating memory for an image which will
never be displayed (because it exceeds the height of the display.)

This supersedes prior work in #20153 for the same issues.

Closes #20149
Closes #20153

Co-authored-by: James Holderness <j4_james@hotmail.com>
2026-05-12 18:15:19 +02:00
Dustin L. Howett
b991eb048e Only set startingTitle once, clear up title fallback handling (#20214)
This commit ensures that we only set the starting title once when we
open a new terminal pane.

It also consolidates all title selection into Terminal::GetConsoleTitle,
which is now used in the TitleChanged event.

TitleChanged no longer stores a separate copy of the starting title if
an application attempts to _clear_ the title; that seems like a poorer
implementation of what we already had.

This supersedes work in #20204.

Closes #19340
Closes #20204

Co-authored-by: imsh <im.shaedar@gmail.com>
2026-05-12 00:08:57 +00:00
Dustin L. Howett
3e3b3ad883 Reject DTTERM Window Manipulation resizes with the current size (#20183)
This may help #20182 and #20112
Closes #19310
2026-05-11 17:42:18 -05:00
Mike Griese
906c1fe15a Merge remote-tracking branch 'origin/main' into dev/migrie/f/overview-view 2026-05-09 14:35:28 -05:00
Windows Console Service Bot
d3f76e7acf Localization Updates - main - 05/07/2026 03:04:15 (#20196)
Co-authored-by: Console Service Bot <consvc@microsoft.com>
2026-05-07 14:03:13 -05:00
Mike Griese
c67adbdedb need you 2026-04-24 06:31:05 -05:00
Mike Griese
134a2d5d39 Merge remote-tracking branch 'origin/main' into dev/migrie/f/overview-view 2026-04-24 05:35:34 -05:00
Mike Griese
47950d2753 nope don't check that in 2026-04-24 05:33:44 -05:00
Mike Griese
d3c17f9d6f squad: log overview pre-dismiss before DoAction
Coordinator direct edit in TerminalPage::_KeyDownHandler: dismiss
OverviewPane before _actionDispatch->DoAction when a non-ToggleOverview
action resolves. Restores reparented tab Content to its original parent
before any tab-state-mutating action runs.

Requested by: Mike Griese.
2026-04-18 20:19:29 -05:00
Mike Griese
451bf37008 Overview: route unrecognized keys to global action dispatch
Add PreviewKeyDown=_KeyDownHandler to OverviewPaneElement in TerminalPage.xaml so global keybindings continue to work while the overview is visible. Local grid keys (Tab/arrows/Enter/Escape) remain handled by OverviewPane::_OnKeyDown. Matches the CommandPalette/SuggestionsControl pattern.
2026-04-18 20:01:05 -05:00
Mike Griese
5a3ae31453 avoid a _mild_ exception 2026-04-18 19:56:50 -05:00
Mike Griese
3dd5dadb38 squad: log overview external-dismiss fix
Dallas extracted _DismissOverviewVisuals() helper and wired
_OnTabSelectionChanged to release reparented overview content
before _UpdatedSelectedTab mounts the new tab.

Requested-by: Mike Griese
2026-04-18 06:58:18 -05:00
Mike Griese
724c519788 theme aware bg 2026-04-18 06:50:47 -05:00
Mike Griese
3cc213a2c1 mildly cleaner 2026-03-31 21:32:51 -05:00
Mike Griese
0afdc93bef i'd ship this 2026-03-30 19:55:14 -05:00
Mike Griese
6f384c59f4 Awesome, click on the previews anywhere 2026-03-30 15:57:27 -05:00
Mike Griese
66a828bc02 Weird thing: Why do we hit this all the time now? We never did before? 2026-03-30 15:36:18 -05:00
Mike Griese
e19e710e03 yea that's wacky 2026-03-30 14:51:30 -05:00
Mike Griese
54604076b9 what the fuck 2026-03-30 14:10:40 -05:00
Mike Griese
ceef4d46ed no way 2026-03-30 13:37:41 -05:00
64 changed files with 2176 additions and 1049 deletions

View File

@@ -17,7 +17,6 @@ ADDSTRING
ADDTOOL
adml
admx
Affordance
AFill
AFX
AHelper
@@ -1106,6 +1105,7 @@ NOSIZE
NOSNAPSHOT
NOTHOUSANDS
NOTICKS
notif
NOTIMEOUTIFNOTHUNG
NOTIMPL
NOTOPMOST

View File

@@ -2472,6 +2472,13 @@
},
"type": "array"
},
"safeUriSchemes": {
"description": "Specifies a list of URI schemes that are considered safe. No confirmation will be required to open URIs with these schemes.",
"items": {
"type": "string"
},
"type": "array"
},
"rendering.graphicsAPI": {
"description": "Direct3D 11 provides a more performant and feature-rich experience, whereas Direct2D is more stable. The default option \"Automatic\" will pick the API that best fits your graphics hardware. If you experience significant issues, consider using Direct2D.",
"type": "string",

View File

@@ -604,6 +604,13 @@ namespace winrt::TerminalApp::implementation
args.Handled(true);
}
void TerminalPage::_HandleToggleOverview(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
ToggleOverview();
args.Handled(true);
}
void TerminalPage::_HandleSetFocusMode(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{

View File

@@ -0,0 +1,690 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "OverviewPane.h"
#include "OverviewPane.g.cpp"
using namespace winrt;
using namespace winrt::TerminalApp;
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::UI::Xaml;
using namespace winrt::Windows::UI::Xaml::Controls;
using namespace winrt::Windows::UI::Xaml::Input;
using namespace winrt::Windows::UI::Xaml::Media;
using namespace winrt::Windows::UI::Xaml::Media::Animation;
using namespace winrt::Windows::System;
namespace winrt::TerminalApp::implementation
{
static constexpr double PreviewCellWidth = 320.0;
static constexpr double PreviewCellHeight = 220.0;
static constexpr std::chrono::milliseconds EnterAnimDuration{ 400 };
static constexpr std::chrono::milliseconds ExitAnimDuration{ 100 };
OverviewPane::OverviewPane()
{
InitializeComponent();
// Apply the initial background (opaque by default, since _useMica
// starts false). Without this the XAML-declared brush stays in place
// until someone explicitly calls UseMica().
_UpdateBackgroundForMica();
// Listen for layout passes so we can start the zoom-in animation
// once the WrapGrid has measured and positioned its children.
PreviewGrid().LayoutUpdated([weakThis = get_weak()](auto&&, auto&&) {
if (auto self = weakThis.get())
{
if (!self->_pendingEnterAnimation)
{
return;
}
// Check that at least the first cell is laid out
auto items = self->PreviewGrid().Items();
if (items.Size() == 0)
{
return;
}
auto first = items.GetAt(0).try_as<FrameworkElement>();
if (!first || first.ActualWidth() <= 0)
{
return;
}
self->_pendingEnterAnimation = false;
self->_StartEnterZoomAnimation();
}
});
}
OverviewPane::~OverviewPane()
{
ClearTabContent();
}
void OverviewPane::UpdateTabContent(Windows::Foundation::Collections::IVector<TerminalApp::Tab> tabs, int32_t focusedIndex)
{
// Clear any previous state
ClearTabContent();
if (!tabs || tabs.Size() == 0)
{
return;
}
const auto itemsControl = PreviewGrid();
// Determine a reference size from the currently visible tab's content.
// Inactive tabs have zero ActualWidth/Height since they're not laid out
// in the visual tree, but all tabs share the same content area, so the
// active tab's size is the right reference for all of them.
double referenceWidth = 0;
double referenceHeight = 0;
if (focusedIndex >= 0 && focusedIndex < static_cast<int32_t>(tabs.Size()))
{
auto focusedContent = tabs.GetAt(static_cast<uint32_t>(focusedIndex)).Content();
if (focusedContent)
{
referenceWidth = focusedContent.ActualWidth();
referenceHeight = focusedContent.ActualHeight();
}
}
for (uint32_t i = 0; i < tabs.Size(); i++)
{
const auto& tab = tabs.GetAt(i);
auto cell = _BuildPreviewCell(tab, static_cast<int32_t>(i), referenceWidth, referenceHeight);
itemsControl.Items().Append(cell);
}
_selectedIndex = focusedIndex;
_UpdateSelection();
_PlayEnterAnimation();
// Focus self for keyboard input
Focus(FocusState::Programmatic);
}
void OverviewPane::ClearTabContent()
{
_pendingEnterAnimation = false;
// Stop any running exit animation
if (_exitContentStoryboard)
{
_exitContentStoryboard.Completed(_exitAnimationToken);
_exitAnimationToken = {};
_exitContentStoryboard.Stop();
_exitContentStoryboard = nullptr;
}
// Reset the zoom transform to identity
auto transform = ContentTransform();
transform.ScaleX(1.0);
transform.ScaleY(1.0);
transform.TranslateX(0.0);
transform.TranslateY(0.0);
ContentWrapper().Opacity(1.0);
// Reparent content back to original parents
for (auto& entry : _reparentedContent)
{
if (entry.content)
{
// Restore original Width/Height (NaN = auto-sizing)
entry.content.Width(entry.originalWidth);
entry.content.Height(entry.originalHeight);
// Restore original RenderTransform and origin
entry.content.RenderTransform(entry.originalRenderTransform);
entry.content.RenderTransformOrigin(entry.originalRenderTransformOrigin);
_DetachContent(entry.content);
// Put it back where it came from
if (entry.originalParent)
{
entry.originalParent.Children().Append(entry.content);
}
}
}
_reparentedContent.clear();
const auto itemsControl = PreviewGrid();
itemsControl.Items().Clear();
}
int32_t OverviewPane::SelectedIndex() const
{
return _selectedIndex;
}
void OverviewPane::SelectedIndex(int32_t value)
{
if (_selectedIndex != value)
{
_selectedIndex = value;
_UpdateSelection();
}
}
bool OverviewPane::UseMica() const
{
return _useMica;
}
void OverviewPane::UseMica(bool value)
{
if (_useMica != value)
{
_useMica = value;
_UpdateBackgroundForMica();
}
}
void OverviewPane::_UpdateBackgroundForMica()
{
auto overlay = BackgroundOverlay();
if (_useMica)
{
// Transparent background — let the Mica backdrop show through
overlay.Background(SolidColorBrush{ winrt::Windows::UI::Colors::Transparent() });
}
else
{
// Opaque background when Mica is not active.
// Use the theme-aware SolidBackgroundFillColorBaseBrush so we
// match the correct color for light / dark theme.
auto res = Application::Current().Resources();
auto brush = res.TryLookup(winrt::box_value(L"SolidBackgroundFillColorBaseBrush"));
if (brush)
{
overlay.Background(brush.as<Brush>());
}
else
{
overlay.Background(SolidColorBrush{ winrt::Windows::UI::ColorHelper::FromArgb(255, 32, 32, 32) });
}
}
}
void OverviewPane::_OnPreviewKeyDown(const IInspectable& /*sender*/, const KeyRoutedEventArgs& e)
{
if (e.OriginalKey() != VirtualKey::Tab)
{
return;
}
const auto items = PreviewGrid().Items();
const auto itemCount = static_cast<int32_t>(items.Size());
if (itemCount == 0)
{
return;
}
const auto shiftPressed = (Windows::UI::Core::CoreWindow::GetForCurrentThread().GetKeyState(VirtualKey::Shift) & Windows::UI::Core::CoreVirtualKeyStates::Down) == Windows::UI::Core::CoreVirtualKeyStates::Down;
if (shiftPressed)
{
if (_selectedIndex > 0)
{
_selectedIndex--;
_UpdateSelection();
}
}
else
{
if (_selectedIndex < itemCount - 1)
{
_selectedIndex++;
_UpdateSelection();
}
}
e.Handled(true);
}
void OverviewPane::_OnKeyDown(const IInspectable& /*sender*/, const KeyRoutedEventArgs& e)
{
const auto items = PreviewGrid().Items();
const auto itemCount = static_cast<int32_t>(items.Size());
if (itemCount == 0)
{
return;
}
auto handled = true;
switch (e.OriginalKey())
{
case VirtualKey::Left:
if (_selectedIndex > 0)
{
_selectedIndex--;
_UpdateSelection();
}
break;
case VirtualKey::Right:
if (_selectedIndex < itemCount - 1)
{
_selectedIndex++;
_UpdateSelection();
}
break;
case VirtualKey::Up:
if (_selectedIndex - _columnCount >= 0)
{
_selectedIndex -= _columnCount;
_UpdateSelection();
}
break;
case VirtualKey::Down:
if (_selectedIndex + _columnCount < itemCount)
{
_selectedIndex += _columnCount;
_UpdateSelection();
}
break;
case VirtualKey::Enter:
_OnItemClicked(_selectedIndex);
break;
case VirtualKey::Escape:
_PlayExitAnimation([weakThis = get_weak()]() {
if (auto self = weakThis.get())
{
self->Dismissed.raise(*self, nullptr);
}
});
break;
default:
handled = false;
break;
}
e.Handled(handled);
}
void OverviewPane::_OnItemClicked(int32_t index)
{
_PlayExitAnimation([weakThis = get_weak(), index]() {
if (auto self = weakThis.get())
{
self->TabSelected.raise(*self, winrt::Windows::Foundation::IReference<int32_t>{ index });
}
});
}
void OverviewPane::_UpdateSelection()
{
const auto items = PreviewGrid().Items();
const auto itemCount = static_cast<int32_t>(items.Size());
// Clamp selection
_selectedIndex = std::clamp(_selectedIndex, 0, std::max(0, itemCount - 1));
for (int32_t i = 0; i < itemCount; i++)
{
if (auto cellElement = items.GetAt(i).try_as<FrameworkElement>())
{
if (auto border = cellElement.try_as<Border>())
{
if (i == _selectedIndex)
{
// Accent-colored border for selected item
const auto accentBrush = Application::Current()
.Resources()
.Lookup(winrt::box_value(L"SystemAccentColor"))
.as<winrt::Windows::UI::Color>();
border.BorderBrush(SolidColorBrush{ accentBrush });
border.BorderThickness(ThicknessHelper::FromUniformLength(2));
// Scroll into view if needed
border.StartBringIntoView();
}
else
{
border.BorderBrush(SolidColorBrush{ winrt::Windows::UI::Colors::Transparent() });
border.BorderThickness(ThicknessHelper::FromUniformLength(2));
}
}
}
}
}
void OverviewPane::_PlayEnterAnimation()
{
// Hide the content wrapper until the LayoutUpdated callback fires
// and we can read cell positions to set up the zoom transform.
ContentWrapper().Opacity(0);
_pendingEnterAnimation = true;
}
void OverviewPane::_StartEnterZoomAnimation()
{
// Start the background fade-in together with the zoom so both
// animations are visible at the same moment (avoids opacity flash).
if (auto bgSb = Resources().Lookup(winrt::box_value(L"BackgroundFadeIn")).try_as<Storyboard>())
{
bgSb.Begin();
}
auto wrapper = ContentWrapper();
auto transform = ContentTransform();
auto zoomParams = _GetZoomParamsForCell(_selectedIndex);
if (!zoomParams)
{
wrapper.Opacity(1.0);
return;
}
auto [scale, tx, ty] = *zoomParams;
// Set the initial transform so the focused cell fills the viewport
transform.ScaleX(scale);
transform.ScaleY(scale);
transform.TranslateX(tx);
transform.TranslateY(ty);
wrapper.Opacity(1.0);
// Animate from the zoomed-in state to identity (zoom out to grid)
Storyboard storyboard;
const auto duration = DurationHelper::FromTimeSpan(EnterAnimDuration);
CubicEase easing;
easing.EasingMode(EasingMode::EaseOut);
_AddDoubleAnimation(storyboard, transform, L"ScaleX", scale, 1.0, duration, easing);
_AddDoubleAnimation(storyboard, transform, L"ScaleY", scale, 1.0, duration, easing);
_AddDoubleAnimation(storyboard, transform, L"TranslateX", tx, 0.0, duration, easing);
_AddDoubleAnimation(storyboard, transform, L"TranslateY", ty, 0.0, duration, easing);
storyboard.Begin();
}
void OverviewPane::_PlayExitAnimation(std::function<void()> onComplete)
{
// Fade out the background overlay
if (auto bgSb = Resources().Lookup(winrt::box_value(L"BackgroundFadeOut")).try_as<Storyboard>())
{
bgSb.Begin();
}
auto zoomParams = _GetZoomParamsForCell(_selectedIndex);
if (!zoomParams)
{
if (onComplete)
{
onComplete();
}
return;
}
auto [scale, tx, ty] = *zoomParams;
// Animate from the current grid view into the selected cell
auto transform = ContentTransform();
Storyboard storyboard;
const auto duration = DurationHelper::FromTimeSpan(ExitAnimDuration);
CubicEase easing;
easing.EasingMode(EasingMode::EaseIn);
_AddDoubleAnimation(storyboard, transform, L"ScaleX", 1.0, scale, duration, easing);
_AddDoubleAnimation(storyboard, transform, L"ScaleY", 1.0, scale, duration, easing);
_AddDoubleAnimation(storyboard, transform, L"TranslateX", 0.0, tx, duration, easing);
_AddDoubleAnimation(storyboard, transform, L"TranslateY", 0.0, ty, duration, easing);
// Revoke any previously registered Completed handler
if (_exitContentStoryboard)
{
_exitContentStoryboard.Completed(_exitAnimationToken);
}
_exitContentStoryboard = storyboard;
_exitAnimationToken = storyboard.Completed([weakThis = get_weak(), onComplete](auto&&, auto&&) {
if (auto self = weakThis.get())
{
if (onComplete)
{
onComplete();
}
}
});
storyboard.Begin();
}
std::optional<std::tuple<double, double, double>> OverviewPane::_GetZoomParamsForCell(int32_t index)
{
auto wrapper = ContentWrapper();
const auto vpW = wrapper.ActualWidth();
const auto vpH = wrapper.ActualHeight();
if (vpW <= 0 || vpH <= 0)
{
return std::nullopt;
}
auto items = PreviewGrid().Items();
if (index < 0 || index >= static_cast<int32_t>(items.Size()))
{
return std::nullopt;
}
auto cell = items.GetAt(static_cast<uint32_t>(index)).try_as<FrameworkElement>();
if (!cell || cell.ActualWidth() <= 0 || cell.ActualHeight() <= 0)
{
return std::nullopt;
}
const auto cellW = cell.ActualWidth();
const auto cellH = cell.ActualHeight();
// Cell center relative to ContentWrapper (accounts for scroll offset)
auto cellTransform = cell.TransformToVisual(wrapper);
auto topLeft = cellTransform.TransformPoint({ 0.0f, 0.0f });
const auto cellCX = static_cast<double>(topLeft.X) + cellW / 2.0;
const auto cellCY = static_cast<double>(topLeft.Y) + cellH / 2.0;
// Scale so the cell fits the viewport
const auto scale = std::min(vpW / cellW, vpH / cellH);
// With RenderTransformOrigin={0.5,0.5} the scale origin is the
// center of ContentWrapper. Translate so the cell center lands
// at the viewport center after scaling.
const auto translateX = (vpW / 2.0 - cellCX) * scale;
const auto translateY = (vpH / 2.0 - cellCY) * scale;
return std::tuple{ scale, translateX, translateY };
}
FrameworkElement OverviewPane::_BuildPreviewCell(const TerminalApp::Tab& tab, int32_t index, double referenceWidth, double referenceHeight)
{
// Outer border — serves as the selection indicator
Border outerBorder;
outerBorder.BorderBrush(SolidColorBrush{ winrt::Windows::UI::Colors::Transparent() });
outerBorder.BorderThickness(ThicknessHelper::FromUniformLength(2));
outerBorder.CornerRadius({ 8, 8, 8, 8 });
outerBorder.Padding(ThicknessHelper::FromUniformLength(4));
outerBorder.Margin(ThicknessHelper::FromUniformLength(6));
// Vertical stack: preview box + title
StackPanel cellStack;
cellStack.Orientation(Orientation::Vertical);
cellStack.HorizontalAlignment(HorizontalAlignment::Center);
// Preview container with a dark background
Border previewBorder;
previewBorder.Width(PreviewCellWidth);
previewBorder.Height(PreviewCellHeight);
previewBorder.CornerRadius({ 6, 6, 6, 6 });
auto bgBrush = Application::Current().Resources().TryLookup(winrt::box_value(L"SystemControlBackgroundChromeMediumBrush"));
if (bgBrush)
{
previewBorder.Background(bgBrush.as<Brush>());
}
else
{
previewBorder.Background(SolidColorBrush{ winrt::Windows::UI::ColorHelper::FromArgb(255, 30, 30, 30) });
}
// Get the tab's content and reparent it with a ScaleTransform
auto tabContent = tab.Content();
if (tabContent)
{
// Save the Width/Height *property* values (likely NaN for auto-sized
// elements). These differ from ActualWidth/Height (the rendered size).
// We need the property values to restore auto-sizing on exit.
const auto origWidthProp = tabContent.Width();
const auto origHeightProp = tabContent.Height();
const auto origRenderTransform = tabContent.RenderTransform();
const auto origRenderTransformOrigin = tabContent.RenderTransformOrigin();
// Use ActualWidth/Height if the content is currently laid out (active tab).
// Inactive tabs aren't in the visual tree and report zero — fall back
// to the reference size from the active tab's content area.
auto layoutWidth = tabContent.ActualWidth();
auto layoutHeight = tabContent.ActualHeight();
if (layoutWidth <= 0 || layoutHeight <= 0)
{
layoutWidth = referenceWidth;
layoutHeight = referenceHeight;
}
auto originalParent = VisualTreeHelper::GetParent(tabContent).try_as<Panel>();
// XAML single-parent rule: remove from current parent first
_DetachContent(tabContent);
// Lock the content to the layout size — this prevents
// TermControl from seeing a resize and reflowing its buffer
if (layoutWidth > 0 && layoutHeight > 0)
{
tabContent.Width(layoutWidth);
tabContent.Height(layoutHeight);
// Calculate uniform scale to fit in preview
const double previewWidth = PreviewCellWidth;
const double previewHeight = PreviewCellHeight;
const double scale = std::min(previewWidth / layoutWidth, previewHeight / layoutHeight);
// RenderTransform is applied AFTER layout — the content still
// thinks it's at its original size
ScaleTransform scaleTransform;
scaleTransform.ScaleX(scale);
scaleTransform.ScaleY(scale);
tabContent.RenderTransform(scaleTransform);
tabContent.RenderTransformOrigin({ 0.0f, 0.0f });
// Use a Canvas so the content is not constrained by the preview
// container's layout. Canvas gives children infinite measure
// space and arranges at desired size.
Canvas canvas;
canvas.Width(previewWidth);
canvas.Height(previewHeight);
// Clip to preview bounds so the scaled content doesn't overflow
RectangleGeometry clipGeometry;
clipGeometry.Rect({ 0, 0, static_cast<float>(previewWidth), static_cast<float>(previewHeight) });
canvas.Clip(clipGeometry);
canvas.Children().Append(tabContent);
// Layer the canvas behind a transparent overlay so
// pointer events never reach the TermControl content.
Grid previewGrid;
previewGrid.Children().Append(canvas);
Border inputOverlay;
inputOverlay.Background(SolidColorBrush{ winrt::Windows::UI::Colors::Transparent() });
previewGrid.Children().Append(inputOverlay);
previewBorder.Child(previewGrid);
}
_reparentedContent.push_back({ tabContent, originalParent, origWidthProp, origHeightProp, origRenderTransform, origRenderTransformOrigin });
}
cellStack.Children().Append(previewBorder);
// Tab title text
TextBlock titleBlock;
titleBlock.Text(tab.Title());
titleBlock.FontSize(14);
titleBlock.Foreground(SolidColorBrush{ winrt::Windows::UI::Colors::White() });
titleBlock.HorizontalAlignment(HorizontalAlignment::Center);
titleBlock.TextTrimming(TextTrimming::CharacterEllipsis);
titleBlock.MaxWidth(PreviewCellWidth);
titleBlock.Margin({ 0, 6, 0, 0 });
cellStack.Children().Append(titleBlock);
outerBorder.Child(cellStack);
// Click handler
outerBorder.PointerPressed([weakThis = get_weak(), index](auto&&, auto&&) {
if (auto self = weakThis.get())
{
self->_selectedIndex = index;
self->_UpdateSelection();
self->_OnItemClicked(index);
}
});
// Hover effect
outerBorder.PointerEntered([weakThis = get_weak(), index](auto&&, auto&&) {
if (auto self = weakThis.get())
{
self->_selectedIndex = index;
self->_UpdateSelection();
}
});
return outerBorder;
}
void OverviewPane::_AddDoubleAnimation(
const Storyboard& storyboard,
const CompositeTransform& target,
const hstring& property,
double from,
double to,
const Duration& duration,
const EasingFunctionBase& easing)
{
DoubleAnimation anim;
anim.From(from);
anim.To(to);
anim.Duration(duration);
anim.EasingFunction(easing);
Storyboard::SetTarget(anim, target);
Storyboard::SetTargetProperty(anim, property);
storyboard.Children().Append(anim);
}
void OverviewPane::_DetachContent(const FrameworkElement& content)
{
// Try removing from various XAML container types
if (auto parent = VisualTreeHelper::GetParent(content))
{
if (auto panel = parent.try_as<Panel>())
{
uint32_t idx;
if (panel.Children().IndexOf(content, idx))
{
panel.Children().RemoveAt(idx);
}
}
else if (auto border = parent.try_as<Border>())
{
border.Child(nullptr);
}
else if (auto contentControl = parent.try_as<ContentControl>())
{
contentControl.Content(nullptr);
}
else if (auto viewbox = parent.try_as<Viewbox>())
{
viewbox.Child(nullptr);
}
}
}
}

View File

@@ -0,0 +1,77 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
#include <limits>
#include <optional>
#include "OverviewPane.g.h"
namespace winrt::TerminalApp::implementation
{
struct OverviewPane : OverviewPaneT<OverviewPane>
{
OverviewPane();
~OverviewPane();
void UpdateTabContent(Windows::Foundation::Collections::IVector<TerminalApp::Tab> tabs, int32_t focusedIndex);
void ClearTabContent();
int32_t SelectedIndex() const;
void SelectedIndex(int32_t value);
bool UseMica() const;
void UseMica(bool value);
// Events
til::typed_event<Windows::Foundation::IInspectable, Windows::Foundation::IReference<int32_t>> TabSelected;
til::typed_event<> Dismissed;
private:
friend struct OverviewPaneT<OverviewPane>; // for Xaml to bind events
void _OnKeyDown(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::Input::KeyRoutedEventArgs& e);
void _OnPreviewKeyDown(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::Input::KeyRoutedEventArgs& e);
void _OnItemClicked(int32_t index);
void _UpdateSelection();
void _PlayEnterAnimation();
void _PlayExitAnimation(std::function<void()> onComplete = nullptr);
void _StartEnterZoomAnimation();
std::optional<std::tuple<double, double, double>> _GetZoomParamsForCell(int32_t index);
Windows::UI::Xaml::FrameworkElement _BuildPreviewCell(const TerminalApp::Tab& tab, int32_t index, double referenceWidth, double referenceHeight);
void _DetachContent(const Windows::UI::Xaml::FrameworkElement& content);
static void _AddDoubleAnimation(
const Windows::UI::Xaml::Media::Animation::Storyboard& storyboard,
const Windows::UI::Xaml::Media::CompositeTransform& target,
const hstring& property,
double from,
double to,
const Windows::UI::Xaml::Duration& duration,
const Windows::UI::Xaml::Media::Animation::EasingFunctionBase& easing);
int32_t _selectedIndex{ 0 };
int32_t _columnCount{ 3 }; // must match WrapGrid MaximumRowsOrColumns in OverviewPane.xaml
bool _pendingEnterAnimation{ false };
bool _useMica{ false };
void _UpdateBackgroundForMica();
winrt::event_token _exitAnimationToken{};
Windows::UI::Xaml::Media::Animation::Storyboard _exitContentStoryboard{ nullptr };
struct ReparentedEntry
{
Windows::UI::Xaml::FrameworkElement content{ nullptr };
Windows::UI::Xaml::Controls::Panel originalParent{ nullptr };
double originalWidth{ std::numeric_limits<double>::quiet_NaN() };
double originalHeight{ std::numeric_limits<double>::quiet_NaN() };
Windows::UI::Xaml::Media::Transform originalRenderTransform{ nullptr };
Windows::Foundation::Point originalRenderTransformOrigin{ 0.0f, 0.0f };
};
std::vector<ReparentedEntry> _reparentedContent;
};
}
namespace winrt::TerminalApp::factory_implementation
{
BASIC_FACTORY(OverviewPane);
}

View File

@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "Tab.idl";
namespace TerminalApp
{
[default_interface] runtimeclass OverviewPane : Windows.UI.Xaml.Controls.UserControl
{
OverviewPane();
void UpdateTabContent(Windows.Foundation.Collections.IVector<Tab> tabs, Int32 focusedIndex);
void ClearTabContent();
Int32 SelectedIndex;
Boolean UseMica;
event Windows.Foundation.TypedEventHandler<Object, Windows.Foundation.IReference<Int32> > TabSelected;
event Windows.Foundation.TypedEventHandler<Object, Object> Dismissed;
}
}

View File

@@ -0,0 +1,88 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<UserControl x:Class="TerminalApp.OverviewPane"
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:TerminalApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
AllowFocusOnInteraction="True"
IsTabStop="True"
KeyDown="_OnKeyDown"
PreviewKeyDown="_OnPreviewKeyDown"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<Storyboard x:Key="BackgroundFadeIn">
<DoubleAnimation Duration="0:0:0.2"
Storyboard.TargetName="BackgroundOverlay"
Storyboard.TargetProperty="Opacity"
From="0.0"
To="1.0">
<DoubleAnimation.EasingFunction>
<QuadraticEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Storyboard x:Key="BackgroundFadeOut">
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetName="BackgroundOverlay"
Storyboard.TargetProperty="Opacity"
From="1.0"
To="0.0">
<DoubleAnimation.EasingFunction>
<QuadraticEase EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</ResourceDictionary>
</UserControl.Resources>
<Grid x:Name="RootGrid"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<!-- Semi-transparent dark overlay -->
<Border x:Name="BackgroundOverlay"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{ThemeResource SmokeFillColorDefaultBrush}" />
<!-- Zoom-animated wrapper around the scrollable content -->
<Grid x:Name="ContentWrapper"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<CompositeTransform x:Name="ContentTransform" />
</Grid.RenderTransform>
<ScrollViewer x:Name="PreviewScrollViewer"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<!-- WrapGrid-style layout using ItemsControl with WrapGrid panel -->
<ItemsControl x:Name="PreviewGrid"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="24">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid HorizontalChildrenAlignment="Left"
ItemHeight="270"
ItemWidth="332"
MaximumRowsOrColumns="3"
Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</Grid>
</Grid>
</UserControl>

View File

@@ -496,12 +496,48 @@
<value>第三方通知</value>
<comment>A hyperlink name for the Terminal's third-party notices</comment>
</data>
<data name="ConfirmCloseDialog_Cancel" xml:space="preserve">
<value>取消</value>
</data>
<data name="ConfirmCloseDialog_CloseAllTitle" xml:space="preserve">
<value>是否要关闭所有窗口?</value>
</data>
<data name="ConfirmCloseDialog_CloseAllPrimary" xml:space="preserve">
<value>全部关闭</value>
</data>
<data name="ConfirmCloseDialog_WindowTitle" xml:space="preserve">
<value>是否要关闭所有标签页?</value>
</data>
<data name="ConfirmCloseDialog_WindowPrimary" xml:space="preserve">
<value>全部关闭</value>
</data>
<data name="ConfirmCloseDialog_TabTitle" xml:space="preserve">
<value>是否要关闭此选项卡?</value>
</data>
<data name="ConfirmCloseDialog_TabPrimary" xml:space="preserve">
<value>关闭选项卡</value>
</data>
<data name="ConfirmCloseDialog_PaneTitle" xml:space="preserve">
<value>是否要关闭此窗格?</value>
</data>
<data name="ConfirmCloseDialog_PanePrimary" xml:space="preserve">
<value>关闭窗格</value>
</data>
<data name="ConfirmCloseDialog_MultipleTabsTitle" xml:space="preserve">
<value>是否要关闭这些选项卡?</value>
</data>
<data name="ConfirmCloseDialog_MultipleTabsPrimary" xml:space="preserve">
<value>关闭选项卡</value>
</data>
<data name="ConfirmCloseDialog_MultiplePanesTitle" xml:space="preserve">
<value>是否要关闭这些窗格?</value>
</data>
<data name="ConfirmCloseDialog_MultiplePanesPrimary" xml:space="preserve">
<value>关闭窗格</value>
</data>
<data name="DontAskAgainCheckBox.Content" xml:space="preserve">
<value>不再询问</value>
</data>
<data name="CloseReadOnlyDialog.CloseButtonText" xml:space="preserve">
<value>取消</value>
</data>

View File

@@ -1131,6 +1131,13 @@ namespace winrt::TerminalApp::implementation
{
if (!_rearranging && !_removing)
{
// If the user clicked a tab in the tab row while the overview is
// open, the overview is still holding that tab's Content reparented
// into one of its preview cells. Tear down the overview visuals
// first so _UpdatedSelectedTab can mount the content into the
// active content area without hitting the XAML single-parent rule.
_DismissOverviewVisuals();
auto tabView = sender.as<MUX::Controls::TabView>();
auto selectedIndex = tabView.SelectedIndex();
if (selectedIndex >= 0 && selectedIndex < gsl::narrow_cast<int32_t>(_tabs.Size()))

View File

@@ -71,6 +71,9 @@
<Page Include="CommandPalette.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="OverviewPane.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="SuggestionsControl.xaml">
<SubType>Designer</SubType>
</Page>
@@ -132,6 +135,9 @@
<ClInclude Include="CommandPalette.h">
<DependentUpon>CommandPalette.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="OverviewPane.h">
<DependentUpon>OverviewPane.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="FilteredCommand.h" />
<ClInclude Include="Pane.h" />
<ClInclude Include="../fzf/fzf.h" />
@@ -243,6 +249,9 @@
<ClCompile Include="CommandPalette.cpp">
<DependentUpon>CommandPalette.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="OverviewPane.cpp">
<DependentUpon>OverviewPane.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="FilteredCommand.cpp" />
<ClCompile Include="Pane.cpp" />
<ClCompile Include="Pane.LayoutSizeNode.cpp" />
@@ -354,6 +363,10 @@
<DependentUpon>CommandPalette.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="OverviewPane.idl">
<DependentUpon>OverviewPane.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="SuggestionsControl.idl">
<DependentUpon>SuggestionsControl.xaml</DependentUpon>
<SubType>Code</SubType>

View File

@@ -1838,6 +1838,17 @@ namespace winrt::TerminalApp::implementation
return;
}
// If the overview pane is open, most actions mutate tab state whose
// Content() is currently reparented under the overview. Tear down the
// overview's visuals first so the content is back under its original
// parent before the action runs. ToggleOverview is the exception — it
// handles its own exit.
if (_isInOverviewMode &&
cmd.ActionAndArgs().Action() != ShortcutAction::ToggleOverview)
{
_DismissOverviewVisuals();
}
if (!_actionDispatch->DoAction(cmd.ActionAndArgs()))
{
return;
@@ -3307,13 +3318,15 @@ namespace winrt::TerminalApp::implementation
return true;
}
bool TerminalPage::_IsUriConsideredSomewhatSafe(const winrt::Windows::Foundation::Uri& parsedUri)
bool TerminalPage::_IsUriConsideredSomewhatSafe(const winrt::Windows::Foundation::Uri& parsedUri) const
{
if (parsedUri.SchemeName() == L"http" || parsedUri.SchemeName() == L"https")
const auto& schemeName = parsedUri.SchemeName();
if (schemeName == L"http" || schemeName == L"https")
{
return true;
}
if (parsedUri.SchemeName() == L"file")
if (schemeName == L"file")
{
static const auto pathext{ wil::TryGetEnvironmentVariableW<std::wstring>(L"PATHEXT") };
const auto filename = parsedUri.Path();
@@ -3327,6 +3340,16 @@ namespace winrt::TerminalApp::implementation
return true;
}
if (const auto& safeSchemes = _settings.GlobalSettings().SafeUriSchemes())
{
for (const auto& scheme : safeSchemes)
{
if (til::equals_insensitive_ascii(schemeName, scheme))
{
return true;
}
}
}
return false;
}
@@ -4257,6 +4280,120 @@ namespace winrt::TerminalApp::implementation
AlwaysOnTopChanged.raise(*this, nullptr);
}
void TerminalPage::ToggleOverview()
{
if (_isInOverviewMode)
{
_ExitOverview(std::nullopt);
}
else
{
_EnterOverview();
}
}
void TerminalPage::_EnterOverview()
{
_isInOverviewMode = true;
// Use FindName to lazily load the OverviewPane (same pattern as CommandPalette)
auto overview = FindName(L"OverviewPaneElement").try_as<OverviewPane>();
if (!overview)
{
return;
}
const auto focusedIdx = _GetFocusedTabIndex();
const auto idx = focusedIdx.has_value() ? static_cast<int32_t>(focusedIdx.value()) : 0;
// Wire up events to handle tab selection and dismissal
_overviewTabSelectedToken = overview.TabSelected([weakThis = get_weak()](auto&&, const auto& args) {
if (auto self = weakThis.get())
{
if (args)
{
self->_ExitOverview(static_cast<uint32_t>(args.Value()));
}
}
});
_overviewDismissedToken = overview.Dismissed([weakThis = get_weak()](auto&&, auto&&) {
if (auto self = weakThis.get())
{
self->_ExitOverview(std::nullopt);
}
});
// _tabs is already IObservableVector<Tab>, which inherits from IVector<Tab>
const auto theme = _settings.GlobalSettings().CurrentTheme();
const auto windowTheme = theme ? theme.Window() : nullptr;
overview.UseMica(windowTheme ? windowTheme.UseMica() : false);
overview.UpdateTabContent(_tabs, idx);
overview.Visibility(WUX::Visibility::Visible);
overview.Focus(WUX::FocusState::Programmatic);
}
void TerminalPage::_ExitOverview(const std::optional<uint32_t>& selectedIndex)
{
auto overview = FindName(L"OverviewPaneElement").try_as<OverviewPane>();
// Determine which tab to switch to. Prefer the explicitly passed index
// (from TabSelected event), but fall back to the overview pane's
// current selection — this covers ToggleOverview and Dismiss paths so
// the user always lands on whichever tab they navigated to.
std::optional<uint32_t> tabToSelect = selectedIndex;
if (!tabToSelect.has_value() && overview)
{
const auto overviewIdx = overview.SelectedIndex();
if (overviewIdx >= 0 && overviewIdx < static_cast<int32_t>(_tabs.Size()))
{
tabToSelect = static_cast<uint32_t>(overviewIdx);
}
}
_DismissOverviewVisuals();
if (tabToSelect.has_value())
{
_SelectTab(tabToSelect.value());
}
_UpdatedSelectedTab(_GetFocusedTab());
}
// Method Description:
// - Tears down the overview's reparented content and hides the overlay,
// without changing tab selection. Safe to call when not in overview mode.
// - Used by both _ExitOverview (which then selects a tab) and by
// _OnTabSelectionChanged (where the TabView has already updated the
// selection and we just need to release the reparented content before
// _UpdatedSelectedTab tries to mount it back into the content area).
void TerminalPage::_DismissOverviewVisuals()
{
if (!_isInOverviewMode)
{
return;
}
if (auto overview = FindName(L"OverviewPaneElement").try_as<OverviewPane>())
{
// Revoke event handlers to avoid stale callbacks
overview.TabSelected(_overviewTabSelectedToken);
overview.Dismissed(_overviewDismissedToken);
_overviewTabSelectedToken = {};
_overviewDismissedToken = {};
overview.ClearTabContent();
overview.Visibility(WUX::Visibility::Collapsed);
}
_isInOverviewMode = false;
}
bool TerminalPage::OverviewMode() const
{
return _isInOverviewMode;
}
// Method Description:
// - Sets the tab split button color when a new tab color is selected
// Arguments:

View File

@@ -138,9 +138,11 @@ namespace winrt::TerminalApp::implementation
void ToggleFocusMode();
void ToggleFullscreen();
void ToggleAlwaysOnTop();
void ToggleOverview();
bool FocusMode() const;
bool Fullscreen() const;
bool AlwaysOnTop() const;
bool OverviewMode() const;
bool ShowTabsFullscreen() const;
void SetShowTabsFullscreen(bool newShowTabsFullscreen);
void SetFullscreen(bool);
@@ -250,6 +252,9 @@ namespace winrt::TerminalApp::implementation
TerminalApp::Tab _settingsTab{ nullptr };
bool _isInFocusMode{ false };
bool _isInOverviewMode{ false };
winrt::event_token _overviewTabSelectedToken{};
winrt::event_token _overviewDismissedToken{};
bool _isFullscreen{ false };
bool _isMaximized{ false };
bool _isAlwaysOnTop{ false };
@@ -375,6 +380,9 @@ namespace winrt::TerminalApp::implementation
void _SelectNextTab(const bool bMoveRight, const Windows::Foundation::IReference<Microsoft::Terminal::Settings::Model::TabSwitcherMode>& customTabSwitcherMode);
bool _SelectTab(uint32_t tabIndex);
void _EnterOverview();
void _ExitOverview(const std::optional<uint32_t>& selectedIndex);
void _DismissOverviewVisuals();
bool _MoveFocus(const Microsoft::Terminal::Settings::Model::FocusDirection& direction);
bool _SwapPane(const Microsoft::Terminal::Settings::Model::FocusDirection& direction);
bool _MovePane(const Microsoft::Terminal::Settings::Model::MovePaneArgs args);
@@ -438,7 +446,7 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine _OpenHyperlinkHandler(const IInspectable sender, const Microsoft::Terminal::Control::OpenHyperlinkEventArgs eventArgs);
static bool _IsUriSupported(const winrt::Windows::Foundation::Uri& parsedUri);
static bool _IsUriConsideredSomewhatSafe(const winrt::Windows::Foundation::Uri& parsedUri);
bool _IsUriConsideredSomewhatSafe(const winrt::Windows::Foundation::Uri& parsedUri) const;
void _ShowCouldNotOpenDialog(winrt::hstring reason, winrt::hstring uri);
bool _CopyText(bool dismissSelection, bool singleLine, bool withControlSequences, Microsoft::Terminal::Control::CopyFormat formats);

View File

@@ -61,6 +61,7 @@ namespace TerminalApp
Boolean FocusMode { get; };
Boolean Fullscreen { get; };
Boolean AlwaysOnTop { get; };
Boolean OverviewMode { get; };
WindowProperties WindowProperties { get; };
void IdentifyWindow();

View File

@@ -155,6 +155,12 @@
</TextBlock>
</ContentDialog>
<local:OverviewPane x:Name="OverviewPaneElement"
Grid.Row="2"
x:Load="False"
PreviewKeyDown="_KeyDownHandler"
Visibility="Collapsed" />
<local:CommandPalette x:Name="CommandPaletteElement"
Grid.Row="2"
VerticalAlignment="Stretch"

View File

@@ -2906,6 +2906,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
else
{
// Yes, this is reachable: when a pane is split, the new TermControl
// is added to the XAML tree before its Loaded event fires, so
// _initializedTerminal is still false when layout queries MinimumSize().
// Return a small fallback — the real size will be used once initialized.
return { 10, 10 };
}
}

View File

@@ -98,7 +98,6 @@ void Terminal::UpdateSettings(ICoreSettings settings)
_answerbackMessage = settings.AnswerbackMessage();
_wordDelimiters = settings.WordDelimiters();
_suppressApplicationTitle = settings.SuppressApplicationTitle();
_startingTitle = settings.StartingTitle();
_trimBlockSelection = settings.TrimBlockSelection();
_autoMarkPrompts = settings.AutoMarkPrompts();
_rainbowSuggestions = settings.RainbowSuggestions();
@@ -124,6 +123,11 @@ void Terminal::UpdateSettings(ICoreSettings settings)
// Save the changes made above and in UpdateAppearance as the new default render settings.
GetRenderSettings().SaveDefaultSettings();
if (!_startingTitle)
{
_startingTitle = settings.StartingTitle();
}
if (!_startingTabColor && settings.StartingTabColor())
{
_startingTabColor = settings.StartingTabColor().Value();

View File

@@ -349,7 +349,7 @@ private:
::Microsoft::Console::VirtualTerminal::TerminalInput _terminalInput;
std::optional<std::wstring> _title;
std::wstring _startingTitle;
std::optional<std::wstring> _startingTitle;
std::optional<til::color> _startingTabColor;
std::vector<til::point_span> _searchHighlights;

View File

@@ -91,8 +91,12 @@ void Terminal::SetWindowTitle(const std::wstring_view title)
_assertLocked();
if (!_suppressApplicationTitle)
{
_title.emplace(title.empty() ? _startingTitle : title);
_pfnTitleChanged(_title.value());
_title.reset();
if (!title.empty())
{
_title.emplace(title);
}
_pfnTitleChanged(GetConsoleTitle());
}
}
@@ -112,6 +116,13 @@ bool Terminal::ResizeWindow(const til::CoordType width, const til::CoordType hei
return false;
}
const auto currentDimensions = _GetMutableViewport().Dimensions();
if (width == currentDimensions.width && height == currentDimensions.height)
{
return false;
}
if (_pfnWindowSizeChanged)
{
_pfnWindowSizeChanged(width, height);

View File

@@ -184,11 +184,18 @@ void Terminal::SelectNewRegion(const til::point coordStart, const til::point coo
std::wstring_view Terminal::GetConsoleTitle() const noexcept
{
_assertLocked();
if (_title.has_value())
if (_title)
{
return *_title;
}
return _startingTitle;
if (_startingTitle)
{
return *_startingTitle;
}
return {};
}
// Method Description:

View File

@@ -68,9 +68,9 @@
</UserControl.Resources>
<StackPanel>
<!-- Section: Typography settings -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Appearance_Section_Typography"
<!-- Grouping: Text -->
<TextBlock x:Uid="Profile_TextHeader"
Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Color Scheme -->
@@ -484,25 +484,13 @@
SelectedItem="{x:Bind CurrentAdjustIndistinguishableColors, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Intense is bold, bright -->
<local:SettingContainer x:Name="IntenseTextStyle"
x:Uid="Appearance_IntenseTextStyle"
ClearSettingValue="{x:Bind Appearance.ClearIntenseTextStyle}"
HasSettingValue="{x:Bind Appearance.HasIntenseTextStyle, Mode=OneWay}"
SettingOverrideSource="{x:Bind Appearance.IntenseTextStyleOverrideSource, Mode=OneWay}">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind IntenseTextStyleList, Mode=OneWay}"
SelectedItem="{x:Bind CurrentIntenseTextStyle, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Section: Cursor settings -->
<!-- Grouping: Cursor -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Appearance_Section_Cursor"
<TextBlock x:Uid="Profile_CursorHeader"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Cursor Shape -->
<local:SettingContainer x:Name="CursorShape"
x:Uid="Profile_CursorShape"
@@ -556,10 +544,11 @@
</local:SettingContainer>
</StackPanel>
<!-- Section: Background image -->
<!-- Grouping: Background -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Appearance_Section_BackgroundImage"
<TextBlock x:Uid="Profile_BackgroundHeader"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Background Image -->
<local:SettingContainer x:Name="BackgroundImageContainer"
x:Uid="Profile_BackgroundImage"
@@ -813,5 +802,24 @@
</local:SettingContainer>
</StackPanel>
<!-- Grouping: Text Formatting -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Appearance_TextFormattingHeader"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Intense is bold, bright -->
<local:SettingContainer x:Name="IntenseTextStyle"
x:Uid="Appearance_IntenseTextStyle"
ClearSettingValue="{x:Bind Appearance.ClearIntenseTextStyle}"
HasSettingValue="{x:Bind Appearance.HasIntenseTextStyle, Mode=OneWay}"
SettingOverrideSource="{x:Bind Appearance.IntenseTextStyleOverrideSource, Mode=OneWay}">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind IntenseTextStyleList, Mode=OneWay}"
SelectedItem="{x:Bind CurrentIntenseTextStyle, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
</StackPanel>
</StackPanel>
</UserControl>

View File

@@ -64,7 +64,6 @@
<local:ColorToBrushConverter x:Key="ColorToBrushConverter" />
<local:ColorToStringConverter x:Key="ColorToStringConverter" />
<mtu:StringNotEmptyToVisibilityConverter x:Key="StringNotEmptyToVisibilityConverter" />
<Color x:Key="DeleteButtonColor">Firebrick</Color>
@@ -1229,19 +1228,13 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0"
Padding="0,12,0,12"
VerticalAlignment="Center">
<ContentPresenter x:Name="ContentPresenter"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}" />
<TextBlock Style="{StaticResource SettingsPageItemDescriptionStyle}"
Text="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}"
Visibility="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource StringNotEmptyToVisibilityConverter}}" />
</StackPanel>
<ContentPresenter x:Name="ContentPresenter"
Grid.Column="0"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}" />
<FontIcon Grid.Column="1"
Margin="20,0,8,0"
HorizontalAlignment="Right"

View File

@@ -17,7 +17,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
INITIALIZE_BINDABLE_ENUM_SETTING(TextMeasurement, TextMeasurement, winrt::Microsoft::Terminal::Control::TextMeasurement, L"Globals_TextMeasurement_", L"Text");
INITIALIZE_BINDABLE_ENUM_SETTING(AmbiguousWidth, AmbiguousWidth, winrt::Microsoft::Terminal::Control::AmbiguousWidth, L"Globals_AmbiguousWidth_", L"Text");
INITIALIZE_BINDABLE_ENUM_SETTING(GraphicsAPI, GraphicsAPI, winrt::Microsoft::Terminal::Control::GraphicsAPI, L"Globals_GraphicsAPI_", L"Text");
}
bool CompatibilityViewModel::DebugFeaturesAvailable() const noexcept

View File

@@ -28,10 +28,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
GETSET_BINDABLE_ENUM_SETTING(TextMeasurement, winrt::Microsoft::Terminal::Control::TextMeasurement, _settings.GlobalSettings().TextMeasurement);
GETSET_BINDABLE_ENUM_SETTING(AmbiguousWidth, winrt::Microsoft::Terminal::Control::AmbiguousWidth, _settings.GlobalSettings().AmbiguousWidth);
GETSET_BINDABLE_ENUM_SETTING(GraphicsAPI, winrt::Microsoft::Terminal::Control::GraphicsAPI, _settings.GlobalSettings().GraphicsAPI);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_settings.GlobalSettings(), DisablePartialInvalidation);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_settings.GlobalSettings(), SoftwareRendering);
private:
Model::CascadiaSettings _settings;
};

View File

@@ -23,11 +23,6 @@ namespace Microsoft.Terminal.Settings.Editor
IInspectable CurrentAmbiguousWidth;
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> AmbiguousWidthList { get; };
IInspectable CurrentGraphicsAPI;
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> GraphicsAPIList { get; };
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, DisablePartialInvalidation);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SoftwareRendering);
}
[default_interface] runtimeclass Compatibility : Windows.UI.Xaml.Controls.Page

View File

@@ -25,117 +25,83 @@
</Page.Resources>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<!-- Section: Compatibility -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Compatibility_Section_Compatibility"
Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Allow Headless -->
<local:SettingContainer x:Name="AllowHeadless"
x:Uid="Globals_AllowHeadless">
<ToggleSwitch IsOn="{x:Bind ViewModel.AllowHeadless, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Allow Headless -->
<local:SettingContainer x:Name="AllowHeadless"
x:Uid="Globals_AllowHeadless">
<ToggleSwitch IsOn="{x:Bind ViewModel.AllowHeadless, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Text Measurement -->
<local:SettingContainer x:Name="TextMeasurement"
x:Uid="Globals_TextMeasurement">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.TextMeasurementList}"
SelectedItem="{x:Bind ViewModel.CurrentTextMeasurement, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Text Measurement -->
<local:SettingContainer x:Name="TextMeasurement"
x:Uid="Globals_TextMeasurement">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.TextMeasurementList}"
SelectedItem="{x:Bind ViewModel.CurrentTextMeasurement, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Ambiguous Width -->
<local:SettingContainer x:Name="AmbiguousWidth"
x:Uid="Globals_AmbiguousWidth">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.AmbiguousWidthList}"
SelectedItem="{x:Bind ViewModel.CurrentAmbiguousWidth, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Ambiguous Width -->
<local:SettingContainer x:Name="AmbiguousWidth"
x:Uid="Globals_AmbiguousWidth">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.AmbiguousWidthList}"
SelectedItem="{x:Bind ViewModel.CurrentAmbiguousWidth, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Debug Features -->
<local:SettingContainer x:Name="DebugFeaturesEnabled"
x:Uid="Globals_DebugFeaturesEnabled"
Visibility="{x:Bind ViewModel.DebugFeaturesAvailable}">
<ToggleSwitch IsOn="{x:Bind ViewModel.DebugFeaturesEnabled, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Debug Features -->
<local:SettingContainer x:Name="DebugFeaturesEnabled"
x:Uid="Globals_DebugFeaturesEnabled"
Visibility="{x:Bind ViewModel.DebugFeaturesAvailable}">
<ToggleSwitch IsOn="{x:Bind ViewModel.DebugFeaturesEnabled, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Reset Application State -->
<local:SettingContainer x:Name="ResetApplicationState"
x:Uid="Settings_ResetApplicationState">
<Button x:Uid="Settings_ResetApplicationStateButton"
Style="{StaticResource DeleteButtonStyle}">
<Button.Flyout>
<Flyout x:Name="ResetCacheFlyout"
FlyoutPresenterStyle="{StaticResource CustomFlyoutPresenterStyle}">
<StackPanel>
<TextBlock x:Uid="Settings_ResetApplicationStateConfirmationMessageHeader"
Style="{StaticResource CustomFlyoutTextStyle}" />
<TextBlock x:Uid="Settings_ResetApplicationStateConfirmationMessageBody"
FontWeight="Normal"
Style="{StaticResource CustomFlyoutTextStyle}" />
<Button x:Uid="Settings_ResetApplicationStateConfirmationButton"
Click="ResetApplicationStateButton_Click" />
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</local:SettingContainer>
<!-- Reset Application State -->
<local:SettingContainer x:Name="ResetApplicationState"
x:Uid="Settings_ResetApplicationState">
<Button x:Uid="Settings_ResetApplicationStateButton"
Style="{StaticResource DeleteButtonStyle}">
<Button.Flyout>
<Flyout x:Name="ResetCacheFlyout"
FlyoutPresenterStyle="{StaticResource CustomFlyoutPresenterStyle}">
<StackPanel>
<TextBlock x:Uid="Settings_ResetApplicationStateConfirmationMessageHeader"
Style="{StaticResource CustomFlyoutTextStyle}" />
<TextBlock x:Uid="Settings_ResetApplicationStateConfirmationMessageBody"
FontWeight="Normal"
Style="{StaticResource CustomFlyoutTextStyle}" />
<Button x:Uid="Settings_ResetApplicationStateConfirmationButton"
Click="ResetApplicationStateButton_Click" />
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</local:SettingContainer>
<!-- Reset to Default Settings -->
<local:SettingContainer x:Name="ResetToDefaultSettings"
x:Uid="Settings_ResetToDefaultSettings">
<Button x:Uid="Settings_ResetToDefaultSettingsButton"
Style="{StaticResource DeleteButtonStyle}">
<Button.Flyout>
<Flyout FlyoutPresenterStyle="{StaticResource CustomFlyoutPresenterStyle}">
<StackPanel>
<TextBlock x:Uid="Settings_ResetToDefaultSettingsConfirmationMessageHeader"
Style="{StaticResource CustomFlyoutTextStyle}" />
<TextBlock x:Uid="Settings_ResetToDefaultSettingsConfirmationMessageBody"
FontWeight="Normal"
Style="{StaticResource CustomFlyoutTextStyle}" />
<Button x:Uid="Settings_ResetToDefaultSettingsConfirmationButton"
Click="{x:Bind ViewModel.ResetToDefaultSettings}" />
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</local:SettingContainer>
</StackPanel>
<!-- Reset to Default Settings -->
<local:SettingContainer x:Name="ResetToDefaultSettings"
x:Uid="Settings_ResetToDefaultSettings">
<Button x:Uid="Settings_ResetToDefaultSettingsButton"
Style="{StaticResource DeleteButtonStyle}">
<Button.Flyout>
<Flyout FlyoutPresenterStyle="{StaticResource CustomFlyoutPresenterStyle}">
<StackPanel>
<TextBlock x:Uid="Settings_ResetToDefaultSettingsConfirmationMessageHeader"
Style="{StaticResource CustomFlyoutTextStyle}" />
<TextBlock x:Uid="Settings_ResetToDefaultSettingsConfirmationMessageBody"
FontWeight="Normal"
Style="{StaticResource CustomFlyoutTextStyle}" />
<Button x:Uid="Settings_ResetToDefaultSettingsConfirmationButton"
Click="{x:Bind ViewModel.ResetToDefaultSettings}" />
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</local:SettingContainer>
<!-- Section: Rendering -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Compatibility_Section_Rendering"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Graphics API -->
<local:SettingContainer x:Name="GraphicsAPI"
x:Uid="Globals_GraphicsAPI">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.GraphicsAPIList}"
SelectedItem="{x:Bind ViewModel.CurrentGraphicsAPI, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Disable Partial Invalidation -->
<local:SettingContainer x:Name="DisablePartialInvalidation"
x:Uid="Globals_DisablePartialInvalidation">
<ToggleSwitch IsOn="{x:Bind ViewModel.DisablePartialInvalidation, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Software Rendering -->
<local:SettingContainer x:Name="SoftwareRendering"
x:Uid="Globals_SoftwareRendering">
<ToggleSwitch IsOn="{x:Bind ViewModel.SoftwareRendering, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
</StackPanel>
</Page>

View File

@@ -27,152 +27,126 @@
</Page.Resources>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<!-- Section: Visual style -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Globals_Section_VisualStyle"
Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Theme -->
<local:SettingContainer x:Name="Theme"
x:Uid="Globals_Theme">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemsSource="{x:Bind ViewModel.ThemeList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentTheme, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="model:Theme">
<TextBlock Text="{x:Bind local:GlobalAppearanceViewModel.ThemeNameConverter((model:Theme)), Mode=OneWay}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Theme -->
<local:SettingContainer x:Name="Theme"
x:Uid="Globals_Theme">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemsSource="{x:Bind ViewModel.ThemeList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentTheme, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="model:Theme">
<TextBlock Text="{x:Bind local:GlobalAppearanceViewModel.ThemeNameConverter((model:Theme)), Mode=OneWay}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Show Acrylic in Tab Row -->
<local:SettingContainer x:Name="AcrylicTabRow"
x:Uid="Globals_AcrylicTabRow">
<ToggleSwitch IsOn="{x:Bind ViewModel.UseAcrylicInTabRow, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Position of new tab -->
<local:SettingContainer x:Name="NewTabPosition"
x:Uid="Globals_NewTabPosition">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.NewTabPositionList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentNewTabPosition, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Enable Unfocused Acrylic -->
<local:SettingContainer x:Name="EnableUnfocusedAcrylic"
x:Uid="Globals_EnableUnfocusedAcrylic">
<ToggleSwitch IsOn="{x:Bind ViewModel.EnableUnfocusedAcrylic, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show Titlebar -->
<local:SettingContainer x:Name="ShowTitlebar"
x:Uid="Globals_ShowTitlebar">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTabsInTitlebar, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}"
Toggled="{x:Bind ViewModel.ShowTitlebarToggled}" />
</local:SettingContainer>
<!-- Disable Animations -->
<!-- NOTE: the UID is "DisablePaneAnimationsReversed" not "DisablePaneAnimations". See GH#9124 for more details. -->
<local:SettingContainer x:Name="DisableAnimations"
x:Uid="Globals_DisableAnimationsReversed">
<ToggleSwitch IsOn="{x:Bind ViewModel.InvertedDisableAnimations, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Always show tabs -->
<local:SettingContainer x:Name="AlwaysShowTabs"
x:Uid="Globals_AlwaysShowTabs">
<ToggleSwitch IsEnabled="{x:Bind mtu:Converters.InvertBoolean(ViewModel.ShowTabsInTitlebar), Mode=OneWay}"
IsOn="{x:Bind ViewModel.AlwaysShowTabs, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: Tabs and layout -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Globals_Section_TabsLayout"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Position of new tab -->
<local:SettingContainer x:Name="NewTabPosition"
x:Uid="Globals_NewTabPosition">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.NewTabPositionList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentNewTabPosition, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Show tabs in full screen -->
<local:SettingContainer x:Name="ShowTabsFullscreen"
x:Uid="Globals_ShowTabsFullscreen">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTabsFullscreen, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Always show tabs -->
<local:SettingContainer x:Name="AlwaysShowTabs"
x:Uid="Globals_AlwaysShowTabs">
<ToggleSwitch IsEnabled="{x:Bind mtu:Converters.InvertBoolean(ViewModel.ShowTabsInTitlebar), Mode=OneWay}"
IsOn="{x:Bind ViewModel.AlwaysShowTabs, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show Acrylic in Tab Row -->
<local:SettingContainer x:Name="AcrylicTabRow"
x:Uid="Globals_AcrylicTabRow">
<ToggleSwitch IsOn="{x:Bind ViewModel.UseAcrylicInTabRow, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show tabs in full screen -->
<local:SettingContainer x:Name="ShowTabsFullscreen"
x:Uid="Globals_ShowTabsFullscreen">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTabsFullscreen, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show Title in Titlebar -->
<local:SettingContainer x:Name="ShowTitleInTitlebar"
x:Uid="Globals_ShowTitleInTitlebar">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTitleInTitlebar, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Tab Width Mode -->
<local:SettingContainer x:Name="TabWidthMode"
x:Uid="Globals_TabWidthMode">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.TabWidthModeList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentTabWidthMode, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Always on Top -->
<local:SettingContainer x:Name="AlwaysOnTop"
x:Uid="Globals_AlwaysOnTop">
<ToggleSwitch IsOn="{x:Bind ViewModel.AlwaysOnTop, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show Titlebar -->
<local:SettingContainer x:Name="ShowTitlebar"
x:Uid="Globals_ShowTitlebar">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTabsInTitlebar, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}"
Toggled="{x:Bind ViewModel.ShowTitlebarToggled}" />
</local:SettingContainer>
</StackPanel>
<!-- Tab Width Mode -->
<local:SettingContainer x:Name="TabWidthMode"
x:Uid="Globals_TabWidthMode">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.TabWidthModeList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentTabWidthMode, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Section: Window behavior -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Globals_Section_WindowBehavior"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Always on Top -->
<local:SettingContainer x:Name="AlwaysOnTop"
x:Uid="Globals_AlwaysOnTop">
<ToggleSwitch IsOn="{x:Bind ViewModel.AlwaysOnTop, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Disable Animations -->
<!-- NOTE: the UID is "DisablePaneAnimationsReversed" not "DisablePaneAnimations". See GH#9124 for more details. -->
<local:SettingContainer x:Name="DisableAnimations"
x:Uid="Globals_DisableAnimationsReversed">
<ToggleSwitch IsOn="{x:Bind ViewModel.InvertedDisableAnimations, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Automatically hide window -->
<local:SettingContainer x:Name="AutoHideWindow"
x:Uid="Globals_AutoHideWindow">
<ToggleSwitch IsOn="{x:Bind ViewModel.AutoHideWindow, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Always Show Notification Icon -->
<local:SettingContainer x:Name="AlwaysShowNotificationIcon"
x:Uid="Globals_AlwaysShowNotificationIcon">
<ToggleSwitch IsOn="{x:Bind ViewModel.AlwaysShowNotificationIcon, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: Title bar & identity -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Globals_Section_TitleBarIdentity"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Show Title in Titlebar (use active terminal title as application title) -->
<local:SettingContainer x:Name="ShowTitleInTitlebar"
x:Uid="Globals_ShowTitleInTitlebar">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTitleInTitlebar, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Minimize To Notification Area -->
<local:SettingContainer x:Name="MinimizeToNotificationArea"
x:Uid="Globals_MinimizeToNotificationArea">
<ToggleSwitch IsOn="{x:Bind ViewModel.MinimizeToNotificationArea, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show Admin Shield -->
<local:SettingContainer x:Name="ShowAdminShield"
x:Uid="Globals_ShowAdminShield">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowAdminShield, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Automatically hide window -->
<local:SettingContainer x:Name="AutoHideWindow"
x:Uid="Globals_AutoHideWindow">
<ToggleSwitch IsOn="{x:Bind ViewModel.AutoHideWindow, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: System integration & notifications -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Globals_Section_SystemIntegration"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Always Show Notification Icon -->
<local:SettingContainer x:Name="AlwaysShowNotificationIcon"
x:Uid="Globals_AlwaysShowNotificationIcon">
<ToggleSwitch IsOn="{x:Bind ViewModel.AlwaysShowNotificationIcon, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Show Admin Shield -->
<local:SettingContainer x:Name="ShowAdminShield"
x:Uid="Globals_ShowAdminShield">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowAdminShield, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Minimize To Notification Area -->
<local:SettingContainer x:Name="MinimizeToNotificationArea"
x:Uid="Globals_MinimizeToNotificationArea">
<ToggleSwitch IsOn="{x:Bind ViewModel.MinimizeToNotificationArea, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Enable Unfocused Acrylic -->
<local:SettingContainer x:Name="EnableUnfocusedAcrylic"
x:Uid="Globals_EnableUnfocusedAcrylic">
<ToggleSwitch IsOn="{x:Bind ViewModel.EnableUnfocusedAcrylic, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
</Page>

View File

@@ -26,173 +26,149 @@
<StackPanel>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<!-- Section: Clipboard and paste behavior -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Interaction_Section_Clipboard"
Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Copy On Select -->
<local:SettingContainer x:Name="CopyOnSelect"
x:Uid="Globals_CopyOnSelect">
<ToggleSwitch IsOn="{x:Bind ViewModel.CopyOnSelect, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Copy On Select -->
<local:SettingContainer x:Name="CopyOnSelect"
x:Uid="Globals_CopyOnSelect">
<ToggleSwitch IsOn="{x:Bind ViewModel.CopyOnSelect, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Trim Paste -->
<local:SettingContainer x:Name="TrimPaste"
x:Uid="Globals_TrimPaste">
<ToggleSwitch IsOn="{x:Bind ViewModel.TrimPaste, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Copy Format -->
<local:SettingContainer x:Name="CopyFormat"
x:Uid="Globals_CopyFormat">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.CopyFormatList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentCopyFormat, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Trim Block Selection -->
<local:SettingContainer x:Name="TrimBlockSelection"
x:Uid="Globals_TrimBlockSelection">
<ToggleSwitch IsOn="{x:Bind ViewModel.TrimBlockSelection, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Trim Block Selection -->
<local:SettingContainer x:Name="TrimBlockSelection"
x:Uid="Globals_TrimBlockSelection">
<ToggleSwitch IsOn="{x:Bind ViewModel.TrimBlockSelection, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Copy Format -->
<local:SettingContainer x:Name="CopyFormat"
x:Uid="Globals_CopyFormat">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.CopyFormatList, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.CurrentCopyFormat, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Trim Paste -->
<local:SettingContainer x:Name="TrimPaste"
x:Uid="Globals_TrimPaste">
<ToggleSwitch IsOn="{x:Bind ViewModel.TrimPaste, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: Text selection & editing -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Interaction_Section_TextSelection"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Word Delimiters -->
<local:SettingContainer x:Name="WordDelimiters"
x:Uid="Globals_WordDelimiters"
CurrentValue="{x:Bind ViewModel.WordDelimiters, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<TextBox IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind ViewModel.WordDelimiters, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Word Delimiters -->
<local:SettingContainer x:Name="WordDelimiters"
x:Uid="Globals_WordDelimiters"
CurrentValue="{x:Bind ViewModel.WordDelimiters, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<TextBox IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind ViewModel.WordDelimiters, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Enable Color Selection -->
<local:SettingContainer x:Name="EnableColorSelection"
x:Uid="Globals_EnableColorSelection">
<ToggleSwitch IsOn="{x:Bind ViewModel.EnableColorSelection, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Snap On Resize -->
<local:SettingContainer x:Name="SnapToGridOnResize"
x:Uid="Globals_SnapToGridOnResize">
<ToggleSwitch IsOn="{x:Bind ViewModel.SnapToGridOnResize, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: Window and layout behavior -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Interaction_Section_WindowLayout"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Snap On Resize -->
<local:SettingContainer x:Name="SnapToGridOnResize"
x:Uid="Globals_SnapToGridOnResize">
<ToggleSwitch IsOn="{x:Bind ViewModel.SnapToGridOnResize, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Tab Switcher Mode -->
<local:SettingContainer x:Name="TabSwitcherMode"
x:Uid="Globals_TabSwitcherMode">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.TabSwitcherModeList}"
SelectedItem="{x:Bind ViewModel.CurrentTabSwitcherMode, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Focus Follow Mouse Mode -->
<local:SettingContainer x:Name="FocusFollowMouse"
x:Uid="Globals_FocusFollowMouse">
<ToggleSwitch IsOn="{x:Bind ViewModel.FocusFollowMouse, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Focus Follow Mouse Mode -->
<local:SettingContainer x:Name="FocusFollowMouse"
x:Uid="Globals_FocusFollowMouse">
<ToggleSwitch IsOn="{x:Bind ViewModel.FocusFollowMouse, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Tab Switcher Mode -->
<local:SettingContainer x:Name="TabSwitcherMode"
x:Uid="Globals_TabSwitcherMode">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.TabSwitcherModeList}"
SelectedItem="{x:Bind ViewModel.CurrentTabSwitcherMode, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Enable Font Size Changes with Scrolling -->
<local:SettingContainer x:Name="ScrollToZoom"
x:Uid="Globals_ScrollToZoom">
<ToggleSwitch IsOn="{x:Bind ViewModel.ScrollToZoom, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: Mouse & scrolling -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Interaction_Section_MouseScrolling"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Enable Font Size Changes with Scrolling -->
<local:SettingContainer x:Name="ScrollToZoom"
x:Uid="Globals_ScrollToZoom">
<ToggleSwitch IsOn="{x:Bind ViewModel.ScrollToZoom, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Enable Window Opacity Changes with Scrolling -->
<local:SettingContainer x:Name="ScrollToChangeOpacity"
x:Uid="Globals_ScrollToChangeOpacity">
<ToggleSwitch IsOn="{x:Bind ViewModel.ScrollToChangeOpacity, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Enable Window Opacity Changes with Scrolling -->
<local:SettingContainer x:Name="ScrollToChangeOpacity"
x:Uid="Globals_ScrollToChangeOpacity">
<ToggleSwitch IsOn="{x:Bind ViewModel.ScrollToChangeOpacity, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Detect URLs -->
<local:SettingContainer x:Name="DetectURLs"
x:Uid="Globals_DetectURLs">
<ToggleSwitch IsOn="{x:Bind ViewModel.DetectURLs, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Section: URLs & external actions -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Interaction_Section_UrlsExternal"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Detect URLs -->
<local:SettingContainer x:Name="DetectURLs"
x:Uid="Globals_DetectURLs">
<ToggleSwitch IsOn="{x:Bind ViewModel.DetectURLs, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Search Web Default Query URL -->
<local:SettingContainer x:Name="SearchWebDefaultQueryUrl"
x:Uid="Globals_SearchWebDefaultQueryUrl"
CurrentValue="{x:Bind ViewModel.SearchWebDefaultQueryUrl, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<TextBox IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind ViewModel.SearchWebDefaultQueryUrl, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Search Web Default Query URL -->
<local:SettingContainer x:Name="SearchWebDefaultQueryUrl"
x:Uid="Globals_SearchWebDefaultQueryUrl"
CurrentValue="{x:Bind ViewModel.SearchWebDefaultQueryUrl, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<TextBox IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind ViewModel.SearchWebDefaultQueryUrl, Mode=TwoWay}" />
</local:SettingContainer>
</StackPanel>
<!-- Enable Color Selection -->
<local:SettingContainer x:Name="EnableColorSelection"
x:Uid="Globals_EnableColorSelection">
<ToggleSwitch IsOn="{x:Bind ViewModel.EnableColorSelection, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Section: Warnings -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Interaction_Section_Warnings"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Confirm Close On -->
<local:SettingContainer x:Name="ConfirmOnClose"
x:Uid="Globals_ConfirmOnClose">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.ConfirmOnCloseList}"
SelectedItem="{x:Bind ViewModel.CurrentConfirmOnClose, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<!-- Grouping: Warnings -->
<TextBlock x:Uid="Globals_WarningsHeader"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Input Service Warning -->
<local:SettingContainer x:Name="InputServiceWarning"
x:Uid="Globals_InputServiceWarning">
<ToggleSwitch IsOn="{x:Bind ViewModel.InputServiceWarning, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Confirm Close On -->
<local:SettingContainer x:Name="ConfirmOnClose"
x:Uid="Globals_ConfirmOnClose">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.ConfirmOnCloseList}"
SelectedItem="{x:Bind ViewModel.CurrentConfirmOnClose, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Large Paste Warning -->
<local:SettingContainer x:Name="WarnAboutLargePaste"
x:Uid="Globals_WarnAboutLargePaste">
<ToggleSwitch IsOn="{x:Bind ViewModel.WarnAboutLargePaste, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Input Service Warning -->
<local:SettingContainer x:Name="InputServiceWarning"
x:Uid="Globals_InputServiceWarning">
<ToggleSwitch IsOn="{x:Bind ViewModel.InputServiceWarning, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Large Paste Warning -->
<local:SettingContainer x:Name="WarnAboutLargePaste"
x:Uid="Globals_WarnAboutLargePaste">
<ToggleSwitch IsOn="{x:Bind ViewModel.WarnAboutLargePaste, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Multi Line Paste Warning -->
<local:SettingContainer x:Name="WarnAboutMultiLinePaste"
x:Uid="Globals_WarnAboutMultiLinePaste">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind WarnAboutMultiLinePasteList}"
SelectedItem="{x:Bind CurrentWarnAboutMultiLinePaste, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Multi Line Paste Warning -->
<local:SettingContainer x:Name="WarnAboutMultiLinePaste"
x:Uid="Globals_WarnAboutMultiLinePaste">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind WarnAboutMultiLinePasteList}"
SelectedItem="{x:Bind CurrentWarnAboutMultiLinePaste, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
</StackPanel>
</StackPanel>
</StackPanel>
</Page>

View File

@@ -43,290 +43,279 @@
<StackPanel>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<!-- Section: Launch behavior -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Launch_Section_LaunchBehavior"
Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Default Profile -->
<local:SettingContainer x:Name="DefaultProfile"
x:Uid="Globals_DefaultProfile">
<ComboBox ItemsSource="{x:Bind ViewModel.DefaultProfiles}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultProfile, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="SettingsModel:Profile">
<Grid HorizontalAlignment="Stretch"
ColumnSpacing="8">
<!-- Default Profile -->
<local:SettingContainer x:Name="DefaultProfile"
x:Uid="Globals_DefaultProfile">
<ComboBox ItemsSource="{x:Bind ViewModel.DefaultProfiles}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultProfile, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="SettingsModel:Profile">
<Grid HorizontalAlignment="Stretch"
ColumnSpacing="8">
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="16" />
<!-- profile name -->
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="16" />
<!-- profile name -->
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<IconSourceElement Grid.Column="0"
Width="16"
Height="16"
IconSource="{x:Bind mtu:IconPathConverter.IconSourceWUX(Icon.Resolved), Mode=OneTime}" />
<IconSourceElement Grid.Column="0"
Width="16"
Height="16"
IconSource="{x:Bind mtu:IconPathConverter.IconSourceWUX(Icon.Resolved), Mode=OneTime}" />
<TextBlock Grid.Column="1"
Text="{x:Bind Name}" />
<TextBlock Grid.Column="1"
Text="{x:Bind Name}" />
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- First Window Behavior -->
<local:SettingContainer x:Name="FirstWindowPreference"
x:Uid="Globals_FirstWindowPreference">
<ComboBox AutomationProperties.AccessibilityView="Content"
<!-- Default Terminal -->
<local:SettingContainer x:Name="DefaultTerminalDropdown"
x:Uid="Globals_DefaultTerminal"
x:Load="false">
<ComboBox x:Name="DefaultTerminal"
ItemsSource="{x:Bind ViewModel.DefaultTerminals}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultTerminal, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="SettingsModel:DefaultTerminal">
<Grid HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ColumnSpacing="8">
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="auto" />
<!-- terminal name and author -->
<ColumnDefinition Width="auto" />
<!-- version -->
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<!-- terminal name -->
<RowDefinition Height="auto" />
<!-- author and version -->
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<IconSourceElement Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Width="24"
Height="24"
VerticalAlignment="Center"
IconSource="{x:Bind mtu:IconPathConverter.IconSourceWUX(Icon), Mode=OneTime}" />
<TextBlock Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2"
VerticalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"
Text="{x:Bind Name}" />
<TextBlock Grid.Row="1"
Grid.Column="1"
AutomationProperties.AccessibilityView="Raw"
Style="{ThemeResource SecondaryTextBlockStyle}"
Text="{x:Bind Author}"
Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(Author)}" />
<TextBlock Grid.Row="1"
Grid.Column="2"
AutomationProperties.AccessibilityView="Raw"
Style="{ThemeResource SecondaryTextBlockStyle}"
Text="{x:Bind Version}"
Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(Version)}" />
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Language -->
<local:SettingContainer x:Name="Language"
x:Uid="Globals_Language">
<ComboBox ItemsSource="{x:Bind ViewModel.LanguageList}"
SelectedItem="{x:Bind ViewModel.CurrentLanguage, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="x:String">
<TextBlock Text="{x:Bind local:LaunchViewModel.LanguageDisplayConverter((x:String))}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Language -->
<local:SettingContainer x:Name="DefaultInputScope"
x:Uid="Globals_DefaultInputScope">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.DefaultInputScopeList}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultInputScope, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Start on User Login -->
<local:SettingContainer x:Name="StartOnUserLogin"
x:Uid="Globals_StartOnUserLogin"
HelpText="{x:Bind ViewModel.StartOnUserLoginStatefulHelpText, Mode=OneWay}"
Visibility="{x:Bind ViewModel.StartOnUserLoginAvailable, Mode=OneTime}">
<ToggleSwitch IsEnabled="{x:Bind ViewModel.StartOnUserLoginConfigurable, Mode=OneWay}"
IsOn="{x:Bind ViewModel.StartOnUserLogin, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- First Window Behavior -->
<local:SettingContainer x:Name="FirstWindowPreference"
x:Uid="Globals_FirstWindowPreference">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.FirstWindowPreferenceList}"
SelectedItem="{x:Bind ViewModel.CurrentFirstWindowPreference, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Windowing Behavior -->
<local:SettingContainer x:Name="WindowingBehavior"
x:Uid="Globals_WindowingBehavior">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.WindowingBehaviorList}"
SelectedItem="{x:Bind ViewModel.CurrentWindowingBehavior, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Launch Size -->
<local:SettingContainer x:Name="LaunchSize"
x:Uid="Globals_LaunchSize"
CurrentValue="{x:Bind ViewModel.LaunchSizeCurrentValue, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<Grid ColumnSpacing="12"
RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock x:Uid="Globals_InitialCols"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<muxc:NumberBox x:Uid="Globals_InitialColsBox"
Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Center"
Maximum="999"
Minimum="1"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialCols, Mode=TwoWay}" />
<TextBlock x:Uid="Globals_InitialRows"
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<muxc:NumberBox x:Uid="Globals_InitialRowsBox"
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Center"
Maximum="999"
Minimum="1"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialRows, Mode=TwoWay}" />
</Grid>
</local:SettingContainer>
<!-- Launch Parameters -->
<local:SettingContainer x:Name="LaunchParameters"
x:Uid="Globals_LaunchParameters"
CurrentValue="{x:Bind ViewModel.LaunchParametersCurrentValue, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<Grid RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock x:Uid="Globals_LaunchModeSetting"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center" />
<ComboBox x:Name="LaunchModeComboBox"
Grid.Row="0"
Grid.Column="1"
MinWidth="240"
AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.FirstWindowPreferenceList}"
SelectedItem="{x:Bind ViewModel.CurrentFirstWindowPreference, Mode=TwoWay}"
ItemsSource="{x:Bind ViewModel.LaunchModeList}"
SelectedItem="{x:Bind ViewModel.CurrentLaunchMode, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Windowing Behavior -->
<local:SettingContainer x:Name="WindowingBehavior"
x:Uid="Globals_WindowingBehavior">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.WindowingBehaviorList}"
SelectedItem="{x:Bind ViewModel.CurrentWindowingBehavior, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Start on User Login -->
<local:SettingContainer x:Name="StartOnUserLogin"
x:Uid="Globals_StartOnUserLogin"
HelpText="{x:Bind ViewModel.StartOnUserLoginStatefulHelpText, Mode=OneWay}"
Visibility="{x:Bind ViewModel.StartOnUserLoginAvailable, Mode=OneTime}">
<ToggleSwitch IsEnabled="{x:Bind ViewModel.StartOnUserLoginConfigurable, Mode=OneWay}"
IsOn="{x:Bind ViewModel.StartOnUserLogin, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Launch Parameters -->
<local:SettingContainer x:Name="LaunchParameters"
x:Uid="Globals_LaunchParameters"
CurrentValue="{x:Bind ViewModel.LaunchParametersCurrentValue, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<Grid RowSpacing="8">
<TextBlock x:Uid="Globals_LaunchPosition"
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center" />
<Grid Grid.Row="1"
Grid.Column="1"
ColumnSpacing="4">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Uid="Globals_LaunchModeSetting"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center" />
<ComboBox x:Name="LaunchModeComboBox"
Grid.Row="0"
Grid.Column="1"
MinWidth="240"
AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.LaunchModeList}"
SelectedItem="{x:Bind ViewModel.CurrentLaunchMode, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
<TextBlock x:Uid="Globals_LaunchPosition"
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center" />
<Grid Grid.Row="1"
Grid.Column="1"
ColumnSpacing="4">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Match the width of these NumberBoxes to the Width of the LaunchModeComboBox above minus the Grid's ColumnSpacing -->
<muxc:NumberBox x:Name="PosXBox"
x:Uid="Globals_InitialPosXBox"
Grid.Row="0"
Grid.Column="0"
Width="118"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchPositionNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosX, Mode=TwoWay}" />
<muxc:NumberBox x:Name="PosYBox"
x:Uid="Globals_InitialPosYBox"
Grid.Row="0"
Grid.Column="1"
Width="118"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchPositionNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosY, Mode=TwoWay}" />
<CheckBox x:Name="UseDefaultLaunchPositionCheckbox"
x:Uid="Globals_DefaultLaunchPositionCheckbox"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
IsChecked="{x:Bind ViewModel.UseDefaultLaunchPosition, Mode=TwoWay}" />
</Grid>
<TextBlock x:Uid="Globals_CenterOnLaunch"
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center" />
<ToggleSwitch x:Name="CenterOnLaunchToggle"
Grid.Row="2"
Grid.Column="1"
IsOn="{x:Bind ViewModel.CenterOnLaunch, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</Grid>
</local:SettingContainer>
<!-- Launch Size -->
<local:SettingContainer x:Name="LaunchSize"
x:Uid="Globals_LaunchSize"
CurrentValue="{x:Bind ViewModel.LaunchSizeCurrentValue, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<Grid ColumnSpacing="12"
RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock x:Uid="Globals_InitialCols"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<muxc:NumberBox x:Uid="Globals_InitialColsBox"
<!-- Match the width of these NumberBoxes to the Width of the LaunchModeComboBox above minus the Grid's ColumnSpacing -->
<muxc:NumberBox x:Name="PosXBox"
x:Uid="Globals_InitialPosXBox"
Grid.Row="0"
Grid.Column="0"
Width="118"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchPositionNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosX, Mode=TwoWay}" />
<muxc:NumberBox x:Name="PosYBox"
x:Uid="Globals_InitialPosYBox"
Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Center"
Maximum="999"
Minimum="1"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialCols, Mode=TwoWay}" />
<TextBlock x:Uid="Globals_InitialRows"
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<muxc:NumberBox x:Uid="Globals_InitialRowsBox"
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Center"
Maximum="999"
Minimum="1"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialRows, Mode=TwoWay}" />
Width="118"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchPositionNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosY, Mode=TwoWay}" />
<CheckBox x:Name="UseDefaultLaunchPositionCheckbox"
x:Uid="Globals_DefaultLaunchPositionCheckbox"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
IsChecked="{x:Bind ViewModel.UseDefaultLaunchPosition, Mode=TwoWay}" />
</Grid>
</local:SettingContainer>
</StackPanel>
<!-- Section: System & input defaults -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Launch_Section_SystemInputDefaults"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Default Terminal -->
<local:SettingContainer x:Name="DefaultTerminalDropdown"
x:Uid="Globals_DefaultTerminal"
x:Load="false">
<ComboBox x:Name="DefaultTerminal"
ItemsSource="{x:Bind ViewModel.DefaultTerminals}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultTerminal, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="SettingsModel:DefaultTerminal">
<Grid HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ColumnSpacing="8">
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="auto" />
<!-- terminal name and author -->
<ColumnDefinition Width="auto" />
<!-- version -->
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<!-- terminal name -->
<RowDefinition Height="auto" />
<!-- author and version -->
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<IconSourceElement Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Width="24"
Height="24"
VerticalAlignment="Center"
IconSource="{x:Bind mtu:IconPathConverter.IconSourceWUX(Icon), Mode=OneTime}" />
<TextBlock Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2"
VerticalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"
Text="{x:Bind Name}" />
<TextBlock Grid.Row="1"
Grid.Column="1"
AutomationProperties.AccessibilityView="Raw"
Style="{ThemeResource SecondaryTextBlockStyle}"
Text="{x:Bind Author}"
Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(Author)}" />
<TextBlock Grid.Row="1"
Grid.Column="2"
AutomationProperties.AccessibilityView="Raw"
Style="{ThemeResource SecondaryTextBlockStyle}"
Text="{x:Bind Version}"
Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(Version)}" />
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Language -->
<local:SettingContainer x:Name="Language"
x:Uid="Globals_Language">
<ComboBox ItemsSource="{x:Bind ViewModel.LanguageList}"
SelectedItem="{x:Bind ViewModel.CurrentLanguage, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="x:String">
<TextBlock Text="{x:Bind local:LaunchViewModel.LanguageDisplayConverter((x:String))}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Default IME Input Mode -->
<local:SettingContainer x:Name="DefaultInputScope"
x:Uid="Globals_DefaultInputScope">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.DefaultInputScopeList}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultInputScope, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
</StackPanel>
<TextBlock x:Uid="Globals_CenterOnLaunch"
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center" />
<ToggleSwitch x:Name="CenterOnLaunchToggle"
Grid.Row="2"
Grid.Column="1"
IsOn="{x:Bind ViewModel.CenterOnLaunch, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</Grid>
</local:SettingContainer>
</StackPanel>
</StackPanel>
</Page>

View File

@@ -7,6 +7,8 @@
#include "Launch.h"
#include "Interaction.h"
#include "Compatibility.h"
#include "Rendering.h"
#include "RenderingViewModel.h"
#include "Extensions.h"
#include "Actions.h"
#include "ProfileViewModel.h"
@@ -552,6 +554,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
contentFrame().Navigate(xaml_typename<Editor::Interaction>(), winrt::make<NavigateToPageArgs>(winrt::make<InteractionViewModel>(_settingsClone.GlobalSettings()), *this, elementToFocus));
_breadcrumbs.Append(winrt::make<Breadcrumb>(vm, RS_(L"Nav_Interaction/Content"), BreadcrumbSubPage::None));
}
else if (*clickedItemTag == renderingTag)
{
contentFrame().Navigate(xaml_typename<Editor::Rendering>(), winrt::make<NavigateToPageArgs>(winrt::make<RenderingViewModel>(_settingsClone), *this, elementToFocus));
_breadcrumbs.Append(winrt::make<Breadcrumb>(vm, RS_(L"Nav_Rendering/Content"), BreadcrumbSubPage::None));
}
else if (*clickedItemTag == compatibilityTag)
{
contentFrame().Navigate(xaml_typename<Editor::Compatibility>(), winrt::make<NavigateToPageArgs>(winrt::make<CompatibilityViewModel>(_settingsClone), *this, elementToFocus));

View File

@@ -167,6 +167,10 @@
Tag="ColorSchemes_Nav" />
<muxc:NavigationViewItem x:Name="RenderingNavItem"
x:Uid="Nav_Rendering"
Tag="Rendering_Nav" />
<muxc:NavigationViewItem x:Name="CompatibilityNavItem"
x:Uid="Nav_Compatibility"
Tag="Compatibility_Nav" />

View File

@@ -119,6 +119,10 @@
<DependentUpon>ColorSchemesPageViewModel.idl</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="RenderingViewModel.h">
<DependentUpon>RenderingViewModel.idl</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="InteractionViewModel.h">
<DependentUpon>InteractionViewModel.idl</DependentUpon>
<SubType>Code</SubType>
@@ -163,6 +167,9 @@
<DependentUpon>Appearances.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="Rendering.h">
<DependentUpon>Rendering.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="SettingContainer.h">
<DependentUpon>SettingContainer.idl</DependentUpon>
</ClInclude>
@@ -239,6 +246,9 @@
<Page Include="Appearances.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Rendering.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="SettingContainerStyle.xaml">
<Type>DefaultStyle</Type>
</Page>
@@ -321,6 +331,10 @@
<DependentUpon>ColorSchemesPageViewModel.idl</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="RenderingViewModel.cpp">
<DependentUpon>RenderingViewModel.idl</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="InteractionViewModel.cpp">
<DependentUpon>InteractionViewModel.idl</DependentUpon>
<SubType>Code</SubType>
@@ -365,6 +379,9 @@
<DependentUpon>Appearances.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="Rendering.cpp">
<DependentUpon>Rendering.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="SettingContainer.cpp">
<DependentUpon>SettingContainer.idl</DependentUpon>
</ClCompile>
@@ -426,6 +443,10 @@
<DependentUpon>Compatibility.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Rendering.idl">
<DependentUpon>Rendering.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="SearchIndex.idl" />
<Midl Include="MainPage.idl">
<DependentUpon>MainPage.xaml</DependentUpon>
@@ -435,6 +456,7 @@
<Midl Include="TerminalColorConverters.idl" />
<Midl Include="ColorSchemeViewModel.idl" />
<Midl Include="ColorSchemesPageViewModel.idl" />
<Midl Include="RenderingViewModel.idl" />
<Midl Include="InteractionViewModel.idl" />
<Midl Include="GlobalAppearanceViewModel.idl" />
<Midl Include="LaunchViewModel.idl" />

View File

@@ -24,6 +24,7 @@
<Midl Include="ActionsViewModel.idl" />
<Midl Include="ColorSchemeViewModel.idl" />
<Midl Include="ColorSchemesPageViewModel.idl" />
<Midl Include="RenderingViewModel.idl" />
<Midl Include="InteractionViewModel.idl" />
<Midl Include="GlobalAppearanceViewModel.idl" />
<Midl Include="LaunchViewModel.idl" />
@@ -47,6 +48,7 @@
<Page Include="Profiles_Advanced.xaml" />
<Page Include="Profiles_Appearance.xaml" />
<Page Include="Appearances.xaml" />
<Page Include="Rendering.xaml" />
<Page Include="Actions.xaml" />
<Page Include="EditAction.xaml" />
<Page Include="SettingContainerStyle.xaml" />

View File

@@ -12,6 +12,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
inline constexpr std::wstring_view openJsonTag{ L"OpenJson_Nav" };
inline constexpr std::wstring_view launchTag{ L"Launch_Nav" };
inline constexpr std::wstring_view interactionTag{ L"Interaction_Nav" };
inline constexpr std::wstring_view renderingTag{ L"Rendering_Nav" };
inline constexpr std::wstring_view compatibilityTag{ L"Compatibility_Nav" };
inline constexpr std::wstring_view actionsTag{ L"Actions_Nav" };
inline constexpr std::wstring_view newTabMenuTag{ L"NewTabMenu_Nav" };
@@ -27,6 +28,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
std::pair{ interactionTag, L"\xE7C9" }, /* Touch Pointer */
std::pair{ globalAppearanceTag, L"\xE771" }, /* Personalize */
std::pair{ colorSchemesTag, L"\xE790" }, /* Color */
std::pair{ renderingTag, L"\xE7F8" }, /* Device Laptop No Pic */
std::pair{ compatibilityTag, L"\xEC7A" }, /* Developer Tools */
std::pair{ actionsTag, L"\xE765" }, /* Keyboard Classic */
std::pair{ newTabMenuTag, L"\xE71D" }, /* All Apps */

View File

@@ -127,10 +127,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
_NotifyChanges(L"TabColorPreview");
}
else if (viewModelProperty == L"Name" || viewModelProperty == L"IsBaseLayer")
{
_NotifyChanges(L"SectionHeaderText");
}
});
_defaultAppearanceViewModel.PropertyChanged([this](auto&&, const PropertyChangedEventArgs& args) {
@@ -361,15 +357,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
return RS_(L"Profile_TabTitleNone");
}
hstring ProfileViewModel::SectionHeaderText() const
{
if (IsBaseLayer())
{
return RS_(L"Profile_DefaultsSectionHeader");
}
return hstring{ RS_fmt(L"Profile_NameSectionHeaderFormat", Name()) };
}
hstring ProfileViewModel::AnswerbackMessagePreview() const
{
if (const auto answerbackMessage{ AnswerbackMessage() }; !answerbackMessage.empty())

View File

@@ -100,7 +100,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
bool AutoMarkPromptsAvailable() const noexcept;
bool RepositionCursorWithMouseAvailable() const noexcept;
hstring SectionHeaderText() const;
bool Orphaned() const;
hstring TabTitlePreview() const;
hstring AnswerbackMessagePreview() const;

View File

@@ -105,7 +105,6 @@ namespace Microsoft.Terminal.Settings.Editor
void CreateUnfocusedAppearance();
void DeleteUnfocusedAppearance();
String SectionHeaderText { get; };
Boolean Orphaned { get; };
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Name);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, Guid);

View File

@@ -80,10 +80,11 @@
SourceProfile="{x:Bind Profile, Mode=OneWay}"
WindowRoot="{x:Bind WindowRoot, Mode=OneTime}" />
<!-- Section: Window settings -->
<!-- Grouping: Transparency -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Profile_Section_Window"
<TextBlock x:Uid="Profile_TransparencyHeader"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Opacity -->
<local:SettingContainer x:Name="Opacity"
x:Uid="Profile_Opacity"
@@ -116,6 +117,13 @@
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Grouping: Window -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Profile_WindowHeader"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Padding -->
<local:SettingContainer x:Name="Padding"
x:Uid="Profile_Padding"

View File

@@ -23,9 +23,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
Automation::AutomationProperties::SetName(DeleteButton(), RS_(L"Profile_DeleteButton/Text"));
AppearanceNavigator().Content(box_value(RS_(L"Profile_Appearance/Header")));
AppearanceNavigator().Tag(box_value(RS_(L"Profile_AppearanceNavigator/HelpText")));
TerminalNavigator().Content(box_value(RS_(L"Profile_Terminal/Header")));
TerminalNavigator().Tag(box_value(RS_(L"Profile_TerminalNavigator/HelpText")));
AdvancedNavigator().Content(box_value(RS_(L"Profile_Advanced/Header")));
}

View File

@@ -34,157 +34,146 @@
<StackPanel Grid.Row="1"
Style="{StaticResource SettingsStackStyle}">
<!-- Section: {Profile.Name} profile (or "Profile defaults") -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}"
Text="{x:Bind Profile.SectionHeaderText, Mode=OneWay}" />
<!-- Name -->
<!--
NOTE: Has/Clear is not bound because we don't want the reset button & override text to appear.
Additionally, the JSON stubs generated by auto-generated profiles come with a name,
so the name will always be overridden.
-->
<local:SettingContainer x:Name="Name"
x:Uid="Profile_Name"
CurrentValue="{x:Bind Profile.Name, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.IsBaseLayer), Mode=OneWay}">
<TextBox Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.Name, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Name -->
<!--
NOTE: Has/Clear is not bound because we don't want the reset button & override text to appear.
Additionally, the JSON stubs generated by auto-generated profiles come with a name,
so the name will always be overridden.
-->
<local:SettingContainer x:Name="Name"
x:Uid="Profile_Name"
CurrentValue="{x:Bind Profile.Name, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.IsBaseLayer), Mode=OneWay}">
<TextBox Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.Name, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Commandline -->
<local:SettingContainer x:Name="Commandline"
x:Uid="Profile_Commandline"
ClearSettingValue="{x:Bind Profile.ClearCommandline}"
CurrentValue="{x:Bind Profile.Commandline, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasCommandline, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.CommandlineOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.IsBaseLayer), Mode=OneWay}">
<StackPanel>
<TextBox x:Uid="Profile_CommandlineBox"
IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.Commandline, Mode=TwoWay}" />
<Button x:Uid="Profile_CommandlineBrowse"
Margin="0,8,0,0"
Click="Commandline_Click"
<!-- Commandline -->
<local:SettingContainer x:Name="Commandline"
x:Uid="Profile_Commandline"
ClearSettingValue="{x:Bind Profile.ClearCommandline}"
CurrentValue="{x:Bind Profile.Commandline, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasCommandline, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.CommandlineOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.IsBaseLayer), Mode=OneWay}">
<StackPanel>
<TextBox x:Uid="Profile_CommandlineBox"
IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.Commandline, Mode=TwoWay}" />
<Button x:Uid="Profile_CommandlineBrowse"
Margin="0,8,0,0"
Click="Commandline_Click"
Style="{StaticResource BrowseButtonStyle}" />
</StackPanel>
</local:SettingContainer>
<!-- Starting Directory -->
<local:SettingContainer x:Name="StartingDirectory"
x:Uid="Profile_StartingDirectory"
ClearSettingValue="{x:Bind Profile.ClearStartingDirectory}"
CurrentValue="{x:Bind Profile.CurrentStartingDirectoryPreview, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasStartingDirectory, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.StartingDirectoryOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<StackPanel Orientation="Vertical">
<TextBox x:Uid="Profile_StartingDirectoryBox"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(Profile.UseParentProcessDirectory), Mode=OneWay}"
IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.StartingDirectory, Mode=TwoWay}" />
<StackPanel Orientation="Horizontal">
<Button x:Name="StartingDirectoryBrowse"
x:Uid="Profile_StartingDirectoryBrowse"
Margin="0,12,12,0"
Click="StartingDirectory_Click"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(Profile.UseParentProcessDirectory), Mode=OneWay}"
Style="{StaticResource BrowseButtonStyle}" />
<CheckBox x:Name="StartingDirectoryUseParentCheckbox"
x:Uid="Profile_StartingDirectoryUseParentCheckbox"
Margin="0,4,0,0"
IsChecked="{x:Bind Profile.UseParentProcessDirectory, Mode=TwoWay}" />
</StackPanel>
</local:SettingContainer>
</StackPanel>
</local:SettingContainer>
<!-- Starting Directory -->
<local:SettingContainer x:Name="StartingDirectory"
x:Uid="Profile_StartingDirectory"
ClearSettingValue="{x:Bind Profile.ClearStartingDirectory}"
CurrentValue="{x:Bind Profile.CurrentStartingDirectoryPreview, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasStartingDirectory, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.StartingDirectoryOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<StackPanel Orientation="Vertical">
<TextBox x:Uid="Profile_StartingDirectoryBox"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(Profile.UseParentProcessDirectory), Mode=OneWay}"
IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.StartingDirectory, Mode=TwoWay}" />
<StackPanel Orientation="Horizontal">
<Button x:Name="StartingDirectoryBrowse"
x:Uid="Profile_StartingDirectoryBrowse"
Margin="0,12,12,0"
Click="StartingDirectory_Click"
IsEnabled="{x:Bind mtu:Converters.InvertBoolean(Profile.UseParentProcessDirectory), Mode=OneWay}"
Style="{StaticResource BrowseButtonStyle}" />
<CheckBox x:Name="StartingDirectoryUseParentCheckbox"
x:Uid="Profile_StartingDirectoryUseParentCheckbox"
Margin="0,4,0,0"
IsChecked="{x:Bind Profile.UseParentProcessDirectory, Mode=TwoWay}" />
</StackPanel>
</StackPanel>
</local:SettingContainer>
<!-- Icon -->
<local:SettingContainer x:Name="Icon"
x:Uid="Profile_Icon"
ClearSettingValue="{x:Bind Profile.ClearIcon}"
CurrentValueAccessibleName="{x:Bind Profile.LocalizedIcon, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasIcon, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.IconOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyleWithComplexPreview}">
<local:SettingContainer.CurrentValue>
<Grid>
<ContentControl Width="16"
Height="16"
Content="{x:Bind Profile.IconPreview, Mode=OneWay}"
IsTabStop="False"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.UsingNoIcon), Mode=OneWay}" />
<TextBlock Margin="0,0,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
Style="{StaticResource SettingsPageItemDescriptionStyle}"
Text="{x:Bind Profile.LocalizedIcon, Mode=OneWay}"
Visibility="{x:Bind Profile.UsingNoIcon, Mode=OneWay}" />
</Grid>
</local:SettingContainer.CurrentValue>
<local:SettingContainer.Content>
<local:IconPicker CurrentIconPath="{x:Bind Profile.IconPath, Mode=TwoWay}"
WindowRoot="{x:Bind WindowRoot, Mode=OneWay}" />
</local:SettingContainer.Content>
</local:SettingContainer>
<!-- Elevate -->
<local:SettingContainer x:Name="Elevate"
x:Uid="Profile_Elevate"
ClearSettingValue="{x:Bind Profile.ClearElevate}"
HasSettingValue="{x:Bind Profile.HasElevate, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.ElevateOverrideSource, Mode=OneWay}">
<ToggleSwitch IsOn="{x:Bind Profile.Elevate, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Tab Title -->
<local:SettingContainer x:Name="TabTitle"
x:Uid="Profile_TabTitle"
ClearSettingValue="{x:Bind Profile.ClearTabTitle}"
CurrentValue="{x:Bind Profile.TabTitlePreview, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasTabTitle, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.TabTitleOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<TextBox Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.TabTitle, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Section: Visual/UI Affordance -->
<StackPanel Style="{StaticResource PivotStackStyle}">
<TextBlock x:Uid="Profile_Section_VisualUI"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Tab Title -->
<local:SettingContainer x:Name="TabTitle"
x:Uid="Profile_TabTitle"
ClearSettingValue="{x:Bind Profile.ClearTabTitle}"
CurrentValue="{x:Bind Profile.TabTitlePreview, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasTabTitle, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.TabTitleOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyle}">
<TextBox Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.TabTitle, Mode=TwoWay}" />
</local:SettingContainer>
<!-- Tab Color -->
<local:SettingContainer x:Name="TabColor"
x:Uid="Profile_TabColor"
ClearSettingValue="{x:Bind Profile.ClearTabColor}"
CurrentValue="{x:Bind Profile.TabColorPreview, Mode=OneWay}"
CurrentValueAccessibleName="{x:Bind Profile.TabColorPreview, Converter={StaticResource ColorToStringConverter}, Mode=OneWay}"
CurrentValueTemplate="{StaticResource ColorPreviewTemplate}"
HasSettingValue="{x:Bind Profile.HasTabColor, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.TabColorOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyleWithComplexPreview}">
<local:NullableColorPicker x:Uid="Profile_TabColor_NullableColorPicker"
ColorSchemeVM="{x:Bind Profile.DefaultAppearance.CurrentColorScheme, Mode=OneWay}"
CurrentColor="{x:Bind Profile.TabColor, Mode=TwoWay}"
NullColorPreview="{x:Bind Profile.TabThemeColorPreview, Mode=OneWay}" />
</local:SettingContainer>
<!-- Tab Color -->
<local:SettingContainer x:Name="TabColor"
x:Uid="Profile_TabColor"
ClearSettingValue="{x:Bind Profile.ClearTabColor}"
CurrentValue="{x:Bind Profile.TabColorPreview, Mode=OneWay}"
CurrentValueAccessibleName="{x:Bind Profile.TabColorPreview, Converter={StaticResource ColorToStringConverter}, Mode=OneWay}"
CurrentValueTemplate="{StaticResource ColorPreviewTemplate}"
HasSettingValue="{x:Bind Profile.HasTabColor, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.TabColorOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyleWithComplexPreview}">
<local:NullableColorPicker x:Uid="Profile_TabColor_NullableColorPicker"
ColorSchemeVM="{x:Bind Profile.DefaultAppearance.CurrentColorScheme, Mode=OneWay}"
CurrentColor="{x:Bind Profile.TabColor, Mode=TwoWay}"
NullColorPreview="{x:Bind Profile.TabThemeColorPreview, Mode=OneWay}" />
</local:SettingContainer>
<!-- Elevate -->
<local:SettingContainer x:Name="Elevate"
x:Uid="Profile_Elevate"
ClearSettingValue="{x:Bind Profile.ClearElevate}"
HasSettingValue="{x:Bind Profile.HasElevate, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.ElevateOverrideSource, Mode=OneWay}">
<ToggleSwitch IsOn="{x:Bind Profile.Elevate, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<!-- Icon -->
<local:SettingContainer x:Name="Icon"
x:Uid="Profile_Icon"
ClearSettingValue="{x:Bind Profile.ClearIcon}"
CurrentValueAccessibleName="{x:Bind Profile.LocalizedIcon, Mode=OneWay}"
HasSettingValue="{x:Bind Profile.HasIcon, Mode=OneWay}"
SettingOverrideSource="{x:Bind Profile.IconOverrideSource, Mode=OneWay}"
Style="{StaticResource ExpanderSettingContainerStyleWithComplexPreview}">
<local:SettingContainer.CurrentValue>
<Grid>
<ContentControl Width="16"
Height="16"
Content="{x:Bind Profile.IconPreview, Mode=OneWay}"
IsTabStop="False"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.UsingNoIcon), Mode=OneWay}" />
<TextBlock Margin="0,0,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
Style="{StaticResource SettingsPageItemDescriptionStyle}"
Text="{x:Bind Profile.LocalizedIcon, Mode=OneWay}"
Visibility="{x:Bind Profile.UsingNoIcon, Mode=OneWay}" />
</Grid>
</local:SettingContainer.CurrentValue>
<local:SettingContainer.Content>
<local:IconPicker CurrentIconPath="{x:Bind Profile.IconPath, Mode=TwoWay}"
WindowRoot="{x:Bind WindowRoot, Mode=OneWay}" />
</local:SettingContainer.Content>
</local:SettingContainer>
<!-- Hidden -->
<local:SettingContainer x:Name="Hidden"
x:Uid="Profile_Hidden"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.IsBaseLayer), Mode=OneWay}">
<ToggleSwitch IsOn="{x:Bind Profile.Hidden, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
<!-- Hidden -->
<local:SettingContainer x:Name="Hidden"
x:Uid="Profile_Hidden"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.IsBaseLayer), Mode=OneWay}">
<ToggleSwitch IsOn="{x:Bind Profile.Hidden, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<TextBlock x:Uid="Profile_AdditionalSettingsHeader"
Margin="0,32,0,4"

View File

@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "Rendering.h"
#include "Rendering.g.cpp"
using namespace winrt::Windows::UI::Xaml::Navigation;
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
Rendering::Rendering()
{
InitializeComponent();
}
void Rendering::OnNavigatedTo(const NavigationEventArgs& e)
{
const auto args = e.Parameter().as<Editor::NavigateToPageArgs>();
_ViewModel = args.ViewModel().as<Editor::RenderingViewModel>();
BringIntoViewWhenLoaded(args.ElementToFocus());
TraceLoggingWrite(
g_hTerminalSettingsEditorProvider,
"NavigatedToPage",
TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"),
TraceLoggingValue("rendering", "PageId", "The identifier of the page that was navigated to"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}
}

View File

@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
#include "Rendering.g.h"
#include "Utils.h"
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
struct Rendering : public HasScrollViewer<Rendering>, RenderingT<Rendering>
{
Rendering();
void OnNavigatedTo(const winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs& e);
til::property_changed_event PropertyChanged;
WINRT_OBSERVABLE_PROPERTY(Editor::RenderingViewModel, ViewModel, PropertyChanged.raise, nullptr);
};
}
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
{
BASIC_FACTORY(Rendering);
}

View File

@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "RenderingViewModel.idl";
namespace Microsoft.Terminal.Settings.Editor
{
[default_interface] runtimeclass Rendering : Windows.UI.Xaml.Controls.Page
{
Rendering();
RenderingViewModel ViewModel { get; };
}
}

View File

@@ -0,0 +1,48 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information.
-->
<Page x:Class="Microsoft.Terminal.Settings.Editor.Rendering"
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.Settings.Editor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<DataTemplate x:Key="EnumComboBoxTemplate"
x:DataType="local:EnumEntry">
<TextBlock Text="{x:Bind EnumName}" />
</DataTemplate>
</ResourceDictionary>
</Page.Resources>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<local:SettingContainer x:Name="GraphicsAPI"
x:Uid="Globals_GraphicsAPI">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.GraphicsAPIList}"
SelectedItem="{x:Bind ViewModel.CurrentGraphicsAPI, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<local:SettingContainer x:Name="DisablePartialInvalidation"
x:Uid="Globals_DisablePartialInvalidation">
<ToggleSwitch IsOn="{x:Bind ViewModel.DisablePartialInvalidation, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
<local:SettingContainer x:Name="SoftwareRendering"
x:Uid="Globals_SoftwareRendering">
<ToggleSwitch IsOn="{x:Bind ViewModel.SoftwareRendering, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>
</StackPanel>
</Page>

View File

@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "RenderingViewModel.h"
#include "EnumEntry.h"
#include "RenderingViewModel.g.cpp"
using namespace winrt::Windows::Foundation;
using namespace winrt::Microsoft::Terminal::Settings::Model;
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
RenderingViewModel::RenderingViewModel(CascadiaSettings settings) noexcept :
_settings{ std::move(settings) }
{
INITIALIZE_BINDABLE_ENUM_SETTING(GraphicsAPI, GraphicsAPI, winrt::Microsoft::Terminal::Control::GraphicsAPI, L"Globals_GraphicsAPI_", L"Text");
}
}

View File

@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
#include "RenderingViewModel.g.h"
#include "Utils.h"
#include "ViewModelHelpers.h"
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
struct RenderingViewModel : RenderingViewModelT<RenderingViewModel>, ViewModelHelper<RenderingViewModel>
{
explicit RenderingViewModel(Model::CascadiaSettings settings) noexcept;
GETSET_BINDABLE_ENUM_SETTING(GraphicsAPI, winrt::Microsoft::Terminal::Control::GraphicsAPI, _settings.GlobalSettings().GraphicsAPI);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_settings.GlobalSettings(), DisablePartialInvalidation);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_settings.GlobalSettings(), SoftwareRendering);
private:
Model::CascadiaSettings _settings{ nullptr };
};
};
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
{
BASIC_FACTORY(RenderingViewModel);
}

View File

@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "EnumEntry.idl";
#include "ViewModelHelpers.idl.h"
namespace Microsoft.Terminal.Settings.Editor
{
runtimeclass RenderingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
{
RenderingViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings);
IInspectable CurrentGraphicsAPI;
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> GraphicsAPIList { get; };
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, DisablePartialInvalidation);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SoftwareRendering);
}
}

View File

@@ -650,8 +650,8 @@
<comment>A description for what the "word delimiters" setting does. Presented near "Globals_WordDelimiters.Header". "Mark" is used in the sense of "choosing something to interact with."</comment>
</data>
<data name="Nav_Appearance.Content" xml:space="preserve">
<value>Personalization</value>
<comment>Header for the "personalization" menu item. This navigates to a page that lets you see and modify settings related to the app's appearance.</comment>
<value>Appearance</value>
<comment>Header for the "appearance" menu item. This navigates to a page that lets you see and modify settings related to the app's appearance.</comment>
</data>
<data name="Nav_ColorSchemes.Content" xml:space="preserve">
<value>Color schemes</value>
@@ -677,6 +677,10 @@
<value>Defaults</value>
<comment>Header for the "defaults" menu item. This navigates to a page that lets you see and modify settings that affect profiles. This is the lowest layer of profile settings that all other profile settings are based on. If a profile doesn't define a setting, this page is responsible for figuring out what that setting is supposed to be.</comment>
</data>
<data name="Nav_Rendering.Content" xml:space="preserve">
<value>Rendering</value>
<comment>Header for the "rendering" menu item. This navigates to a page that lets you see and modify settings related to the app's rendering of text in the terminal.</comment>
</data>
<data name="Nav_Actions.Content" xml:space="preserve">
<value>Actions</value>
<comment>Header for the "actions" menu item. This navigates to a page that lets you see the available commands in the app.</comment>
@@ -1585,6 +1589,10 @@
<value>Name</value>
<comment>Header for a control to determine the name of the profile. This is a text box.</comment>
</data>
<data name="Profile_TransparencyHeader.Text" xml:space="preserve">
<value>Transparency</value>
<comment>Header for a group of settings related to transparency, including the acrylic material background of the app.</comment>
</data>
<data name="Profile_BackgroundHeader.Text" xml:space="preserve">
<value>Background image</value>
<comment>Header for a group of settings that control the image presented on the background of the app. Presented near "Profile_BackgroundImage" and other keys starting with "Profile_BackgroundImage".</comment>
@@ -1605,6 +1613,10 @@
<value>Warnings</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Window</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
</data>
<data name="Nav_OpenJSON.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Open your settings.json file. Alt+Click to open your defaults.json file.</value>
<comment>{Locked="settings.json"}, {Locked="defaults.json"}</comment>
@@ -2768,100 +2780,4 @@
<value>This text will be inserted between the paths of multiple files dropped into the terminal.</value>
<comment>A description for what the "drag drop delimiter" setting does.</comment>
</data>
<data name="Launch_Section_LaunchBehavior.Text" xml:space="preserve">
<value>Launch behavior</value>
<comment>Title of a section that groups settings that control how the terminal opens and behaves when launched.</comment>
</data>
<data name="Launch_Section_SystemInputDefaults.Text" xml:space="preserve">
<value>System &amp; input defaults</value>
<comment>Title of a section that groups settings for default system and input behaviors.</comment>
</data>
<data name="Interaction_Section_Clipboard.Text" xml:space="preserve">
<value>Clipboard and paste behavior</value>
<comment>Title of a section that groups settings related to selection, copying, and pasting.</comment>
</data>
<data name="Interaction_Section_TextSelection.Text" xml:space="preserve">
<value>Text selection &amp; editing</value>
<comment>Title of a section that groups settings related to text selection and editing.</comment>
</data>
<data name="Interaction_Section_WindowLayout.Text" xml:space="preserve">
<value>Window and layout behavior</value>
<comment>Title of a section that groups settings related to window sizing, arrangement, and grouping.</comment>
</data>
<data name="Interaction_Section_MouseScrolling.Text" xml:space="preserve">
<value>Mouse &amp; scrolling</value>
<comment>Title of a section that groups settings related to mouse and scroll wheel input.</comment>
</data>
<data name="Interaction_Section_UrlsExternal.Text" xml:space="preserve">
<value>URLs &amp; external actions</value>
<comment>Title of a section that groups settings related to URLs and external app actions.</comment>
</data>
<data name="Interaction_Section_Warnings.Text" xml:space="preserve">
<value>Warnings</value>
<comment>Title of a section that groups warning-related settings.</comment>
</data>
<data name="Globals_Section_VisualStyle.Text" xml:space="preserve">
<value>Visual style</value>
<comment>Title of a section that groups settings related to the terminal's visual appearance.</comment>
</data>
<data name="Globals_Section_TabsLayout.Text" xml:space="preserve">
<value>Tabs and layout</value>
<comment>Title of a section that groups settings related to tabs and pane layout.</comment>
</data>
<data name="Globals_Section_WindowBehavior.Text" xml:space="preserve">
<value>Window behavior</value>
<comment>Title of a section that groups settings related to terminal window behavior.</comment>
</data>
<data name="Globals_Section_TitleBarIdentity.Text" xml:space="preserve">
<value>Title bar &amp; identity</value>
<comment>Title of a section that groups settings related to title bar identity and indicators.</comment>
</data>
<data name="Globals_Section_SystemIntegration.Text" xml:space="preserve">
<value>System integration &amp; notifications</value>
<comment>Title of a section that groups settings related to system integration and notifications.</comment>
</data>
<data name="Compatibility_Section_Compatibility.Text" xml:space="preserve">
<value>Compatibility</value>
<comment>Title of a section that groups compatibility-related settings.</comment>
</data>
<data name="Compatibility_Section_Rendering.Text" xml:space="preserve">
<value>Rendering</value>
<comment>Title of a section that groups rendering-related settings.</comment>
</data>
<data name="Profile_Section_VisualUI.Text" xml:space="preserve">
<value>Visual/UI Affordance</value>
<comment>Title of a section in a profile page that groups visual and UI settings (tab title, icon, tab color, etc.).</comment>
</data>
<data name="Profile_Section_Window.Text" xml:space="preserve">
<value>Window settings</value>
<comment>Title of a section expander on the Profile Appearance page that groups window-level appearance settings (background opacity, acrylic, padding, scrollbar visibility).</comment>
</data>
<data name="Profile_NameSectionHeaderFormat" xml:space="preserve">
<value>{0} profile</value>
<comment>Localizable format string used as the section header for a profile (e.g. "PowerShell profile"). {0} is replaced by the profile's name. Reorder the placeholder if your language requires a different word order.</comment>
</data>
<data name="Profile_DefaultsSectionHeader" xml:space="preserve">
<value>Profile defaults</value>
<comment>Header used in place of the "{name} profile" header when the page is showing the profile-defaults layer (which has no profile name).</comment>
</data>
<data name="Appearance_Section_Typography.Text" xml:space="preserve">
<value>Typography settings</value>
<comment>Title of a section that groups settings controlling how text looks in a profile.</comment>
</data>
<data name="Appearance_Section_Cursor.Text" xml:space="preserve">
<value>Cursor settings</value>
<comment>Title of a section that groups settings controlling the cursor.</comment>
</data>
<data name="Appearance_Section_BackgroundImage.Text" xml:space="preserve">
<value>Background image</value>
<comment>Title of a section that groups settings controlling the background image.</comment>
</data>
<data name="Profile_AppearanceNavigator.HelpText" xml:space="preserve">
<value>Customize the visual appearance of the profile, including colors, fonts, and text styling.</value>
<comment>Help text shown below the "Appearance" navigator button on the profile page.</comment>
</data>
<data name="Profile_TerminalNavigator.HelpText" xml:space="preserve">
<value>Terminal emulation is how a terminal app interprets text and control sequences to behave like a traditional command-line terminal.</value>
<comment>Help text shown below the "Terminal" navigator button on the profile page.</comment>
</data>
</root>
</root>

View File

@@ -2201,10 +2201,26 @@
<value>关闭多个选项卡时发出警告</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_ConfirmOnClose.Header" xml:space="preserve">
<value>关闭时发出警告</value>
<comment>Header for a dropdown controlling when to show a confirmation dialog before closing.</comment>
</data>
<data name="Globals_ConfirmOnClose.HelpText" xml:space="preserve">
<value>控制在关闭选项卡或窗口之前何时显示确认对话框。“始终”在关闭任何窗格时显示对话框。</value>
<comment>Help text associated with Globals_ConfirmOnClose. "Always" refers to Globals_ConfirmOnCloseAlways.Content.</comment>
</data>
<data name="Globals_ConfirmOnCloseNever.Content" xml:space="preserve">
<value>从不</value>
<comment>Option associated with Globals_ConfirmOnClose. "Never" means that the system will never display a warning when closing.</comment>
</data>
<data name="Globals_ConfirmOnCloseAlways.Content" xml:space="preserve">
<value>始终</value>
<comment>Option associated with Globals_ConfirmOnClose. "Always" means that the system will always display a warning when closing.</comment>
</data>
<data name="Globals_ConfirmOnCloseAutomatic.Content" xml:space="preserve">
<value>多个选项卡或窗格</value>
<comment>Option associated with Globals_ConfirmOnClose. The system will display a warning when multiple tabs or panes are present.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>禁用“触摸键盘和手写面板服务”时发出警告</value>
</data>

View File

@@ -159,7 +159,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
// apply header and current value as name (automation property)
Automation::AutomationProperties::SetName(obj, _GenerateAccessibleName());
// apply help text as full description (automation property)
// apply help text as tooltip and full description (automation property)
if (const auto& helpText{ HelpText() }; !helpText.empty())
{
Automation::AutomationProperties::SetFullDescription(obj, helpText);

View File

@@ -133,38 +133,11 @@ struct HasScrollViewer
{
if (const auto& controlToFocus{ page->FindName(elementName).try_as<winrt::Windows::UI::Xaml::Controls::Control>() })
{
// Walk up the visual tree from the deep-link target and
// expand any ancestor expanders so the target is actually
// visible. This handles both:
// - Plain muxc:Expander instances used as section groupings
// - SettingContainer instances using an expander style
// (i.e. ExpanderSettingContainerStyleWithComplexPreview).
winrt::Windows::UI::Xaml::DependencyObject ancestor{ controlToFocus };
while (ancestor)
{
if (const auto& expander{ ancestor.try_as<winrt::Microsoft::UI::Xaml::Controls::Expander>() })
{
expander.IsExpanded(true);
}
else if (const auto& settingContainer{ ancestor.try_as<winrt::Microsoft::Terminal::Settings::Editor::SettingContainer>() })
{
settingContainer.SetExpanded(true);
}
ancestor = winrt::Windows::UI::Xaml::Media::VisualTreeHelper::GetParent(ancestor);
}
// Expanding ancestor expanders triggers asynchronous
// layout updates. Defer the bring-into-view + focus to
// the next dispatcher tick so the target's final layout
// position is known before we scroll/focus.
page->Dispatcher().RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [weakControl{ winrt::weak_ref{ controlToFocus } }]() {
if (const auto control = weakControl.get())
{
control.UpdateLayout();
control.StartBringIntoView();
control.Focus(winrt::Windows::UI::Xaml::FocusState::Programmatic);
}
});
// We need to wait for the page to be loaded
// or else the call to StartBringIntoView()
// will end up doing nothing
controlToFocus.StartBringIntoView();
controlToFocus.Focus(winrt::Windows::UI::Xaml::FocusState::Programmatic);
}
page->_loadedRevoker.revoke();
}

View File

@@ -57,6 +57,7 @@ static constexpr std::string_view SuggestionsKey{ "showSuggestions" };
static constexpr std::string_view ToggleFocusModeKey{ "toggleFocusMode" };
static constexpr std::string_view SetFocusModeKey{ "setFocusMode" };
static constexpr std::string_view ToggleFullscreenKey{ "toggleFullscreen" };
static constexpr std::string_view ToggleOverviewKey{ "toggleOverview" };
static constexpr std::string_view SetFullScreenKey{ "setFullScreen" };
static constexpr std::string_view SetMaximizedKey{ "setMaximized" };
static constexpr std::string_view TogglePaneZoomKey{ "togglePaneZoom" };

View File

@@ -59,6 +59,7 @@
ON_ALL_ACTIONS(ToggleShaderEffects) \
ON_ALL_ACTIONS(ToggleFocusMode) \
ON_ALL_ACTIONS(ToggleFullscreen) \
ON_ALL_ACTIONS(ToggleOverview) \
ON_ALL_ACTIONS(ToggleAlwaysOnTop) \
ON_ALL_ACTIONS(OpenSettings) \
ON_ALL_ACTIONS(SetFocusMode) \

View File

@@ -102,6 +102,14 @@ winrt::com_ptr<GlobalAppSettings> GlobalAppSettings::Copy() const
globals->_DisabledProfileSources->Append(src);
}
}
if (_SafeUriSchemes)
{
globals->_SafeUriSchemes = winrt::single_threaded_vector<hstring>();
for (const auto& src : *_SafeUriSchemes)
{
globals->_SafeUriSchemes->Append(src);
}
}
for (const auto& parent : _parents)
{

View File

@@ -114,6 +114,7 @@ namespace Microsoft.Terminal.Settings.Model
INHERITABLE_SETTING(Boolean, EnableUnfocusedAcrylic);
INHERITABLE_SETTING(Boolean, AllowHeadless);
INHERITABLE_SETTING(String, SearchWebDefaultQueryUrl);
INHERITABLE_SETTING(IVector<String>, SafeUriSchemes);
Windows.Foundation.Collections.IMapView<String, ColorScheme> ColorSchemes();
void AddColorScheme(ColorScheme scheme);

View File

@@ -63,6 +63,7 @@ Author(s):
X(bool, MinimizeToNotificationArea, "minimizeToNotificationArea", false) \
X(bool, AlwaysShowNotificationIcon, "alwaysShowNotificationIcon", false) \
X(winrt::Windows::Foundation::Collections::IVector<winrt::hstring>, DisabledProfileSources, "disabledProfileSources", nullptr) \
X(winrt::Windows::Foundation::Collections::IVector<winrt::hstring>, SafeUriSchemes, "safeUriSchemes", nullptr) \
X(bool, ShowAdminShield, "showAdminShield", true) \
X(bool, TrimPaste, "trimPaste", true) \
X(bool, EnableColorSelection, "experimental.enableColorSelection", false) \

View File

@@ -466,6 +466,9 @@
<value>Toggle focus mode</value>
<comment>"Focus mode" is a mode with minimal UI elements, for a distraction-free experience</comment>
</data>
<data name="ToggleOverviewCommandKey" xml:space="preserve">
<value>Toggle overview mode</value>
</data>
<data name="EnableFocusModeCommandKey" xml:space="preserve">
<value>Enable focus mode</value>
</data>

View File

@@ -517,6 +517,7 @@
{ "command": "closeWindow", "id": "Terminal.CloseWindow" },
{ "command": "toggleFullscreen", "id": "Terminal.ToggleFullscreen" },
{ "command": "toggleFocusMode", "id": "Terminal.ToggleFocusMode" },
{ "command": "toggleOverview", "id": "Terminal.ToggleOverview" },
{ "command": "toggleAlwaysOnTop", "id": "Terminal.ToggleAlwaysOnTop" },
{ "command": "openNewTabDropdown", "id": "Terminal.OpenNewTabDropdown" },
{ "command": { "action": "openSettings", "target": "settingsUI" }, "id": "Terminal.OpenSettingsUI" },

View File

@@ -4,7 +4,6 @@
#include <til/winrt.h>
#include "Converters.g.cpp"
#include "StringNotEmptyToVisibilityConverter.g.cpp"
#pragma warning(disable : 26497) // We will make these functions constexpr, as they are part of an ABI boundary.
#pragma warning(disable : 26440) // The function ... can be declared as noexcept.
@@ -81,22 +80,4 @@ namespace winrt::Microsoft::Terminal::UI::implementation
{
return fontWeight.Weight;
}
winrt::Windows::Foundation::IInspectable StringNotEmptyToVisibilityConverter::Convert(winrt::Windows::Foundation::IInspectable const& value, winrt::Windows::UI::Xaml::Interop::TypeName const& /*targetType*/, winrt::Windows::Foundation::IInspectable const& /*parameter*/, winrt::hstring const& /*language*/)
{
winrt::hstring text;
if (value)
{
if (const auto& str{ value.try_as<winrt::hstring>() })
{
text = *str;
}
}
return winrt::box_value(Converters::StringNotEmptyToVisibility(text));
}
winrt::Windows::Foundation::IInspectable StringNotEmptyToVisibilityConverter::ConvertBack(winrt::Windows::Foundation::IInspectable const& /*value*/, winrt::Windows::UI::Xaml::Interop::TypeName const& /*targetType*/, winrt::Windows::Foundation::IInspectable const& /*parameter*/, winrt::hstring const& /*language*/)
{
throw winrt::hresult_not_implemented();
}
}

View File

@@ -4,7 +4,6 @@
#pragma once
#include "Converters.g.h"
#include "StringNotEmptyToVisibilityConverter.g.h"
namespace winrt::Microsoft::Terminal::UI::implementation
{
@@ -30,18 +29,11 @@ namespace winrt::Microsoft::Terminal::UI::implementation
static winrt::Windows::UI::Xaml::Media::SolidColorBrush ColorToBrush(winrt::Windows::UI::Color color);
static double FontWeightToDouble(winrt::Windows::UI::Text::FontWeight fontWeight);
};
struct StringNotEmptyToVisibilityConverter : StringNotEmptyToVisibilityConverterT<StringNotEmptyToVisibilityConverter>
{
StringNotEmptyToVisibilityConverter() = default;
winrt::Windows::Foundation::IInspectable Convert(winrt::Windows::Foundation::IInspectable const& value, winrt::Windows::UI::Xaml::Interop::TypeName const& targetType, winrt::Windows::Foundation::IInspectable const& parameter, winrt::hstring const& language);
winrt::Windows::Foundation::IInspectable ConvertBack(winrt::Windows::Foundation::IInspectable const& value, winrt::Windows::UI::Xaml::Interop::TypeName const& targetType, winrt::Windows::Foundation::IInspectable const& parameter, winrt::hstring const& language);
};
}
namespace winrt::Microsoft::Terminal::UI::factory_implementation
{
BASIC_FACTORY(Converters);
BASIC_FACTORY(StringNotEmptyToVisibilityConverter);
struct Converters : ConvertersT<Converters, implementation::Converters>
{
};
}

View File

@@ -27,12 +27,4 @@ namespace Microsoft.Terminal.UI
static Windows.UI.Xaml.Media.SolidColorBrush ColorToBrush(Windows.UI.Color color);
static Double FontWeightToDouble(Windows.UI.Text.FontWeight fontWeight);
}
// IValueConverter wrapper around Converters.StringNotEmptyToVisibility, for use
// in classic {Binding} scenarios (e.g. ControlTemplates) where x:Bind function
// syntax against the static Converters helpers isn't available.
runtimeclass StringNotEmptyToVisibilityConverter : [default] Windows.UI.Xaml.Data.IValueConverter
{
StringNotEmptyToVisibilityConverter();
}
}

View File

@@ -32,7 +32,6 @@
#include <Windows.Graphics.Imaging.Interop.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Input.h>
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>

View File

@@ -467,6 +467,7 @@ namespace SettingsModelUnitTests
"$schema" : "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-1111-5271-96e7-009a87ff44bf}",
"disabledProfileSources": [ "Windows.Terminal.Wsl" ],
"safeUriSchemes": [ "vscode" ],
"newTabMenu":
[
{

View File

@@ -90,7 +90,15 @@ std::function<bool(wchar_t)> SixelParser::DefineImage(const VTInt macroParameter
_state = States::Normal;
_parameters.clear();
return [&](const auto ch) {
_parseCommandChar(ch);
try
{
_parseCommandChar(ch);
}
catch (...)
{
// Ignore all further content.
return false;
}
return true;
};
}
@@ -234,10 +242,18 @@ void SixelParser::_executeNextLine()
_executeCarriageReturn();
_imageLineCount++;
_maybeFlushImageBuffer();
_imageCursor.y += _sixelHeight;
_availablePixelHeight -= _sixelHeight;
_resizeImageBuffer(_sixelHeight);
_fillImageBackgroundWhenScrolled();
// If we don't have any available pixel height, that means the image has
// extended beyond the bottom of the display and we haven't triggered a
// a scroll (because sixel display mode is enabled). In this state, there
// is no point in extending the image any further, because the additional
// content will never be seen, so we'll just be wasting memory.
if (_availablePixelHeight > 0)
{
_imageCursor.y += _sixelHeight;
_availablePixelHeight -= _sixelHeight;
_resizeImageBuffer(_sixelHeight);
_fillImageBackgroundWhenScrolled();
}
}
void SixelParser::_executeMoveToHome()

View File

@@ -56,6 +56,11 @@ $ClassMap = @{
NavigationParam = "ColorSchemes_Nav"
SubPage = "BreadcrumbSubPage::None"
}
"Microsoft::Terminal::Settings::Editor::Rendering" = @{
ResourceName = "Nav_Rendering/Content"
NavigationParam = "Rendering_Nav"
SubPage = "BreadcrumbSubPage::None"
}
"Microsoft::Terminal::Settings::Editor::Compatibility" = @{
ResourceName = "Nav_Compatibility/Content"
NavigationParam = "Compatibility_Nav"