Merge with html-improvements

--HG--
branch : yubo
hg/yubo
Nimetu 5 years ago
commit e4cce24f80

@ -204,11 +204,8 @@ namespace NLGUI
return Current.FontSize-2;
}
sint styleStackIndex = 0;
inline void pushStyle()
{
styleStackIndex++;
_StyleStack.push_back(Current);
Current.GlobalColor = false;
@ -228,7 +225,6 @@ namespace NLGUI
inline void popStyle()
{
styleStackIndex--;
if (_StyleStack.empty())
{
Current = Root;

@ -554,7 +554,7 @@ namespace NLGUI
rVR.flush();
}
// Get the parent table
if (Border)
{
// TODO: monitor these in checkCoords and update when changed
uint8 contentAlpha = CWidgetManager::getInstance()->getGlobalColorForContent().A;
@ -573,13 +573,19 @@ namespace NLGUI
// ----------------------------------------------------------------------------
sint32 CGroupCell::getMaxUsedW() const
{
return Group->getMaxUsedW();
sint32 result = getPaddingLeftRight() + Group->getMaxUsedW();
if (Border)
result += Border->getLeftRightWidth();
return result;
}
// ------------------------------------------------------------------------------------------------
sint32 CGroupCell::getMinUsedW() const
{
return Group->getMinUsedW();
sint32 result = getPaddingLeftRight() + Group->getMinUsedW();
if (Border)
result += Border->getLeftRightWidth();
return result;
}
@ -823,24 +829,25 @@ namespace NLGUI
additionnalWidth = (sint32) width;
}
sint32 cellBorderPadding = cell->getPaddingLeftRight();
if (cell->Border)
cellBorderPadding += cell->Border->getLeftRightWidth();
// Get width min and max
if( !cell->IgnoreMaxWidth)
cell->WidthMax = cell->getMaxUsedW() + cell->LeftMargin + cellBorderPadding;
cell->WidthMax = cell->getMaxUsedW() + cell->LeftMargin;
else
cell->WidthMax = cell->WidthWanted + additionnalWidth + cell->LeftMargin;
sint32 cellWidth;
if(!cell->IgnoreMinWidth)
cellWidth = cell->NoWrap ? cell->WidthMax : cell->getMinUsedW() + cell->LeftMargin + cellBorderPadding;
cellWidth = cell->NoWrap ? cell->WidthMax : cell->getMinUsedW() + cell->LeftMargin;
else
cellWidth = cell->NoWrap ? cell->WidthMax : cell->LeftMargin;
{
sint32 cellBorderPadding = cell->getPaddingLeftRight();
if (cell->Border)
cellBorderPadding += cell->Border->getLeftRightWidth();
if (cellWidth < cellBorderPadding)
cellWidth = cellBorderPadding;
}
// New cell ?
if (cell->NewLine)
@ -909,7 +916,9 @@ namespace NLGUI
}
// Additional space contributing to table width
sint32 tableBorderSpacing = Border->getLeftWidth() + Border->getRightWidth();
sint32 tableBorderSpacing = 0;
if (Border)
tableBorderSpacing += Border->getLeftRightWidth();
tableBorderSpacing += ((sint32)_Columns.size()+1) * CellSpacing;;
sint32 innerForceWidthMin = ForceWidthMin;
@ -1122,7 +1131,6 @@ namespace NLGUI
// *** Now we know each column width, resize cells and get the height for each row
column = 0;
// FIXME: real cell padding
sint32 row = 0;
sint32 currentX = 0;
@ -1278,7 +1286,7 @@ namespace NLGUI
if (Border)
{
currentY -= Border->getBottomWidth();
finalWidth += Border->getLeftWidth() + Border->getRightWidth();
finalWidth += Border->getLeftRightWidth();
}
// Resize the table
@ -1413,8 +1421,7 @@ namespace NLGUI
for (i=0; i<columns.size(); i++)
maxWidth += columns[i];
// TODO: CellPadding is probably already in columns width
maxWidth += ((sint32)columns.size()+1) * CellSpacing + ((sint32)columns.size()*2) * CellPadding;
maxWidth += ((sint32)columns.size()+1) * CellSpacing;
if (Border)
maxWidth += Border->getLeftRightWidth();
@ -1461,8 +1468,7 @@ namespace NLGUI
for (i=0; i<columns.size(); i++)
maxWidth += columns[i];
// TODO: CellPadding is probably already in columns width
maxWidth += ((sint32)columns.size()+1) * CellSpacing + ((sint32)columns.size()*2) * CellPadding;
maxWidth += ((sint32)columns.size()+1) * CellSpacing;
if (Border)
maxWidth += Border->getLeftRightWidth();
@ -1701,6 +1707,8 @@ namespace NLGUI
{
uint32 w;
fromString((const char*)ptr, w);
if (!Border)
Border = new CSSBorderRenderer();
Border->setWidth(w, w, w, w);
}
//
@ -1708,6 +1716,8 @@ namespace NLGUI
if (ptr)
{
CRGBA c = convertColor((const char*)ptr);
if (!Border)
Border = new CSSBorderRenderer();
Border->setColor(c, c, c, c);
}
//

Loading…
Cancel
Save