From 29296277aa5d015a93a7afbecc6f81cd46b0a6e5 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Tue, 16 Feb 2010 12:31:46 +0100 Subject: [PATCH] QmlDesigner.propertyEditor: cleaning up Layout.qml --- .../qmldesigner/propertyeditor/Qt/Layout.qml | 262 +++++++++++++++++- 1 file changed, 250 insertions(+), 12 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml index bc133cdd97c..caecee8d153 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml @@ -6,19 +6,257 @@ GroupBox { caption: "layout"; -id: layout; - enabled: anchorBackend.hasParent; - - layout: QVBoxLayout { - topMargin: 20; - bottomMargin: 10; - leftMargin: 40; - rightMargin: 20; - spacing: 20 + id: layout; + enabled: anchorBackend.hasParent; + + layout: VerticalLayout { QLabel { - text: "layout" + text: "Anchors" + } + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + + + AnchorButtons {} + } + } + + QWidget { + visible: anchorBackend.topAnchored; + layout : VerticalLayout { + topMargin: 8; + bottomMargin: 4; + rightMargin: 20; + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + QLabel { + //iconFromFile: "qrc:qmldesigner/images/icon-top.png" + fixedWidth: 32 + fixedHeight: 32 + styleSheet: "border-image: url(:/qmldesigner/images/icon-top.png)"; + } + + Label { + text: "Target" + fixedWidth: 90 - 20 - 32 + } + QComboBox { + } + + } + } + + QWidget { + layout : HorizontalLayout { + IntEditor { + slider: false + caption: "Margin" + } + + PlaceHolder { + fixedWidth: 140 + } + } + } + } + } + QWidget { + visible: anchorBackend.bottomAnchored; + layout : VerticalLayout { + topMargin: 8; + bottomMargin: 4; + rightMargin: 20; + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + QLabel { + //iconFromFile: "qrc:qmldesigner/images/icon-top.png" + fixedWidth: 32 + fixedHeight: 32 + styleSheet: "border-image: url(:/qmldesigner/images/icon-bottom.png)"; + } + + Label { + text: "Target" + fixedWidth: 90 - 20 - 32 + } + QComboBox { + } + + } + } + + QWidget { + layout : HorizontalLayout { + IntEditor { + slider: false + caption: "Margin" + } + + PlaceHolder { + fixedWidth: 140 + } + } + } + } } - AnchorButtons {} - } + QWidget { + visible: anchorBackend.leftAnchored; + layout : VerticalLayout { + topMargin: 8; + bottomMargin: 4; + rightMargin: 20; + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + QLabel { + //iconFromFile: "qrc:qmldesigner/images/icon-top.png" + fixedWidth: 32 + fixedHeight: 32 + styleSheet: "border-image: url(:/qmldesigner/images/icon-left.png)"; + } + Label { + text: "Target" + fixedWidth: 90 - 20 - 32 + } + QComboBox { + } + } + } + + QWidget { + layout : HorizontalLayout { + IntEditor { + slider: false + caption: "Margin" + } + + PlaceHolder { + fixedWidth: 140 + } + } + } + } + } + QWidget { + visible: anchorBackend.rightAnchored; + layout : VerticalLayout { + topMargin: 8; + bottomMargin: 4; + rightMargin: 20; + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + QLabel { + //iconFromFile: "qrc:qmldesigner/images/icon-top.png" + fixedWidth: 32 + fixedHeight: 32 + styleSheet: "border-image: url(:/qmldesigner/images/icon-right.png)"; + } + + Label { + text: "Target" + fixedWidth: 90 - 20 - 32 + } + QComboBox { + } + } + } + + QWidget { + layout : HorizontalLayout { + IntEditor { + slider: false + caption: "Margin" + } + + PlaceHolder { + fixedWidth: 140 + } + } + } + } + } + QWidget { + visible: anchorBackend.horizontalCentered + layout : VerticalLayout { + topMargin: 8; + bottomMargin: 4; + rightMargin: 20; + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + QLabel { + //iconFromFile: "qrc:qmldesigner/images/icon-top.png" + fixedWidth: 32 + fixedHeight: 32 + styleSheet: "border-image: url(:/qmldesigner/images/icon-horizontal.png)"; + } + + Label { + text: "Target" + fixedWidth: 90 - 20 - 32 + } + QComboBox { + } + } + } + + QWidget { + layout : HorizontalLayout { + IntEditor { + slider: false + caption: "Margin" + } + + PlaceHolder { + fixedWidth: 140 + } + } + } + } + } + QWidget { + visible: anchorBackend.verticalCentered + layout : VerticalLayout { + topMargin: 8; + bottomMargin: 4; + rightMargin: 20; + QWidget { + layout: HorizontalLayout { + leftMargin: 10 + QLabel { + //iconFromFile: "qrc:qmldesigner/images/icon-top.png" + fixedWidth: 32 + fixedHeight: 32 + styleSheet: "border-image: url(:/qmldesigner/images/icon-vertical.png)"; + } + + Label { + text: "Target" + fixedWidth: 90 - 20 - 32 + } + QComboBox { + } + } + } + + QWidget { + layout : HorizontalLayout { + IntEditor { + slider: false + caption: "Margin" + } + + PlaceHolder { + fixedWidth: 140 + } + } + } + } + } + } } -- GitLab