From f5b9015a59497a15b7506e76fbcca56ca729a270 Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Sun, 14 Aug 2022 00:21:33 +0200 Subject: [PATCH] Fix the chat widget jumping around when unfolded Setting the minimum size was making the widget taller and changing bottom(), breaking geometry computations afterwards. Save the geometry before calling setMinimumSize(). --- client/chatline.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/chatline.cpp b/client/chatline.cpp index 14b0155ef3..c7c0280d91 100644 --- a/client/chatline.cpp +++ b/client/chatline.cpp @@ -340,6 +340,9 @@ void chat_widget::set_chat_visible(bool visible) // Don't update chat_fheight m_chat_visible = false; + // Save the geometry before setting the minimum size + auto geo = geometry(); + if (visible) { setMinimumSize(200, 100); setResizable(Qt::LeftEdge | Qt::RightEdge | Qt::TopEdge @@ -366,7 +369,6 @@ void chat_widget::set_chat_visible(bool visible) : QLatin1String("expand-down"); show_hide->setIcon(fcIcons::instance()->getIcon(icon_name)); - auto geo = geometry(); if (expand_up) { geo.setTop(std::max(geo.bottom() - h, 0)); geo.setHeight(h);