[DEV] update label widget
This commit is contained in:
parent
1cfa68a23f
commit
bfedb5336e
@ -23,6 +23,10 @@ ewol::widget::Label::Label() :
|
|||||||
"",
|
"",
|
||||||
"displayed value string",
|
"displayed value string",
|
||||||
&ewol::widget::Label::onChangePropertyValue),
|
&ewol::widget::Label::onChangePropertyValue),
|
||||||
|
propertyFontSize(this, "font-size",
|
||||||
|
0,
|
||||||
|
"default font size (0=> system default)",
|
||||||
|
&ewol::widget::Label::onChangePropertyFontSize),
|
||||||
m_value(U""),
|
m_value(U""),
|
||||||
m_colorProperty(null),
|
m_colorProperty(null),
|
||||||
m_colorDefaultFgText(-1),
|
m_colorDefaultFgText(-1),
|
||||||
@ -115,6 +119,9 @@ void ewol::widget::Label::onRegenerateDisplay() {
|
|||||||
|
|
||||||
// clean the element
|
// clean the element
|
||||||
m_text.reset();
|
m_text.reset();
|
||||||
|
if (propertyFontSize.get() != 0) {
|
||||||
|
m_text.setFontSize(propertyFontSize.get());
|
||||||
|
}
|
||||||
if (m_colorProperty != null) {
|
if (m_colorProperty != null) {
|
||||||
m_text.setDefaultColorFg(m_colorProperty->get(m_colorDefaultFgText));
|
m_text.setDefaultColorFg(m_colorProperty->get(m_colorDefaultFgText));
|
||||||
m_text.setDefaultColorBg(m_colorProperty->get(m_colorDefaultBgText));
|
m_text.setDefaultColorBg(m_colorProperty->get(m_colorDefaultBgText));
|
||||||
@ -159,6 +166,10 @@ void ewol::widget::Label::onChangePropertyValue() {
|
|||||||
requestUpdateSize();
|
requestUpdateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ewol::widget::Label::onChangePropertyFontSize() {
|
||||||
|
onChangePropertyValue();
|
||||||
|
}
|
||||||
|
|
||||||
void ewol::widget::Label::onChangePropertyAutoTranslate() {
|
void ewol::widget::Label::onChangePropertyAutoTranslate() {
|
||||||
onChangePropertyValue();
|
onChangePropertyValue();
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ namespace ewol {
|
|||||||
public: // properties
|
public: // properties
|
||||||
eproperty::Value<bool> propertyAutoTranslate; //!< if at true the data is translate automaticaly translate.
|
eproperty::Value<bool> propertyAutoTranslate; //!< if at true the data is translate automaticaly translate.
|
||||||
eproperty::Value<etk::String> propertyValue; //!< decorated text to display.
|
eproperty::Value<etk::String> propertyValue; //!< decorated text to display.
|
||||||
|
eproperty::Value<int32_t> propertyFontSize; //!< default size of the font.
|
||||||
private:
|
private:
|
||||||
ewol::compositing::Text m_text; //!< Compositing text element.
|
ewol::compositing::Text m_text; //!< Compositing text element.
|
||||||
etk::UString m_value;
|
etk::UString m_value;
|
||||||
@ -56,6 +57,7 @@ namespace ewol {
|
|||||||
protected:
|
protected:
|
||||||
virtual void onChangePropertyValue();
|
virtual void onChangePropertyValue();
|
||||||
virtual void onChangePropertyAutoTranslate();
|
virtual void onChangePropertyAutoTranslate();
|
||||||
|
virtual void onChangePropertyFontSize();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user