mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
[PowerRename] Clicking on regex/date&time cheatsheet item appends to Search/Replace field text (#19056)
* [PowerRename] Fill Search/Replace field by clicking on regex/date&time cheatsheet items * Make ListViews item non-selectable
This commit is contained in:
@@ -189,7 +189,7 @@
|
|||||||
<RowDefinition Height="48" />
|
<RowDefinition Height="48" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock x:Uid="RegExCheatSheet_Title" FontWeight="SemiBold" />
|
<TextBlock x:Uid="RegExCheatSheet_Title" FontWeight="SemiBold" />
|
||||||
<ListView ItemsSource="{x:Bind SearchRegExShortcuts}" Grid.Row="1" IsItemClickEnabled="True" Margin="-4,12,0,0" ItemClick="RegExItemClick">
|
<ListView ItemsSource="{x:Bind SearchRegExShortcuts}" SelectionMode="None" Grid.Row="1" IsItemClickEnabled="True" Margin="-4,12,0,0" ItemClick="RegExItemClick">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate x:DataType="local:PatternSnippet">
|
<DataTemplate x:DataType="local:PatternSnippet">
|
||||||
<Grid ColumnSpacing="8" Margin="-10,0,0,0">
|
<Grid ColumnSpacing="8" Margin="-10,0,0,0">
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock x:Uid="DateTimeCheatSheet_Title" FontWeight="SemiBold" />
|
<TextBlock x:Uid="DateTimeCheatSheet_Title" FontWeight="SemiBold" />
|
||||||
<ListView ItemsSource="{x:Bind DateTimeShortcuts}" Grid.Row="1" IsItemClickEnabled="True" Margin="-4,12,0,0" ItemClick="DateTimeItemClick">
|
<ListView ItemsSource="{x:Bind DateTimeShortcuts}" SelectionMode="None" Grid.Row="1" IsItemClickEnabled="True" Margin="-4,12,0,0" ItemClick="DateTimeItemClick">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate x:DataType="local:PatternSnippet">
|
<DataTemplate x:DataType="local:PatternSnippet">
|
||||||
<Grid ColumnSpacing="8" Margin="-10,0,0,0">
|
<Grid ColumnSpacing="8" Margin="-10,0,0,0">
|
||||||
|
|||||||
@@ -271,11 +271,15 @@ namespace winrt::PowerRenameUI::implementation
|
|||||||
void MainWindow::RegExItemClick(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::ItemClickEventArgs const& e)
|
void MainWindow::RegExItemClick(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::ItemClickEventArgs const& e)
|
||||||
{
|
{
|
||||||
auto s = e.ClickedItem().try_as<PatternSnippet>();
|
auto s = e.ClickedItem().try_as<PatternSnippet>();
|
||||||
|
RegExFlyout().Hide();
|
||||||
|
textBox_search().Text(textBox_search().Text() + s->Code());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::DateTimeItemClick(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::ItemClickEventArgs const& e)
|
void MainWindow::DateTimeItemClick(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::ItemClickEventArgs const& e)
|
||||||
{
|
{
|
||||||
auto s = e.ClickedItem().try_as<PatternSnippet>();
|
auto s = e.ClickedItem().try_as<PatternSnippet>();
|
||||||
|
DateTimeFlyout().Hide();
|
||||||
|
textBox_replace().Text(textBox_replace().Text() + s->Code());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::button_rename_Click(winrt::Microsoft::UI::Xaml::Controls::SplitButton const&, winrt::Microsoft::UI::Xaml::Controls::SplitButtonClickEventArgs const&)
|
void MainWindow::button_rename_Click(winrt::Microsoft::UI::Xaml::Controls::SplitButton const&, winrt::Microsoft::UI::Xaml::Controls::SplitButtonClickEventArgs const&)
|
||||||
|
|||||||
Reference in New Issue
Block a user