mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Add font styling options to tables and textlists (#10203)
This commit is contained in:
parent
abfea69e5f
commit
cd0e213a36
3 changed files with 34 additions and 1 deletions
|
@ -56,7 +56,7 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
|
|||
m_font = skin->getFont();
|
||||
if (m_font) {
|
||||
m_font->grab();
|
||||
m_rowheight = m_font->getDimension(L"A").Height + 4;
|
||||
m_rowheight = m_font->getDimension(L"Ay").Height + 4;
|
||||
m_rowheight = MYMAX(m_rowheight, 1);
|
||||
}
|
||||
|
||||
|
@ -586,6 +586,31 @@ void GUITable::setSelected(s32 index)
|
|||
}
|
||||
}
|
||||
|
||||
void GUITable::setOverrideFont(IGUIFont *font)
|
||||
{
|
||||
if (m_font == font)
|
||||
return;
|
||||
|
||||
if (font == nullptr)
|
||||
font = Environment->getSkin()->getFont();
|
||||
|
||||
if (m_font)
|
||||
m_font->drop();
|
||||
|
||||
m_font = font;
|
||||
m_font->grab();
|
||||
|
||||
m_rowheight = m_font->getDimension(L"Ay").Height + 4;
|
||||
m_rowheight = MYMAX(m_rowheight, 1);
|
||||
|
||||
updateScrollBar();
|
||||
}
|
||||
|
||||
IGUIFont *GUITable::getOverrideFont() const
|
||||
{
|
||||
return m_font;
|
||||
}
|
||||
|
||||
GUITable::DynamicData GUITable::getDynamicData() const
|
||||
{
|
||||
DynamicData dyndata;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue