Open chapulina opened 3 years ago
I would like to add a few more observations to this issue:
From what I understand, there might be an issue with anchors being set due to line <line own="left" target="right"/>
where the target is the previous plugin in order, and not the size of the plugin. I am saying this because if we set the anchor <line own="left" target="left"/>"
to all the plugins with target plugin as scene their sizes work as intended.
Loading this config:
Config
```
800
800
scene
docked
false
ogre
scene
0 0 1
0.8 0.8 0.8
-6 0 6 0 0.5 0
pub
500
100
#ff0000
floating
sub
200
300
#00ff00
floating
```
Where one plugin's size is 100x500 and the other is 300x200, results in both plugins having the size 300x200.
This is where the height and width are being applied for anchored plugins:
https://github.com/ignitionrobotics/ign-gui/blob/22434e23832760130c88d38d7c569a049dcec65c/src/Plugin.cc#L474-L481
I checked that
setProperty("width"...
is being set with the correct values to the correctCardItem
s. If I prevent the 2nd plugin's width from being set, both plugins end up with the 1st plugin's width: 500.This pure QML file sets the widths correctly for items anchored the same way as in the example:
QML
Open with `qmlscene` ``` import QtQuick 2.0 Rectangle { id: scene width: 800 height: 800 color: "#cccccc" Rectangle { id: pub anchors.top: scene.top anchors.left: scene.left width: 100 height: 500 color: "#ff0000" } Rectangle { id: sub anchors.top: pub.top anchors.left: pub.right width: 300 height: 200 color: "#00ff00" } } ```
I'm not sure if there's a problem within Qt when setting sizes through C++ after items are anchored, or if we're doing something wrong in
ign-gui
.