Commit dad2c3ea authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.propertyEditor: implementing new anchoring

parent 34336e1e
......@@ -5,7 +5,7 @@ QWidget {
width:220;fixedWidth: width
height:220;fixedHeight: height
styleSheetFile: "anchorbox.css"
Script {
function isBorderAnchored() {
return anchorBackend.leftAnchored || anchorBackend.topAnchored || anchorBackend.rightAnchored || anchorBackend.bottomAnchored;
......
import Qt 4.6
import Bauhaus 1.0
QWidget {
id: anchorButtons
fixedHeight: 32
Script {
function isBorderAnchored() {
return anchorBackend.leftAnchored || anchorBackend.topAnchored || anchorBackend.rightAnchored || anchorBackend.bottomAnchored;
}
function fill() {
anchorBackend.fill();
}
function breakLayout() {
anchorBackend.resetLayout()
}
}
QPushButton {
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchortop.css";
checked: anchorBackend.topAnchored;
onToggled: {
if (checked) {
anchorBackend.verticalCentered = false;
anchorBackend.topAnchored = true;
} else {
anchorBackend.topAnchored = false;
}
}
}
QPushButton {
x: 32
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorbottom.css";
checked: anchorBackend.bottomAnchored;
onToggled: {
if (checked) {
anchorBackend.verticalCentered = false;
anchorBackend.bottomAnchored = true;
} else {
anchorBackend.bottomAnchored = false;
}
}
}
QPushButton {
x: 64
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorleft.css";
checked: anchorBackend.leftAnchored;
onToggled: {
if (checked) {
anchorBackend.horizontalCentered = false;
anchorBackend.leftAnchored = true;
} else {
anchorBackend.leftAnchored = false;
}
}
}
QPushButton {
x: 96
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorright.css";
checked: anchorBackend.rightAnchored;
onToggled: {
if (checked) {
anchorBackend.horizontalCentered = false;
anchorBackend.rightAnchored = true;
} else {
anchorBackend.rightAnchored = false;
}
}
}
QPushButton {
x: 128
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorspacer.css";
}
QPushButton {
x: 128 + 21
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorfill.css";
onReleased: fill();
}
QPushButton {
x: 128 + 21 + 32
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorspacer.css";
}
QPushButton {
x: 128 + 42 + 32
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorhorizontal.css";
checked: anchorBackend.horizontalCentered;
onToggled: {
if (checked) {
anchorBackend.leftAnchored = false;
anchorBackend.rightAnchored = false;
anchorBackend.horizontalCentered = true;
} else {
anchorBackend.horizontalCentered = false;
}
}
}
QPushButton {
x: 128 + 42 + 64
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "anchorvertical.css";
checked: anchorBackend.verticalCentered;
onToggled: {
if (checked) {
anchorBackend.topAnchored = false;
anchorBackend.bottomAnchored = false;
anchorBackend.verticalCentered = true;
} else {
anchorBackend.verticalCentered = false;
}
}
}
}
......@@ -9,7 +9,6 @@ GroupBox {
caption: "Layout";
>>>>>>> QmlDesigner.propertyEditor: ids have to be lower case:share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml
id: layout;
minimumHeight: 280;
enabled: anchorBackend.hasParent;
layout: QVBoxLayout {
......@@ -21,7 +20,7 @@ id: layout;
QLabel {
text: "layout"
}
AnchorBox {}
AnchorButtons {}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment