Fixed the 'property overloading' in GUI XML files that caused a couple internal strings to be exported to pot files, confusing translators
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4476 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
3b493616e2
commit
3f28d198f4
@ -7,7 +7,7 @@
|
||||
|
||||
<box proportion="1" width="100%" layout="vertical-row">
|
||||
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
||||
I18N="Ignore" text="bottom" align="center" child_width="160" child_height="120" />
|
||||
label_location="bottom" align="center" child_width="160" child_height="120" />
|
||||
<spacer width="20" height="13" />
|
||||
</box>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<box id="animated_area" width="100%" proportion="1" layout="vertical-row">
|
||||
|
||||
<ribbon_grid id="challenges" proportion="3" width="100%"
|
||||
I18N="Ignore" text="bottom" align="center" child_width="128" child_height="128" />
|
||||
label_location="bottom" align="center" child_width="128" child_height="128" />
|
||||
|
||||
<spacer proportion="1" width="100%"/>
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
<label proportion="1" height="100%" I18N="In the video settings" text="Fullscreen"/>
|
||||
</div>
|
||||
|
||||
<scrollable_ribbon id="resolutions" proportion="2" I18N="Ignore" text="all"
|
||||
<scrollable_ribbon id="resolutions" proportion="2" label_location="each"
|
||||
width="100%" square_items="false"
|
||||
align="center" child_width="128" child_height="128" max_height="150" />
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<box proportion="1" width="100%" layout="vertical-row">
|
||||
|
||||
<scrollable_ribbon id="devices" proportion="3" I18N="Ignore" text="all" width="100%"
|
||||
<scrollable_ribbon id="devices" proportion="3" label_location="each" width="100%"
|
||||
square_items="false" align="center" child_width="256" child_height="128" />
|
||||
|
||||
|
||||
|
@ -30,7 +30,8 @@
|
||||
|
||||
<label width="100%" height="25" text="Select a game mode" align="center" text_align="left" />
|
||||
|
||||
<scrollable_toolbar id="gamemode" height="135" width="85%" text="bottom" align="center" child_width="135" child_height="135" />
|
||||
<scrollable_toolbar id="gamemode" height="135" width="85%" label_location="bottom" align="center"
|
||||
child_width="135" child_height="135" />
|
||||
|
||||
|
||||
<spacer proportion="2" width="25"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
<box proportion="1" width="100%" layout="vertical-row">
|
||||
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
||||
I18N="Ignore" text="bottom" align="center" child_width="160" child_height="120" />
|
||||
label_location="bottom" align="center" child_width="160" child_height="120" />
|
||||
<spacer width="20" height="13" />
|
||||
</box>
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
_______________________________________________________
|
||||
Internal constant Name in XML files
|
||||
_______________________________________________________
|
||||
|
||||
WTYPE_RIBBON "ribbon", "buttonbar", "tabs"
|
||||
appears an horizontal bar containing elements laid in a row, each being and icon and/or a label
|
||||
the "ribbon" subcategory will behave a bit like a radio button group, i.e. one element must selected.
|
||||
@ -81,14 +82,15 @@ Builds uponc the basic Ribbon to be more dynamic (dynamics contents, possibly wi
|
||||
NOT of spawn type (<ribbon_grid .../>), contents must be programmatically set at runtime.
|
||||
Property PROP_SQUARE can be set to tell the engine if the ribbon's contents are rectangular or icons (this will
|
||||
affect the type of highlighting used).
|
||||
PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT are mandatory (so at least aspect ratio of elements that will later be added is nown)
|
||||
An interesting aspect of PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT is that you can use them to show textures to any aspect ratio
|
||||
you want (so you can e.g. save textures to a power-of-two size like 256x256, but then show it in 4:3 ratio).
|
||||
Supports an optional label at the bottom if PROP_TEXT is set. Gives a special meaning to the text parameter. A value of "bottom"
|
||||
means to display the name of the selected icon at the bottom. A value of "all" means that each icon shall have its name under it.
|
||||
The "scrollable_ribbon" and "scrollable_toolbar" subtypes are single-line scrollable ribbons. The difference between both is that
|
||||
'scrollable_ribbon' always has a value selected (like in a combo box, or radio buttons), while 'scrollable_toolbar' is a
|
||||
scrollable list of buttons that can be pressed to trigger actions.
|
||||
PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT are mandatory (so at least aspect ratio of elements that will later be added
|
||||
is nown) An interesting aspect of PROP_CHILD_WIDTH and PROP_CHILD_HEIGHT is that you can use them to show textures
|
||||
to any aspect ratio you want (so you can e.g. save textures to a power-of-two size like 256x256, but then show it
|
||||
in 4:3 ratio).
|
||||
Supports an optional label at the bottom if PROP_LABELS_LOCATION is set (see more on PROP_LABELS_LOCATION below).
|
||||
The "scrollable_ribbon" and "scrollable_toolbar" subtypes are single-line
|
||||
scrollable ribbons. The difference between both is that 'scrollable_ribbon' always has a value selected (like in
|
||||
a combo box, or radio buttons), while 'scrollable_toolbar' is a scrollable list of buttons that can be pressed to
|
||||
trigger actions.
|
||||
|
||||
WTYPE_MODEL_VIEW "model"
|
||||
Displays a model. Currently incomplete. Contents must be set programmatically.
|
||||
@ -119,6 +121,7 @@ relative to the /data directory of STK.
|
||||
|
||||
PROP_TEXT_ALIGN "text_align"
|
||||
used exclusively by label components. Value can be "right" or "center" (left used if not specified).
|
||||
|
||||
PROP_WORD_WRAP "word_wrap"
|
||||
used exclusively by label components. Value can be "true" to indicate that long text should spawn on
|
||||
multiple lines.
|
||||
@ -182,11 +185,16 @@ remaining space according to their proportions.
|
||||
|
||||
PROP_SQUARE "square_items"
|
||||
Valid on Ribbons or RibbonGrids. Can be "true" (omitting it means "false"). Indicates whether the contents
|
||||
use rectangular icons (this will affect the type of focus/highlighting used)
|
||||
use rectangular icons as opposed to "round" icons (this will affect the type of focus/highlighting used)
|
||||
|
||||
PROP_EXTEND_LABEL "extend_label"
|
||||
How many pixels the label is allowed to expand beyond the boundaries of the widget itself. Currently only
|
||||
allowed on icon widgets,
|
||||
allowed on icon widgets.
|
||||
|
||||
PROP_LABELS_LOCATION "label_location"
|
||||
Currently only used by dynamic ribbons. Decides where the label is. Value can be "each", "bottom", or "none"
|
||||
(if ommitted, "none" is the default). "each" means that every item has its own label. "bottom" means there
|
||||
is a single label for all at the bottom, that displays the name of the current item.
|
||||
|
||||
+--------------------------+
|
||||
+ Using the Engine in Code +
|
||||
|
@ -184,6 +184,7 @@ if(prop_name != NULL) widget.m_properties[prop_flag] = prop_name; else widget.m_
|
||||
READ_PROPERTY(max_width, PROP_MAX_WIDTH);
|
||||
READ_PROPERTY(max_height, PROP_MAX_HEIGHT);
|
||||
READ_PROPERTY(extend_label, PROP_EXTEND_LABEL);
|
||||
READ_PROPERTY(label_location, PROP_LABELS_LOCATION);
|
||||
#undef READ_PROPERTY
|
||||
|
||||
const char* text = xml->getAttributeValue( "text" );
|
||||
|
@ -72,7 +72,8 @@ namespace GUIEngine
|
||||
PROP_MAX_WIDTH,
|
||||
PROP_MAX_HEIGHT,
|
||||
PROP_SQUARE,
|
||||
PROP_EXTEND_LABEL
|
||||
PROP_EXTEND_LABEL,
|
||||
PROP_LABELS_LOCATION
|
||||
};
|
||||
|
||||
bool isWithinATextBox();
|
||||
|
@ -55,7 +55,12 @@ void DynamicRibbonWidget::add()
|
||||
{
|
||||
//printf("****DynamicRibbonWidget::add()****\n");
|
||||
|
||||
m_has_label = (m_text == "bottom");
|
||||
m_has_label = (m_properties[PROP_LABELS_LOCATION] == "bottom");
|
||||
|
||||
assert( m_properties[PROP_LABELS_LOCATION] == "bottom" ||
|
||||
m_properties[PROP_LABELS_LOCATION] == "each" ||
|
||||
m_properties[PROP_LABELS_LOCATION] == "none" ||
|
||||
m_properties[PROP_LABELS_LOCATION] == "");
|
||||
|
||||
if (m_has_label)
|
||||
{
|
||||
@ -235,7 +240,9 @@ void DynamicRibbonWidget::setSubElements()
|
||||
icon->w = atoi(icon->m_properties[PROP_WIDTH].c_str());
|
||||
icon->h = atoi(icon->m_properties[PROP_HEIGHT].c_str());
|
||||
|
||||
if (m_text == "all") icon->m_text = " "; // FIXME: what's that??
|
||||
// If we want each icon to have its own label, we must make it non-empty, otherwise
|
||||
// it will assume there is no label and none will be created (FIXME: that's ugly)
|
||||
if (m_properties[PROP_LABELS_LOCATION] == "each") icon->m_text = " ";
|
||||
|
||||
// std::cout << "ribbon text = " << m_properties[PROP_TEXT].c_str() << std::endl;
|
||||
|
||||
|
@ -1408,6 +1408,7 @@
|
||||
9507E9260FC1C8C100BD2B92 /* OpenGL */,
|
||||
95C2AC6E0F296541000D3E5D /* src */,
|
||||
);
|
||||
includeInIndex = 0;
|
||||
name = bullet;
|
||||
path = ../../bullet;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user