Continue waging war on hardcoded sizes
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8445 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
9021f35cac
commit
f7a9c6bcbd
@ -26,19 +26,19 @@
|
|||||||
<spacer width="20" height="40" />
|
<spacer width="20" height="40" />
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
<checkbox id="showfps" width="40" height="40"/>
|
<checkbox id="showfps"/>
|
||||||
<spacer width="20" height="100%" />
|
<spacer width="20" height="100%" />
|
||||||
<label height="100%" I18N="In the ui settings" text="Display FPS"/>
|
<label height="100%" I18N="In the ui settings" text="Display FPS"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
<checkbox id="enable-internet" width="40" height="40"/>
|
<checkbox id="enable-internet"/>
|
||||||
<spacer width="20" height="100%" />
|
<spacer width="20" height="100%" />
|
||||||
<label height="100%" I18N="In the ui settings" text="Internet STK news"/>
|
<label height="100%" I18N="In the ui settings" text="Internet STK news"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div width="75%" height="40" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
<checkbox id="minimal-racegui" width="40" height="40"/>
|
<checkbox id="minimal-racegui"/>
|
||||||
<spacer width="20" height="100%" />
|
<spacer width="20" height="100%" />
|
||||||
<label height="100%" I18N="In the ui settings" text="Minimal Race GUI"/>
|
<label height="100%" I18N="In the ui settings" text="Minimal Race GUI"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,17 +22,14 @@
|
|||||||
<div width="75%" height="50" layout="horizontal-row" >
|
<div width="75%" height="50" layout="horizontal-row" >
|
||||||
<label I18N="In the graphics settings" text="Graphical Effects Settings"/>
|
<label I18N="In the graphics settings" text="Graphical Effects Settings"/>
|
||||||
<spacer width="20" height="20"/>
|
<spacer width="20" height="20"/>
|
||||||
|
<gauge id="gfx_level" min_value="1" max_value="5" width="300" />
|
||||||
<!-- FIXME: don't hardcode size -->
|
|
||||||
<gauge id="gfx_level" min_value="1" max_value="5" width="300" height="50"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<spacer height="15" width="10"/>
|
<spacer height="15" width="10"/>
|
||||||
|
|
||||||
<!-- ************ VSYNC ************ -->
|
<!-- ************ VSYNC ************ -->
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
<!-- FIXME don't hardcode height -->
|
<checkbox id="vsync"/>
|
||||||
<checkbox id="vsync" width="40" height="40"/>
|
|
||||||
<spacer width="20" height="100%" />
|
<spacer width="20" height="100%" />
|
||||||
<label I18N="In the video settings" text="Vertical Sync (requires restart)"/>
|
<label I18N="In the video settings" text="Vertical Sync (requires restart)"/>
|
||||||
</div>
|
</div>
|
||||||
@ -51,8 +48,7 @@
|
|||||||
|
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
<spacer width="40" height="100%" />
|
<spacer width="40" height="100%" />
|
||||||
<!-- FIXME don't hardcode height -->
|
<checkbox id="fullscreen"/>
|
||||||
<checkbox id="fullscreen" width="40" height="40"/>
|
|
||||||
<spacer width="20" height="100%" />
|
<spacer width="20" height="100%" />
|
||||||
<label height="100%" I18N="In the video settings" text="Fullscreen"/>
|
<label height="100%" I18N="In the video settings" text="Fullscreen"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,19 +163,21 @@ void LayoutManager::readCoords(Widget* self)
|
|||||||
// lines are required, we need to specify a height explicitely
|
// lines are required, we need to specify a height explicitely
|
||||||
label_h = dim.Height + self->getHeightNeededAroundLabel();
|
label_h = dim.Height + self->getHeightNeededAroundLabel();
|
||||||
}
|
}
|
||||||
else if (self->getType() == WTYPE_SPINNER)
|
else if (self->getType() == WTYPE_CHECKBOX)
|
||||||
{
|
{
|
||||||
// User text height to guess spinner height
|
// User text height to guess checkbox size
|
||||||
IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont());
|
IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont());
|
||||||
core::dimension2d< u32 > dim = font->getDimension( L"X" );
|
core::dimension2d< u32 > dim = font->getDimension( L"X" );
|
||||||
label_h = dim.Height + self->getHeightNeededAroundLabel();
|
label_h = dim.Height + self->getHeightNeededAroundLabel();
|
||||||
|
label_w = label_h; // a checkbox is square
|
||||||
}
|
}
|
||||||
|
|
||||||
if (label_h == -1)
|
if (label_h == -1)
|
||||||
{
|
{
|
||||||
if (self->getType() == WTYPE_TEXTBOX ||
|
if (self->getType() == WTYPE_TEXTBOX ||
|
||||||
self->getType() == WTYPE_BUTTON ||
|
self->getType() == WTYPE_BUTTON ||
|
||||||
self->getType() == WTYPE_LABEL)
|
self->getType() == WTYPE_LABEL ||
|
||||||
|
self->getType() == WTYPE_SPINNER)
|
||||||
{
|
{
|
||||||
IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont());
|
IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont());
|
||||||
|
|
||||||
|
@ -48,6 +48,10 @@ namespace GUIEngine
|
|||||||
|
|
||||||
/** Set whether the checkbox is checked */
|
/** Set whether the checkbox is checked */
|
||||||
void setState(const bool checked) { m_state = checked; }
|
void setState(const bool checked) { m_state = checked; }
|
||||||
|
|
||||||
|
/** When inferring widget size from its label length, this method will be called to
|
||||||
|
* if/how much space must be added to the raw label's size for the widget to be large enough */
|
||||||
|
virtual int getHeightNeededAroundLabel() const { return 10; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user