Adds ability to adjust padding to guiTextListCtrl's rows

ForcedMaterialMeshMgr tweaked to allow proper setting of override material
Ongoing WIP of update/fixing of options menus
WIP of expanded visualizers, including material complexity viz
Adds no-pie flag when compiling on linux with non-clang compilers
This commit is contained in:
Areloch 2019-09-06 00:00:17 -05:00
parent 9e1544880e
commit 52fcbecb9f
21 changed files with 912 additions and 487 deletions

View file

@ -125,6 +125,7 @@ GuiTextListCtrl::GuiTextListCtrl()
mColumnOffsets.push_back(0);
mFitParentWidth = true;
mClipColumnText = false;
mRowHeightPadding = 2;
}
void GuiTextListCtrl::initPersistFields()
@ -132,6 +133,7 @@ void GuiTextListCtrl::initPersistFields()
addField("columns", TypeS32Vector, Offset(mColumnOffsets, GuiTextListCtrl), "A vector of column offsets. The number of values determines the number of columns in the table.\n" );
addField("fitParentWidth", TypeBool, Offset(mFitParentWidth, GuiTextListCtrl), "If true, the width of this control will match the width of its parent.\n");
addField("clipColumnText", TypeBool, Offset(mClipColumnText, GuiTextListCtrl), "If true, text exceeding a column's given width will get clipped.\n" );
addField("rowHeightPadding", TypeS32, Offset(mRowHeightPadding, GuiTextListCtrl), "Sets how much padding to add to the row heights on top of the font height");
Parent::initPersistFields();
}
@ -205,7 +207,7 @@ void GuiTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selected,
else
slen = dStrlen(text);
Point2I pos(offset.x + 4 + mColumnOffsets[index], offset.y);
Point2I pos(offset.x + 4 + mColumnOffsets[index], offset.y + mRowHeightPadding / 2);
RectI saveClipRect;
bool clipped = false;
@ -368,7 +370,7 @@ void GuiTextListCtrl::setSize(Point2I newSize)
mCellSize.x = maxWidth + 8;
}
mCellSize.y = mFont->getHeight() + 2;
mCellSize.y = mFont->getHeight() + mRowHeightPadding;
}
Point2I newExtent( newSize.x * mCellSize.x + mHeaderDim.x, newSize.y * mCellSize.y + mHeaderDim.y );

View file

@ -56,6 +56,7 @@ class GuiTextListCtrl : public GuiArrayCtrl
bool mFitParentWidth;
bool mClipColumnText;
S32 mRowHeightPadding;
U32 getRowWidth(Entry *row);
bool cellSelected(Point2I cell);

View file

@ -296,6 +296,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
mTextList = new GuiPopupMenuTextListCtrl();
mTextList->registerObject();
mTextList->setControlProfile(profile);
mTextList->mRowHeightPadding = 5;
mTextList->mPopup = this;
mTextList->mMenuBar = getMenuBarCtrl();

View file

@ -126,9 +126,10 @@ const char* ForcedMaterialMeshMgr::_getOverrideMat( void *object, const char *da
bool ForcedMaterialMeshMgr::_setOverrideMat( void *object, const char *index, const char *data )
{
ForcedMaterialMeshMgr &mgr = *reinterpret_cast<ForcedMaterialMeshMgr *>( object );
BaseMatInstance* material;
Sim::findObject( data, material );
mgr.setOverrideMaterial( material );
Material* material;
Sim::findObject(data, material);
mgr.mOverrideMaterial = material;
return false;
}