Commit 4b232e56 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.PropertyEditor: fixing layout issues

There were serious layout issues in the property editor.
While not 100% reliable reproducible they were quite annoying (TASK).

The reason for the issues were the existence of several QtQuickViews and
changing visibility of items.
The pane for Item and the empty pane for no selection use different
QtQuickViews in a StackWidget. Somehow visibility of items is not always
updated properly when changing the QtQuickView in the stack.

Solution: Do not use visibility but stack order instead.
For the layout margins/targets all controls are now always visible, but
unused margins/targets get disabled.

Task-number: QTBUG-36141
Change-Id: Iec62b81796301aaf483606d9aca5a4ad3572e98b
Reviewed-by: default avatarJan Arve Sæther <jan-arve.saether@digia.com>
parent 8d04b65a
......@@ -43,6 +43,8 @@ import HelperWidgets 2.0
ButtonRow {
enabled: anchorBackend.hasParent
opacity: enabled ? 1 : 0.5
id: buttonRow
ButtonRowButton {
......
......@@ -31,7 +31,7 @@ import QtQuick 2.1
import QtQuick.Controls 1.0 as Controls
import QtQuick.Layouts 1.0
Row {
RowLayout {
id: buttonRow
......@@ -40,6 +40,7 @@ Row {
property int initalChecked: 0
property int checkedIndex: -1
spacing: 0
onCheckedIndexChanged: {
__checkButton(checkedIndex)
......
......@@ -62,25 +62,28 @@ Item {
return index() === (parent.children.length - 1);
}
RoundedPanel {
roundLeft: isFirst() && buttonRowButton.roundLeftButton
roundRight: isLast()
Item {
anchors.fill: parent
visible: checked
RoundedPanel {
roundLeft: isFirst() && buttonRowButton.roundLeftButton
roundRight: isLast()
anchors.fill: parent
z: checked ? 1 : 0
gradient: Gradient {
GradientStop {color: '#444' ; position: 0}
GradientStop {color: '#333' ; position: 1}
gradient: Gradient {
GradientStop {color: '#444' ; position: 0}
GradientStop {color: '#333' ; position: 1}
}
}
}
RoundedPanel {
roundLeft: isFirst()
roundRight: isLast()
RoundedPanel {
roundLeft: isFirst()
roundRight: isLast()
anchors.fill: parent
visible: !checked
anchors.fill: parent
z: !checked ? 1 : 0
}
}
Image {
......
......@@ -71,7 +71,6 @@ Section {
SectionLayout {
columns: 2
rows: 3
Label {
text: qsTr("Font")
}
......@@ -104,18 +103,26 @@ Section {
sizeWidget.setPointPixelSize();
}
SpinBox {
minimumValue: 0
visible: !sizeWidget.pixelSize
maximumValue: 400
backendValue: pointSize
}
Item {
width: sizeSpinBox.width
height: sizeSpinBox.height
SpinBox {
id: sizeSpinBox
minimumValue: 0
//visible: !sizeWidget.pixelSize
z: !sizeWidget.pixelSize ? 1 : 0
maximumValue: 400
backendValue: pointSize
}
SpinBox {
minimumValue: 0
visible: sizeWidget.pixelSize
maximumValue: 400
backendValue: pixelSize
SpinBox {
minimumValue: 0
//visible: sizeWidget.pixelSize
z: sizeWidget.pixelSize ? 1 : 0
maximumValue: 400
backendValue: pixelSize
}
}
Controls.ComboBox {
......
......@@ -60,7 +60,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.topAnchored;
enabled: anchorBackend.topAnchored;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-top.png"
......@@ -116,7 +117,8 @@ Section {
}
RowLayout {
visible: anchorBackend.bottomAnchored;
enabled: anchorBackend.bottomAnchored;
opacity: enabled ? 1 : 0.5
anchors.left: parent.left
anchors.right: parent.right
......@@ -174,7 +176,8 @@ Section {
}
RowLayout {
visible: anchorBackend.leftAnchored;
enabled: anchorBackend.leftAnchored;
opacity: enabled ? 1 : 0.5
anchors.left: parent.left
anchors.right: parent.right
......@@ -234,7 +237,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.rightAnchored;
enabled: anchorBackend.rightAnchored;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-right.png"
......@@ -291,7 +295,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.horizontalCentered;
enabled: anchorBackend.horizontalCentered;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-horizontal.png"
......@@ -348,7 +353,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.verticalCentered;
enabled: anchorBackend.verticalCentered;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-vertical.png"
......
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