Use a Component for Explicit Spacers
A component has the advantage that the width property can depend from other properties. This does not work with the previous on the fly construction as the width does not update when the referenced property changes.
This commit is contained in:
parent
bcdc74f8d6
commit
728b47ef07
1 changed files with 9 additions and 1 deletions
|
@ -22,7 +22,7 @@ Item {
|
|||
var component = undefined;
|
||||
switch (buttons.charAt(i)) {
|
||||
case "_":
|
||||
var button = Qt.createQmlObject("import QtQuick 1.1; Item{ width: " + group.explicitSpacer + "; height: parent.height}", groupRow, "dynamicGroup_" + buttons + i);
|
||||
component = explicitSpacerComponent;
|
||||
break;
|
||||
case "A":
|
||||
component = group.maximizeButton;
|
||||
|
@ -85,4 +85,12 @@ Item {
|
|||
}
|
||||
createButtons();
|
||||
}
|
||||
|
||||
Component {
|
||||
id: explicitSpacerComponent
|
||||
Item {
|
||||
width: group.explicitSpacer
|
||||
height: groupRow.height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue