mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-27 19:30:54 +00:00
Added html HR element
--HG-- branch : develop
This commit is contained in:
parent
045a6471fe
commit
2eb56b6460
3 changed files with 82 additions and 1 deletions
|
@ -2032,6 +2032,43 @@ namespace NLGUI
|
|||
endParagraph();
|
||||
}
|
||||
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"
|
||||
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>
|
||||
|
|
|
@ -6927,4 +6927,27 @@
|
|||
</group>
|
||||
</group>
|
||||
</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>
|
||||
|
|
Loading…
Reference in a new issue