From: <geo...@us...> - 2009-12-22 20:02:43
|
Revision: 3290 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=3290&view=rev Author: geoffthemedio Date: 2009-12-22 20:02:33 +0000 (Tue, 22 Dec 2009) Log Message: ----------- Fixed fleets list and ships list resizing issues. The bulk of this was a patch submitted by wrwrwr, which I tweaked for formatting and then duplicated to fix the behaviour of both lists. Modified Paths: -------------- trunk/FreeOrion/UI/FleetWnd.cpp Modified: trunk/FreeOrion/UI/FleetWnd.cpp =================================================================== --- trunk/FreeOrion/UI/FleetWnd.cpp 2009-12-22 18:00:12 UTC (rev 3289) +++ trunk/FreeOrion/UI/FleetWnd.cpp 2009-12-22 20:02:33 UTC (rev 3290) @@ -1189,13 +1189,17 @@ CUIListBox(x, y, w, h), m_highlighted_row_it(end()), m_read_only(read_only) - {} + { + InitRowSizes(); + } FleetsListBox(bool read_only) : CUIListBox(GG::X0, GG::Y0, GG::X1, GG::Y1), m_highlighted_row_it(end()), m_read_only(read_only) - {} + { + InitRowSizes(); + } virtual void DropsAcceptable(DropsAcceptableIter first, DropsAcceptableIter last, const GG::Pt& pt) const { // default result, possibly to be updated later: reject all drops @@ -1513,6 +1517,14 @@ m_highlighted_row_it = end(); } + void InitRowSizes() { + // preinitialize listbox/row column widths, because what + // ListBox::Insert does on default is not suitable for this case + SetNumCols(1); + SetColWidth(0, GG::X0); + LockColWidths(); + } + iterator m_highlighted_row_it; const bool m_read_only; }; @@ -1549,6 +1561,12 @@ const GG::Pt row_size = ListRowSize(); + // preinitialize listbox/row column widths, because what + // ListBox::Insert does on default is not suitable for this case + SetNumCols(1); + SetColWidth(0, GG::X0); + LockColWidths(); + for (Fleet::const_iterator it = fleet->begin(); it != fleet->end(); ++it) { int ship_id = *it; ShipRow* row = new ShipRow(GG::X1, row_size.y, ship_id); |