Added html HR element

--HG--
branch : develop
hg/feature/material-editor
Nimetu 9 years ago
parent 045a6471fe
commit 2eb56b6460

@ -2032,6 +2032,43 @@ namespace NLGUI
endParagraph(); endParagraph();
} }
break; break;
case HTML_HR:
{
newParagraph(0);
CInterfaceGroup *sep = CWidgetManager::getInstance()->getParser()->createGroupInstance("html_hr", "", NULL, 0);
if (sep)
{
CStyleParams style;
style.TextColor = CRGBA(120, 120, 120, 255);
style.Height = 0;
style.Width = 0;
if (present[HTML_HR_STYLE] && value[HTML_HR_STYLE])
getStyleParams(value[HTML_HR_STYLE], style);
CViewBitmap *bitmap = dynamic_cast<CViewBitmap*>(sep->getView("hr"));
if (bitmap)
{
bitmap->setColor(style.TextColor);
if (style.Width > 0)
{
clamp(style.Width, 1, 32000);
bitmap->setW(style.Width);
bitmap->setSizeRef(CInterfaceElement::none);
}
if (style.Height > 0)
{
clamp(style.Height, 1, 1000);
bitmap->setH(style.Height);
}
}
getParagraph()->addChild(sep);
endParagraph();
}
}
break;
} }
} }
} }

@ -955,6 +955,27 @@
highlight_over="255 255 255 128" highlight_over="255 255 255 128"
force_inside_screen="true" force_inside_screen="true"
/> />
<!-- html <hr> element -->
<template name="html_hr"
keep="true">
<group id="sep_gr"
posref="ML ML"
sizeref="w"
w="0"
h="0"
child_resize_h="true"
child_resize_hmargin="12">
<view type="bitmap"
id="hr"
posref="MM MM"
sizeref="w"
w="-2"
h="2"
inherit_gc_alpha="true"
scale="true"
texture="blank.tga"
global_color="false" />
</group>
</template>
</interface_config> </interface_config>

@ -6927,4 +6927,27 @@
</group> </group>
</group> </group>
</template> </template>
<!-- html <hr> element -->
<!-- html <hr> element -->
<template name="html_hr"
keep="true">
<group id="sep_gr"
posref="ML ML"
sizeref="w"
w="0"
h="0"
child_resize_h="true"
child_resize_hmargin="12">
<view type="bitmap"
id="hr"
posref="MM MM"
sizeref="w"
w="-2"
h="2"
inherit_gc_alpha="true"
scale="true"
texture="blank.tga"
global_color="false" />
</group>
</template>
</interface_config> </interface_config>

Loading…
Cancel
Save