mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +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" />
|
||||
</Grid.RowDefinitions>
|
||||
<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>
|
||||
<DataTemplate x:DataType="local:PatternSnippet">
|
||||
<Grid ColumnSpacing="8" Margin="-10,0,0,0">
|
||||
@@ -248,7 +248,7 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<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>
|
||||
<DataTemplate x:DataType="local:PatternSnippet">
|
||||
<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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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&)
|
||||
|
||||
Reference in New Issue
Block a user