mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
Terminal: Allow scrolling through terminal history with the mouse wheel
Fixes #470.
This commit is contained in:
parent
dc3c6be6f2
commit
c106ec4719
2 changed files with 16 additions and 0 deletions
|
@ -407,6 +407,19 @@ void TerminalWidget::mouseup_event(GMouseEvent& event)
|
|||
GClipboard::the().set_data(selected_text());
|
||||
}
|
||||
|
||||
void TerminalWidget::mousewheel_event(GMouseEvent& event)
|
||||
{
|
||||
if (!is_scrollable())
|
||||
return;
|
||||
m_scrollbar->set_value(m_scrollbar->value() + event.wheel_delta());
|
||||
GFrame::mousewheel_event(event);
|
||||
}
|
||||
|
||||
bool TerminalWidget::is_scrollable() const
|
||||
{
|
||||
return m_scrollbar->is_scrollable();
|
||||
}
|
||||
|
||||
String TerminalWidget::selected_text() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue