[PowerRename] Added KeyboardAccelerator + set default width/height (#14157)

* Added acceleratorkey (enter) and fixed width/height

* Update PowerRenameUIHost.cpp

* Added additional modifier

Co-authored-by: Laute <Niels.Laute@philips.com>
This commit is contained in:
Niels Laute
2021-11-02 15:08:50 +01:00
committed by GitHub
parent e6a7f9193b
commit e2c8880363
3 changed files with 8 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ AppWindow::AppWindow(HINSTANCE hInstance, std::vector<std::wstring> files) noexc
CComPtr<IShellItemArray> shellItemArray; CComPtr<IShellItemArray> shellItemArray;
// To test PowerRenameUIHost uncomment this line and update the path to // To test PowerRenameUIHost uncomment this line and update the path to
// your local (absolute or relative) path which you want to see in PowerRename // your local (absolute or relative) path which you want to see in PowerRename
//files.push_back(L"<path>"); // files.push_back(L"path");
if (!files.empty()) if (!files.empty())
{ {
@@ -88,7 +88,8 @@ void AppWindow::CreateAndShowWindow()
wchar_t title[64]; wchar_t title[64];
LoadStringW(m_instance, IDS_APP_TITLE, title, ARRAYSIZE(title)); LoadStringW(m_instance, IDS_APP_TITLE, title, ARRAYSIZE(title));
m_window = CreateWindowW(c_WindowClass, title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, CW_USEDEFAULT, nullptr, nullptr, m_instance, this); // hardcoded width and height (1200 x 600) - with WinUI 3, it should auto-scale to the content
m_window = CreateWindowW(c_WindowClass, title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, 1200, 600, nullptr, nullptr, m_instance, this);
THROW_LAST_ERROR_IF(!m_window); THROW_LAST_ERROR_IF(!m_window);
ShowWindow(m_window, SW_SHOWNORMAL); ShowWindow(m_window, SW_SHOWNORMAL);

View File

@@ -625,6 +625,7 @@
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" /> <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="AcceptsReturn" Value="False" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" /> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />

View File

@@ -258,7 +258,6 @@
<ToggleButton x:Name="toggleButton_enumItems" Content="&#xEA40;" FontFamily="{ThemeResource SymbolThemeFontFamily}" MinHeight="32" x:Uid="ToggleButton_EnumItems" Style="{StaticResource CustomToggleButtonStyle}" /> <ToggleButton x:Name="toggleButton_enumItems" Content="&#xEA40;" FontFamily="{ThemeResource SymbolThemeFontFamily}" MinHeight="32" x:Uid="ToggleButton_EnumItems" Style="{StaticResource CustomToggleButtonStyle}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
<Rectangle Height="1" Fill="{ThemeResource CardStrokeColorDefaultBrush}" HorizontalAlignment="Stretch" Margin="0,0,20,0" VerticalAlignment="Top" Grid.Row="1" /> <Rectangle Height="1" Fill="{ThemeResource CardStrokeColorDefaultBrush}" HorizontalAlignment="Stretch" Margin="0,0,20,0" VerticalAlignment="Top" Grid.Row="1" />
@@ -304,6 +303,10 @@
</StackPanel> </StackPanel>
<muxc:SplitButton Grid.Row="1" Style="{StaticResource SplitAccentButtonStyle}" x:Name="button_rename" Margin="0,0,20,0" x:Uid="ButtonApply" Click="button_rename_Click" HorizontalAlignment="Right" VerticalAlignment="Bottom" IsEnabled="{x:Bind UIUpdatesItem.ButtonRenameEnabled, Mode=OneWay}"> <muxc:SplitButton Grid.Row="1" Style="{StaticResource SplitAccentButtonStyle}" x:Name="button_rename" Margin="0,0,20,0" x:Uid="ButtonApply" Click="button_rename_Click" HorizontalAlignment="Right" VerticalAlignment="Bottom" IsEnabled="{x:Bind UIUpdatesItem.ButtonRenameEnabled, Mode=OneWay}">
<muxc:SplitButton.KeyboardAccelerators>
<KeyboardAccelerator Key="Enter" />
<KeyboardAccelerator Key="Enter" Modifiers="Control" />
</muxc:SplitButton.KeyboardAccelerators>
<muxc:SplitButton.Content> <muxc:SplitButton.Content>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xE13E;" FontSize="14" VerticalAlignment="Center" Margin="0,2,10,0" /> <FontIcon Glyph="&#xE13E;" FontSize="14" VerticalAlignment="Center" Margin="0,2,10,0" />