Skip to content

Commit

Permalink
Fix the chat widget jumping around when unfolded
Browse files Browse the repository at this point in the history
Setting the minimum size was making the widget taller and changing bottom(),
breaking geometry computations afterwards. Save the geometry before calling
setMinimumSize().
  • Loading branch information
lmoureaux committed Aug 15, 2022
1 parent 017d03c commit f5b9015
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/chatline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit f5b9015

Please sign in to comment.