From 38af0c823b6338637bccf7d0b70c88d3a861fe6a Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 11 Mar 2024 13:20:17 -0700 Subject: Add Fl_Terminal to "Scrollbar Size" unittest (#931) This involved enlarging the unittest main window to make room for the additional test. Adding this test revealed a problem in Fl_Terminal's global scrollbar size handling, which is fixed here as well. Also fixed a small issue in the demo's debugging terminal with the horiz scrollbar. --- src/Fl_Terminal.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/Fl_Terminal.cxx b/src/Fl_Terminal.cxx index 2cd99e993..566cb0820 100644 --- a/src/Fl_Terminal.cxx +++ b/src/Fl_Terminal.cxx @@ -3657,6 +3657,12 @@ void Fl_Terminal::draw(void) { current_style_->update(); // do deferred update here update_screen(true); // update fonts } + // Detect if Fl::scrollbar_size() was changed in size, recalc if so + if (scrollbar_size_ == 0 && + ( scrollbar->visible() && scrollbar->w() != Fl::scrollbar_size() || + hscrollbar->visible() && hscrollbar->h() != Fl::scrollbar_size())) { + update_scrollbar(); + } // Draw group first, terminal last Fl_Group::draw(); // Draw that little square between the scrollbars: -- cgit v1.2.3