From: <geo...@us...> - 2007-06-22 22:03:03
|
Revision: 2079 http://svn.sourceforge.net/freeorion/revision/?rev=2079&view=rev Author: geoffthemedio Date: 2007-06-22 15:03:04 -0700 (Fri, 22 Jun 2007) Log Message: ----------- Made SitRepPanel more selective about when it updates itself: now it updates only if it is visible and has been resized. This makes map scrolling much less laggy on turns after there has been a sitrep entry, or after the SitRepPanel has been opened and closed. Modified Paths: -------------- trunk/FreeOrion/UI/MapWnd.cpp trunk/FreeOrion/UI/SitRepPanel.cpp Modified: trunk/FreeOrion/UI/MapWnd.cpp =================================================================== --- trunk/FreeOrion/UI/MapWnd.cpp 2007-06-22 19:50:57 UTC (rev 2078) +++ trunk/FreeOrion/UI/MapWnd.cpp 2007-06-22 22:03:04 UTC (rev 2079) @@ -664,8 +664,8 @@ assert(empire); m_sitrep_panel->Update(); // HACK! The first time this SitRepPanel gets an update, the report row(s) are misaligned. I have no idea why, and - // I am sick of dealing with it, so I'm forcing a resize in order to force it to behave. - m_sitrep_panel->Resize(m_sitrep_panel->Size()); + // I am sick of dealing with it, so I'm forcing an update in order to force it to behave. + m_sitrep_panel->Update(); if (empire->NumSitRepEntries()) m_sitrep_panel->Show(); else @@ -1544,9 +1544,11 @@ { m_projected_fleet_lines = MovementLineData(); if (m_sitrep_panel->Visible()) { + Logger().debugStream() << "sitrep visible"; DetachChild(m_sitrep_panel); m_sitrep_panel->Hide(); // necessary so it won't be visible when next toggled } else { + Logger().debugStream() << "sitrep not visible"; // hide other "competing" windows m_research_wnd->Hide(); HumanClientApp::GetApp()->MoveDown(m_research_wnd); Modified: trunk/FreeOrion/UI/SitRepPanel.cpp =================================================================== --- trunk/FreeOrion/UI/SitRepPanel.cpp 2007-06-22 19:50:57 UTC (rev 2078) +++ trunk/FreeOrion/UI/SitRepPanel.cpp 2007-06-22 22:03:04 UTC (rev 2079) @@ -46,10 +46,13 @@ void SitRepPanel::SizeMove(const GG::Pt& ul, const GG::Pt& lr) { + GG::Pt old_size = GG::Wnd::LowerRight() - GG::Wnd::UpperLeft(); + CUIWnd::SizeMove(ul, lr); m_sitreps_lb->SizeMove(GG::Pt(SITREP_LB_MARGIN_X, SITREP_LB_MARGIN_Y), GG::Pt(ClientWidth() - SITREP_LB_MARGIN_X, ClientHeight() - SITREP_LB_MARGIN_Y)); - Update(); + if (Visible() && old_size != GG::Wnd::Size()) + Update(); } void SitRepPanel::OnClose() |