Add auto scroll when adding a remap (#2969)

This commit is contained in:
Arjun Balgovind
2020-05-14 09:24:50 -07:00
committed by GitHub
parent 9d5990311f
commit 91ac3f7931
2 changed files with 8 additions and 2 deletions

View File

@@ -275,6 +275,8 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
header.Children().Append(applyButton);
header.Children().Append(cancelButton);
ScrollViewer scrollViewer;
// Add shortcut button
Windows::UI::Xaml::Controls::Button addShortcut;
FontIcon plusSymbol;
@@ -284,6 +286,8 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
addShortcut.Margin({ 10, 0, 0, 25 });
addShortcut.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
ShortcutControl::AddNewShortcutControlRow(shortcutTable, keyboardRemapControlObjects);
// Whenever a remap is added move to the bottom of the screen
scrollViewer.ChangeView(nullptr, scrollViewer.ScrollableHeight(), nullptr);
});
StackPanel mappingsPanel;
@@ -292,7 +296,6 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
mappingsPanel.Children().Append(shortcutTable);
mappingsPanel.Children().Append(addShortcut);
ScrollViewer scrollViewer;
scrollViewer.Content(mappingsPanel);
RelativePanel xamlContainer;