Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/cascadia/QueryExtension/ExtensionPalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,6 @@ namespace winrt::Microsoft::Terminal::Query::Extension::implementation
_richBlock{ nullptr }
{
_richBlock = Microsoft::Terminal::UI::Markdown::Builder::Convert(_messageContent, L"");
const auto resources = Application::Current().Resources();
const auto textBrushObj = _isQuery ? resources.Lookup(box_value(L"TextOnAccentFillColorPrimaryBrush")) : resources.Lookup(box_value(L"TextFillColorPrimaryBrush"));
if (const auto textBrush = textBrushObj.try_as<Windows::UI::Xaml::Media::SolidColorBrush>())
{
_richBlock.Foreground(textBrush);
}
if (!_isQuery)
{
for (const auto& b : _richBlock.Blocks())
Expand All @@ -394,16 +388,7 @@ namespace winrt::Microsoft::Terminal::Query::Extension::implementation
{
if (const auto& codeBlock{ otherContent.Child().try_as<Microsoft::Terminal::UI::Markdown::CodeBlock>() })
{
codeBlock.Margin({ 0, 8, 0, 8 });
codeBlock.PlayButtonVisibility(Windows::UI::Xaml::Visibility::Visible);
if (const auto backgroundBrush = resources.Lookup(box_value(L"ControlAltFillColorSecondaryBrush")).try_as<Windows::UI::Xaml::Media::SolidColorBrush>())
{
codeBlock.Background(backgroundBrush);
}
if (const auto foregroundBrush = resources.Lookup(box_value(L"AccentTextFillColorPrimaryBrush")).try_as<Windows::UI::Xaml::Media::SolidColorBrush>())
{
codeBlock.Foreground(foregroundBrush);
}
codeBlock.RequestRunCommands([this, commandlines = codeBlock.Commandlines()](auto&&, auto&&) {
_RunCommandClickedHandlers(*this, commandlines);
});
Expand Down
18 changes: 16 additions & 2 deletions src/cascadia/QueryExtension/ExtensionPalette.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.Terminal.Query.Extension"
xmlns:markdown="using:Microsoft.Terminal.UI.Markdown"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
Expand Down Expand Up @@ -60,7 +61,8 @@
BorderBrush="{ThemeResource MessageBorderBrush}"
BorderThickness="{ThemeResource MessageBorderThickness}"
CornerRadius="8">
<ContentPresenter Content="{x:Bind RichBlock}" />
<ContentPresenter Content="{x:Bind RichBlock}"
Foreground="{ThemeResource TextOnAccentFillColorPrimaryBrush}" />
</StackPanel>
</Grid>
</DataTemplate>
Expand All @@ -80,7 +82,19 @@
BorderBrush="{ThemeResource MessageBorderBrush}"
BorderThickness="{ThemeResource MessageBorderThickness}"
CornerRadius="8">
<ContentPresenter Content="{x:Bind RichBlock}" />
<ContentPresenter Content="{x:Bind RichBlock}"
Foreground="{ThemeResource TextFillColorPrimaryBrush}">
<ContentPresenter.Resources>
<Style TargetType="markdown:CodeBlock">
<Setter Property="Foreground"
Value="{ThemeResource AccentTextFillColorPrimaryBrush}"/>
<Setter Property="Background"
Value="{ThemeResource ControlAltFillColorSecondaryBrush}"/>
<Setter Property="Margin"
Value="0,8"/>
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</StackPanel>
</Grid>
</DataTemplate>
Expand Down
Loading