add font style
This commit is contained in:
parent
13c33adedd
commit
e7dc7e957e
@ -20,6 +20,19 @@ TextArea {
|
|||||||
|
|
||||||
property int textAlignment: 0
|
property int textAlignment: 0
|
||||||
|
|
||||||
|
property var fontStyle: ""
|
||||||
|
|
||||||
|
onFontStyleChanged: {
|
||||||
|
if (fontStyle === "bold") {
|
||||||
|
font.weight = Font.Bold
|
||||||
|
} else if (fontStyle === "italic") {
|
||||||
|
font.italic = true
|
||||||
|
} else if (fontStyle === "bold_italic") {
|
||||||
|
font.weight = Font.Bold
|
||||||
|
font.italic = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: bg
|
id: bg
|
||||||
color: 'transparent'
|
color: 'transparent'
|
||||||
|
@ -30,6 +30,8 @@ void DoricTextNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
|||||||
view->setProperty("font", QVariant(font));
|
view->setProperty("font", QVariant(font));
|
||||||
} else if (name == "textAlignment") {
|
} else if (name == "textAlignment") {
|
||||||
view->setProperty("textAlignment", prop.toInt());
|
view->setProperty("textAlignment", prop.toInt());
|
||||||
|
} else if (name == "fontStyle") {
|
||||||
|
view->setProperty("fontStyle", prop.toString());
|
||||||
} else {
|
} else {
|
||||||
DoricViewNode::blend(view, name, prop);
|
DoricViewNode::blend(view, name, prop);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user