From 572c3bb71a824b15442ed63c600e77517c6ae411 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 19 Sep 2017 07:50:50 +0200 Subject: [PATCH] View: Move comment to where it belongs --- pv/views/trace/view.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 26976866..f63401e6 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -899,6 +899,14 @@ bool View::header_was_shrunk() const void View::expand_header_to_fit() { + // Setting the maximum width of the header widget doesn't work as + // expected because the splitter would allow the user to make the + // pane wider than that, creating empty space as a result. + // To make this work, we stricly enforce the maximum width by + // expanding the header unless the user shrunk it on purpose. + // As we're then setting the width of the header pane, we set the + // splitter to the maximum allowed position. + int splitter_area_width = 0; for (int w : splitter_->sizes()) splitter_area_width += w; @@ -1101,13 +1109,6 @@ void View::on_signal_name_changed() void View::on_splitter_moved() { - // Setting the maximum width of the header widget doesn't work as - // expected because the splitter would allow the user to make the - // pane wider than that, creating empty space as a result. - // To make this work, we stricly enforce the maximum width by - // expanding the header unless the user shrunk it on purpose. - // As we're then setting the width of the header pane, we set the - // splitter to the maximum allowed position. if (!header_was_shrunk()) expand_header_to_fit(); } -- 2.30.2