mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
Add auto scroll when adding a remap (#2969)
This commit is contained in:
@@ -392,6 +392,8 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
header.Children().Append(applyButton);
|
header.Children().Append(applyButton);
|
||||||
header.Children().Append(cancelButton);
|
header.Children().Append(cancelButton);
|
||||||
|
|
||||||
|
ScrollViewer scrollViewer;
|
||||||
|
|
||||||
// Add remap key button
|
// Add remap key button
|
||||||
Windows::UI::Xaml::Controls::Button addRemapKey;
|
Windows::UI::Xaml::Controls::Button addRemapKey;
|
||||||
FontIcon plusSymbol;
|
FontIcon plusSymbol;
|
||||||
@@ -401,6 +403,8 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
addRemapKey.Margin({ 10, 0, 0, 25 });
|
addRemapKey.Margin({ 10, 0, 0, 25 });
|
||||||
addRemapKey.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
addRemapKey.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||||
SingleKeyRemapControl::AddNewControlKeyRemapRow(keyRemapTable, keyboardRemapControlObjects);
|
SingleKeyRemapControl::AddNewControlKeyRemapRow(keyRemapTable, keyboardRemapControlObjects);
|
||||||
|
// Whenever a remap is added move to the bottom of the screen
|
||||||
|
scrollViewer.ChangeView(nullptr, scrollViewer.ScrollableHeight(), nullptr);
|
||||||
});
|
});
|
||||||
|
|
||||||
StackPanel mappingsPanel;
|
StackPanel mappingsPanel;
|
||||||
@@ -409,7 +413,6 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
mappingsPanel.Children().Append(keyRemapTable);
|
mappingsPanel.Children().Append(keyRemapTable);
|
||||||
mappingsPanel.Children().Append(addRemapKey);
|
mappingsPanel.Children().Append(addRemapKey);
|
||||||
|
|
||||||
ScrollViewer scrollViewer;
|
|
||||||
scrollViewer.Content(mappingsPanel);
|
scrollViewer.Content(mappingsPanel);
|
||||||
|
|
||||||
// Creating the Xaml content. xamlContainer is the parent UI element
|
// Creating the Xaml content. xamlContainer is the parent UI element
|
||||||
|
|||||||
@@ -275,6 +275,8 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
|||||||
header.Children().Append(applyButton);
|
header.Children().Append(applyButton);
|
||||||
header.Children().Append(cancelButton);
|
header.Children().Append(cancelButton);
|
||||||
|
|
||||||
|
ScrollViewer scrollViewer;
|
||||||
|
|
||||||
// Add shortcut button
|
// Add shortcut button
|
||||||
Windows::UI::Xaml::Controls::Button addShortcut;
|
Windows::UI::Xaml::Controls::Button addShortcut;
|
||||||
FontIcon plusSymbol;
|
FontIcon plusSymbol;
|
||||||
@@ -284,6 +286,8 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
|||||||
addShortcut.Margin({ 10, 0, 0, 25 });
|
addShortcut.Margin({ 10, 0, 0, 25 });
|
||||||
addShortcut.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
addShortcut.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||||
ShortcutControl::AddNewShortcutControlRow(shortcutTable, keyboardRemapControlObjects);
|
ShortcutControl::AddNewShortcutControlRow(shortcutTable, keyboardRemapControlObjects);
|
||||||
|
// Whenever a remap is added move to the bottom of the screen
|
||||||
|
scrollViewer.ChangeView(nullptr, scrollViewer.ScrollableHeight(), nullptr);
|
||||||
});
|
});
|
||||||
|
|
||||||
StackPanel mappingsPanel;
|
StackPanel mappingsPanel;
|
||||||
@@ -292,7 +296,6 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
|||||||
mappingsPanel.Children().Append(shortcutTable);
|
mappingsPanel.Children().Append(shortcutTable);
|
||||||
mappingsPanel.Children().Append(addShortcut);
|
mappingsPanel.Children().Append(addShortcut);
|
||||||
|
|
||||||
ScrollViewer scrollViewer;
|
|
||||||
scrollViewer.Content(mappingsPanel);
|
scrollViewer.Content(mappingsPanel);
|
||||||
|
|
||||||
RelativePanel xamlContainer;
|
RelativePanel xamlContainer;
|
||||||
|
|||||||
Reference in New Issue
Block a user