fix col/row grid on imported widgets

This commit is contained in:
Sarah Jamie Lewis 2020-07-06 15:47:08 -07:00
parent ca34a58760
commit 232e19d0a9
3 changed files with 13 additions and 18 deletions

View File

@ -2,28 +2,26 @@ Grid {
rows:2
cols:2
Rectangle {
color: "blue"
color: "#F3F0F4"
Text {
anchors.centerIn: parent
text: "Hello, Twitter! 🦀"
}
}
Rectangle {
color: "red"
color: "#281038"
border.color: "#550099"
anchors.centerIn: parent
Image {
id: opimg
anchors.centerIn: parent
opacity: [[rand_opacity()]]
source: "./res/openprivacy.png"
}
}
Rectangle {
color: "red"
color: "#634B72"
}
Rectangle {
color: "blue"
color: "#281038"
Text {
anchors.centerIn: parent
text: "Hello, Twitter! 🦀"

View File

@ -6,15 +6,12 @@ Grid {
}
Rectangle {
color: "blue"
Text {
anchors.centerIn: parent
text: "Hello, World!"
}
HelloTwitter {
}
Rectangle {
color: "blue"
color: "#8c63a4"
Text {
id: target
anchors.centerIn: parent
@ -26,7 +23,7 @@ Grid {
columns: 2
Rectangle {
color: "red"
color: "#634B72"
TextField {
id: tf1
anchors.centerIn: parent
@ -36,7 +33,7 @@ Grid {
}
}
Rectangle {
color: "blue"
color: "#6F4985"
Button {
anchors.centerIn: parent
text: "Hello, World!"
@ -47,7 +44,7 @@ Grid {
}
}
Rectangle {
color: "blue"
color: "#F3F0F4"
Button {
anchors.centerIn: parent
text: "Hello, World!"
@ -58,7 +55,7 @@ Grid {
}
}
Rectangle {
color: "red"
color: "#b29dbe"
Text {
anchors.centerIn: parent
text: "Hello, World!"

View File

@ -16,7 +16,7 @@ impl WidgetBuilder for ImportBuilder {
return Box::new(move |id, ctx, row, col, qmlctx| -> Entity {
let qml_doc = parse_qml(format!("./res/{}.qml", import_source).as_str());
let top_level = qml_doc.children.clone();
QmlWidgetBuilder::new().build(id, 0, 0, top_level[0].0.clone(), top_level[0].1.clone(), ctx, qmlctx.borrow_mut())
QmlWidgetBuilder::new().build(id, row, col, top_level[0].0.clone(), top_level[0].1.clone(), ctx, qmlctx.borrow_mut())
});
}
}