flutter: A view can now be positioned and sized

This commit is contained in:
Sergio Martins
2022-07-31 12:12:23 +01:00
parent 3c51d201d5
commit 120557b8a6
4 changed files with 24 additions and 10 deletions

View File

@@ -31,14 +31,27 @@ class View_flutter extends KDDockWidgetBindings.View_flutter {
}
View_flutter.fromCppPointer(var cppPointer, [var needsAutoDelete = false])
: super.fromCppPointer(cppPointer, needsAutoDelete) {}
: super.fromCppPointer(cppPointer, needsAutoDelete) {
flutterWidget = PositionedWidget(this);
}
setSize_2(int width, int height) {
print("View_flutter::setSize called ${width}x${height}");
if (m_width != width || m_height != height) {
m_height = height;
m_width = width;
m_height = height;
if (updateSizeCallback != null) updateSizeCallback!(width, height);
}
}
move_2(int x, int y) {
print("View_flutter::move called ${x},${y}");
if (m_x != x || m_y != y) {
m_x = x;
m_y = y;
print(updatePositionCallback);
print(updateSizeCallback);
if (updatePositionCallback != null) updatePositionCallback!(x, y);
}
}
}