From cbe4bf33d66d7512a22fa69ce946ff11c39b3819 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 30 Apr 2019 22:52:38 +0300 Subject: [PATCH] Changed: Use table width used min-width and allow table cells to properly fit --HG-- branch : develop --- code/nel/src/gui/group_table.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index b10114a18..45c3b7e1e 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -843,6 +843,19 @@ namespace NLGUI ratio -= _Columns[i].TableRatio; } + // force table width to fit all columns + // if width is set, then use column min width + if (ForceWidthMin > 0) + tableWidthMax = std::min(_LastParentW - borderWidth, std::max(tableWidthMax, tableWidth)); + else + tableWidthMax = std::min(_LastParentW - borderWidth, std::max(tableWidthMax, tableMaxContentWidth)); + + if (tableWidthMax < 0) + tableWidthMax = 0; + + if (tableWidthMax < tableWidthMin) + std::swap(tableWidthMin, tableWidthMax); + // Eval table size with all percent cells resized sint32 tableWidthSizeAfterPercent = tableWidth; for (i=0; i<_Columns.size(); i++)