mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-06 20:34:29 +00:00
Compare commits
3 Commits
dev/cazamo
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a325a2fa5a | ||
|
|
dadde2fb11 | ||
|
|
8edac5fb12 |
@@ -499,8 +499,8 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
else
|
||||
{
|
||||
_ResizePane(realArgs.ResizeDirection());
|
||||
args.Handled(true);
|
||||
const auto resizeSucceeded = _ResizePane(realArgs.ResizeDirection());
|
||||
args.Handled(resizeSucceeded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,14 +844,14 @@ namespace winrt::TerminalApp::implementation
|
||||
// Arguments:
|
||||
// - direction: The direction to move the separator in.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Tab::ResizePane(const ResizeDirection& direction)
|
||||
// - whether a pane was resized
|
||||
bool Tab::ResizePane(const ResizeDirection& direction)
|
||||
{
|
||||
ASSERT_UI_THREAD();
|
||||
|
||||
// NOTE: This _must_ be called on the root pane, so that it can propagate
|
||||
// throughout the entire tree.
|
||||
_rootPane->ResizePane(direction);
|
||||
return _rootPane->ResizePane(direction);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const float splitSize,
|
||||
winrt::Windows::Foundation::Size availableSpace) const;
|
||||
|
||||
void ResizePane(const winrt::Microsoft::Terminal::Settings::Model::ResizeDirection& direction);
|
||||
bool ResizePane(const winrt::Microsoft::Terminal::Settings::Model::ResizeDirection& direction);
|
||||
bool NavigateFocus(const winrt::Microsoft::Terminal::Settings::Model::FocusDirection& direction);
|
||||
bool SwapPane(const winrt::Microsoft::Terminal::Settings::Model::FocusDirection& direction);
|
||||
bool FocusPane(const uint32_t id);
|
||||
|
||||
@@ -2900,14 +2900,15 @@ namespace winrt::TerminalApp::implementation
|
||||
// Arguments:
|
||||
// - direction: The direction to move the separator in.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_ResizePane(const ResizeDirection& direction)
|
||||
// - whether a pane was resized
|
||||
bool TerminalPage::_ResizePane(const ResizeDirection& direction)
|
||||
{
|
||||
if (const auto tabImpl{ _GetFocusedTabImpl() })
|
||||
{
|
||||
_UnZoomIfNeeded();
|
||||
tabImpl->ResizePane(direction);
|
||||
return tabImpl->ResizePane(direction);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const Microsoft::Terminal::Settings::Model::SplitDirection splitType,
|
||||
const float splitSize,
|
||||
std::shared_ptr<Pane> newPane);
|
||||
void _ResizePane(const Microsoft::Terminal::Settings::Model::ResizeDirection& direction);
|
||||
bool _ResizePane(const Microsoft::Terminal::Settings::Model::ResizeDirection& direction);
|
||||
void _ToggleSplitOrientation();
|
||||
|
||||
void _ScrollPage(ScrollDirection scrollDirection);
|
||||
|
||||
@@ -108,13 +108,19 @@ static Documents::Run _BuildErrorRun(const winrt::hstring& text, const ResourceD
|
||||
Documents::Run textRun;
|
||||
textRun.Text(text);
|
||||
|
||||
// Color the text red (light theme) or yellow (dark theme) based on the system theme
|
||||
auto key = winrt::box_value(L"ErrorTextBrush");
|
||||
if (resources.HasKey(key))
|
||||
// GH #18147 - In High Contrast mode, don't override the foreground.
|
||||
// Let the text inherit the system HC text color from its parent element,
|
||||
// since SystemErrorTextColor doesn't adapt to High Contrast themes.
|
||||
if (!winrt::Windows::UI::ViewManagement::AccessibilitySettings{}.HighContrast())
|
||||
{
|
||||
auto g = resources.Lookup(key);
|
||||
auto brush = g.try_as<winrt::Windows::UI::Xaml::Media::Brush>();
|
||||
textRun.Foreground(brush);
|
||||
// Color the text red (light theme) or yellow (dark theme) based on the system theme
|
||||
auto key = winrt::box_value(L"ErrorTextBrush");
|
||||
if (resources.HasKey(key))
|
||||
{
|
||||
auto g = resources.Lookup(key);
|
||||
auto brush = g.try_as<winrt::Windows::UI::Xaml::Media::Brush>();
|
||||
textRun.Foreground(brush);
|
||||
}
|
||||
}
|
||||
|
||||
return textRun;
|
||||
|
||||
@@ -99,9 +99,8 @@ static const uint8_t* deserializeString(const uint8_t* it, const uint8_t* end, w
|
||||
uint32_t len;
|
||||
it = deserializeUint32(it, end, len);
|
||||
|
||||
const auto bytes = static_cast<size_t>(len) * sizeof(wchar_t);
|
||||
|
||||
if (bytes == 0 || static_cast<size_t>(end - it) < bytes)
|
||||
size_t bytes{};
|
||||
if (!SUCCEEDED(SizeTMult(static_cast<size_t>(len), sizeof(wchar_t), &bytes)) || bytes == 0 || static_cast<size_t>(end - it) < bytes)
|
||||
{
|
||||
throw std::out_of_range("Not enough data for string content");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user