Feature #367 ยป allow_zero_auto_width_labels.patch
xbmc/guilib/GUILabelControl.cpp (working copy) | ||
---|---|---|
else if (m_bHasPath)
|
||
label = ShortenPath(label);
|
||
m_label.SetMaxRect(m_posX, m_posY, m_width, m_height);
|
||
m_label.SetMaxRect(m_posX, m_posY, GetWidth(), m_height);
|
||
m_label.SetText(label);
|
||
}
|
||
void CGUILabelControl::Render()
|
||
{
|
||
m_label.SetColor(IsDisabled() ? CGUILabel::COLOR_DISABLED : CGUILabel::COLOR_TEXT);
|
||
m_label.SetMaxRect(m_posX, m_posY, m_width, m_height);
|
||
m_label.SetMaxRect(m_posX, m_posY, GetWidth(), m_height);
|
||
m_label.Render();
|
||
CGUIControl::Render();
|
||
}
|
||
... | ... | |
float CGUILabelControl::GetWidth() const
|
||
{
|
||
if (m_minWidth && m_minWidth != m_width)
|
||
return CLAMP(m_label.GetTextWidth(), m_minWidth, m_width);
|
||
{
|
||
float maxWidth = m_width ? m_width : m_label.GetTextWidth();
|
||
return CLAMP(m_label.GetTextWidth(), m_minWidth, maxWidth);
|
||
}
|
||
return m_width;
|
||
}
|
||