mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
LibVT: Correctly wrap text when the scrollbar is hidden
This commit is contained in:
parent
b15128c45b
commit
63d2b26b17
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
* Copyright (c) 2023, networkException <networkexception@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -527,7 +528,7 @@ void TerminalWidget::relayout(Gfx::IntSize size)
|
|||
|
||||
Gfx::IntSize TerminalWidget::compute_base_size() const
|
||||
{
|
||||
int base_width = frame_thickness() * 2 + m_inset * 2 + m_scrollbar->width();
|
||||
int base_width = frame_thickness() * 2 + m_inset * 2 + (m_scrollbar->is_visible() ? m_scrollbar->width() : 0);
|
||||
int base_height = frame_thickness() * 2 + m_inset * 2;
|
||||
return { base_width, base_height };
|
||||
}
|
||||
|
@ -557,6 +558,7 @@ void TerminalWidget::set_opacity(u8 new_opacity)
|
|||
void TerminalWidget::set_show_scrollbar(bool show_scrollbar)
|
||||
{
|
||||
m_scrollbar->set_visible(show_scrollbar);
|
||||
relayout(size());
|
||||
}
|
||||
|
||||
bool TerminalWidget::has_selection() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue