mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibVT: Correctly wrap text when the scrollbar is hidden
This commit is contained in:
parent
b15128c45b
commit
63d2b26b17
Notes:
sideshowbarker
2024-07-17 04:57:23 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/63d2b26b17 Pull-request: https://github.com/SerenityOS/serenity/pull/18863 Reviewed-by: https://github.com/caoimhebyrne ✅
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…
Reference in a new issue