mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07: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());
|
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)
|
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)
|
void TerminalWidget::keyup_event(GUI::KeyEvent& event)
|
||||||
|
@ -885,3 +885,8 @@ void TerminalWidget::clear_including_history()
|
||||||
{
|
{
|
||||||
m_terminal.clear_including_history();
|
m_terminal.clear_including_history();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TerminalWidget::scroll_to_bottom()
|
||||||
|
{
|
||||||
|
m_scrollbar->set_value(m_scrollbar->max());
|
||||||
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@ public:
|
||||||
VT::Position normalized_selection_start() const;
|
VT::Position normalized_selection_start() const;
|
||||||
VT::Position normalized_selection_end() const;
|
VT::Position normalized_selection_end() const;
|
||||||
|
|
||||||
|
void scroll_to_bottom();
|
||||||
|
|
||||||
bool is_scrollable() const;
|
bool is_scrollable() const;
|
||||||
int scroll_length() const;
|
int scroll_length() const;
|
||||||
void set_scroll_length(int);
|
void set_scroll_length(int);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue