some test with solving space issues on small resolutions

This commit is contained in:
mrxx99 2018-12-03 22:24:57 +01:00
parent 2e3713840f
commit f6b6526681
4 changed files with 38 additions and 1 deletions

View File

@ -76,7 +76,7 @@
<!-- Race options box --> <!-- Race options box -->
<box width="100%" height="43%" layout="vertical-row"> <box width="100%" height="43%" layout="vertical-row">
<div width="100%" height="fit" layout="horizontal-row" > <div width="100%" height="fit" layout="horizontal-row" >
<div proportion="1" height="fit" layout="horizontal-row"> <div proportion="3" height="fit" layout="horizontal-row">
<spinner id="target-type-spinner" width="100%" min_value="1" max_value="10" align="center" <spinner id="target-type-spinner" width="100%" min_value="1" max_value="10" align="center"
wrap_around="true" /> wrap_around="true" />
</div> </div>

View File

@ -176,6 +176,22 @@ bool Widget::deleteChild(const char* id)
return false; return false;
} }
bool Widget::collapse()
{
//const int count = m_children.size();
//for (int n = 0; n < count; n++)
//{
// m_children.erase(n);
//}
//m_element = NULL;
auto parent = m_element->getParent();
parent->removeChild(m_element);
return true;
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
namespace GUIEngine namespace GUIEngine
{ {
@ -342,6 +358,18 @@ void Widget::setVisible(bool visible)
} }
} }
// -----------------------------------------------------------------------------
void Widget::setCollapsed(bool collapsed)
{
if (m_element != NULL)
{
m_element->setEnabled(!collapsed);
}
//m_is_visible = collapsed;
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void Widget::moveIrrlichtElement() void Widget::moveIrrlichtElement()

View File

@ -344,6 +344,10 @@ namespace GUIEngine
*/ */
virtual void setVisible(bool visible); virtual void setVisible(bool visible);
virtual bool collapse();
virtual void setCollapsed(bool collapsed);
/** Returns if the element is visible. */ /** Returns if the element is visible. */
bool isVisible() const; bool isVisible() const;

View File

@ -175,6 +175,11 @@ void TrackInfoScreen::init()
m_target_value_spinner->setValue(UserConfigParams::m_num_goals); m_target_value_spinner->setValue(UserConfigParams::m_num_goals);
} }
} }
//else
/* {
m_target_type_spinner->collapse();
m_target_type_label->collapse();
}*/
// Lap count m_lap_spinner // Lap count m_lap_spinner
// ----------------------- // -----------------------