allow ELLIPSIS mode through dialogxml
This commit is contained in:
@@ -188,6 +188,7 @@
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ellipsis" type="bool"/>
|
||||
<xs:attribute ref="def-key"/>
|
||||
<xs:attribute name="fromlist" default="none" type="xs:string"/>
|
||||
<xs:attributeGroup ref="rect-size"/>
|
||||
|
@@ -63,6 +63,10 @@ bool cTextMsg::parseAttribute(ticpp::Attribute& attr, std::string tagName, std::
|
||||
else if(val == "left") right_align = false;
|
||||
else throw xBadVal(tagName, attr.Name(), val, attr.Row(), attr.Column(), fname);
|
||||
return true;
|
||||
}else if(attr.Name() == "ellipsis"){
|
||||
std::string val = attr.Value();
|
||||
if(val == "true") text_mode = eTextMode::ELLIPSIS;
|
||||
return true;
|
||||
}
|
||||
return cControl::parseAttribute(attr, tagName, fname);
|
||||
}
|
||||
@@ -118,7 +122,8 @@ void cTextMsg::calculate_layout() {
|
||||
cControl& ctrl = key ? getDialog()->getControl(*key) : *this;
|
||||
msg.replace(pos, 1, ctrl.getAttachedKeyDescription());
|
||||
}
|
||||
if(to_rect.bottom - to_rect.top < 20 && msg.find("|") == std::string::npos){
|
||||
if(text_mode == eTextMode::ELLIPSIS){}
|
||||
else if(to_rect.bottom - to_rect.top < 20 && msg.find("|") == std::string::npos){
|
||||
style.lineHeight = 12;
|
||||
to_rect.left += 3;
|
||||
text_mode = eTextMode::LEFT_BOTTOM;
|
||||
|
@@ -94,6 +94,7 @@ The `<text>` tag accepts the following attributes:
|
||||
* `outline` - See **Common Attributes** above.
|
||||
* `underline` - If true, the text will be underlined.
|
||||
* `align` - `right` or `left`. Defaults to `left`.
|
||||
* `ellipsis` - If true, instead of wrapping overflow, truncate to one line with '...'
|
||||
* `fromlist`, `font`, `size`, `color`, `colour`, `def-key` -
|
||||
See **Common Attributes** above.
|
||||
|
||||
|
Reference in New Issue
Block a user