Continue waging war on hardcoded sizes

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8444 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-04-25 00:11:44 +00:00
parent 898fcdc8d6
commit 9021f35cac
4 changed files with 20 additions and 12 deletions

View File

@ -34,8 +34,7 @@
<label proportion="1" height="100%" text_align="right" I18N="Music volume in options" text="Volume"/>
<div proportion="1" height="fit" layout="horizontal-row" >
<spacer width="40" height="100%" />
<!-- FIXME: don't hardcode height -->
<gauge id="music_volume" proportion="1" height="40" min_value="1" max_value="10"/>
<gauge id="music_volume" proportion="1" min_value="1" max_value="10"/>
</div>
</div>
@ -44,18 +43,19 @@
<!-- ******** SFX ******** -->
<label width="100%" I18N="Section in audio/video settings submenu" text="Sound Effects"/>
<div width="75%" height="40" layout="horizontal-row" >
<div width="75%" height="fit" layout="horizontal-row" >
<label proportion="1" height="100%" text_align="right" I18N="Next to checkbox in settings menu" text="Enabled"/>
<div proportion="1" height="40" layout="horizontal-row" >
<div proportion="1" height="fit" layout="horizontal-row" >
<spacer width="40" height="100%" />
<!-- FIXME: don't hardcode height -->
<checkbox id="sfx_enabled" width="40" height="40"/>
</div>
</div>
<div width="75%" height="40" layout="horizontal-row" >
<div width="75%" height="fit" layout="horizontal-row" >
<label proportion="1" height="100%" text_align="right" I18N="Sound volume in options" text="Volume"/>
<div proportion="1" height="40" layout="horizontal-row" >
<div proportion="1" height="fit" layout="horizontal-row" >
<spacer width="40" height="100%" />
<gauge id="sfx_volume" proportion="1" height="100%" min_value="1" max_value="10"/>
<gauge id="sfx_volume" proportion="1" min_value="1" max_value="10"/>
</div>
</div>

View File

@ -21,8 +21,7 @@
<!-- ************ SKIN CHOICE ************ -->
<label I18N="In the graphics settings" text="Skin"/>
<!-- FIXME: don't hardcode size -->
<spinner id="skinchoice" width="30%" height="40"/>
<spinner id="skinchoice" width="30%"/>
<spacer width="20" height="40" />

View File

@ -30,11 +30,11 @@
<spacer height="15" width="10"/>
<!-- ************ VSYNC ************ -->
<!-- FIXME don't hardcode height, should depend on text height -->
<div width="75%" height="40" layout="horizontal-row" >
<div width="75%" height="fit" layout="horizontal-row" >
<!-- FIXME don't hardcode height -->
<checkbox id="vsync" width="40" height="40"/>
<spacer width="20" height="100%" />
<label height="100%" I18N="In the video settings" text="Vertical Sync (requires restart)"/>
<label I18N="In the video settings" text="Vertical Sync (requires restart)"/>
</div>
<spacer width="20" height="25"/>
@ -51,6 +51,7 @@
<div width="75%" height="fit" layout="horizontal-row" >
<spacer width="40" height="100%" />
<!-- FIXME don't hardcode height -->
<checkbox id="fullscreen" width="40" height="40"/>
<spacer width="20" height="100%" />
<label height="100%" I18N="In the video settings" text="Fullscreen"/>

View File

@ -163,6 +163,14 @@ void LayoutManager::readCoords(Widget* self)
// lines are required, we need to specify a height explicitely
label_h = dim.Height + self->getHeightNeededAroundLabel();
}
else if (self->getType() == WTYPE_SPINNER)
{
// User text height to guess spinner height
IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont());
core::dimension2d< u32 > dim = font->getDimension( L"X" );
label_h = dim.Height + self->getHeightNeededAroundLabel();
}
if (label_h == -1)
{
if (self->getType() == WTYPE_TEXTBOX ||