mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
LibVT: Add TerminalWidget::scroll_to_bottom() API
(And use this internally when scrolling to bottom on non-modifier keydown events.)
This commit is contained in:
parent
eac0344ef0
commit
9475427d5d
2 changed files with 8 additions and 1 deletions
|
@ -243,7 +243,7 @@ void TerminalWidget::keydown_event(GUI::KeyEvent& event)
|
|||
m_terminal.handle_key_press(event.key(), event.code_point(), event.modifiers());
|
||||
|
||||
if (event.key() != Key_Control && event.key() != Key_Alt && event.key() != Key_LeftShift && event.key() != Key_RightShift && event.key() != Key_Logo)
|
||||
m_scrollbar->set_value(m_scrollbar->max());
|
||||
scroll_to_bottom();
|
||||
}
|
||||
|
||||
void TerminalWidget::keyup_event(GUI::KeyEvent& event)
|
||||
|
@ -885,3 +885,8 @@ void TerminalWidget::clear_including_history()
|
|||
{
|
||||
m_terminal.clear_including_history();
|
||||
}
|
||||
|
||||
void TerminalWidget::scroll_to_bottom()
|
||||
{
|
||||
m_scrollbar->set_value(m_scrollbar->max());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue