forked from qt-creator/qt-creator
QmlDesigner: Use new combobox for layout properties
Change-Id: I52e353011b290a59c66003db8b2becd4cd160820 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
a93e9d7a7a
commit
868b07853d
@@ -27,6 +27,7 @@ import QtQuick 2.0
|
|||||||
import HelperWidgets 2.0
|
import HelperWidgets 2.0
|
||||||
import QtQuick.Layouts 1.0
|
import QtQuick.Layouts 1.0
|
||||||
import QtQuick.Controls 1.0 as Controls
|
import QtQuick.Controls 1.0 as Controls
|
||||||
|
import StudioControls 1.0 as StudioControls
|
||||||
|
|
||||||
SectionLayout {
|
SectionLayout {
|
||||||
property bool isInModel: backendValue.isInModel;
|
property bool isInModel: backendValue.isInModel;
|
||||||
@@ -40,7 +41,7 @@ SectionLayout {
|
|||||||
onBackendValueChanged: evaluateAlignment()
|
onBackendValueChanged: evaluateAlignment()
|
||||||
onValueFromBackendChanged: evaluateAlignment()
|
onValueFromBackendChanged: evaluateAlignment()
|
||||||
|
|
||||||
property int spinBoxWidth: 62
|
property int spinBoxWidth: 82
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: modelNodeBackend
|
target: modelNodeBackend
|
||||||
@@ -129,40 +130,43 @@ SectionLayout {
|
|||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
|
|
||||||
Controls.ComboBox {
|
StudioControls.ComboBox {
|
||||||
ColorLogic {
|
ColorLogic {
|
||||||
id: colorLogic
|
id: colorLogic
|
||||||
}
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
ExtendedFunctionButton {
|
ExtendedFunctionLogic {
|
||||||
x: 2
|
id: extFuncLogic
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
backendValue: backendValues.Layout_alignment
|
backendValue: backendValues.Layout_alignment
|
||||||
visible: horizontalAlignmentComboBox.enabled
|
|
||||||
onReseted: {
|
onReseted: {
|
||||||
horizontalAlignmentComboBox.currentIndex = 0
|
horizontalAlignmentComboBox.currentIndex = 0
|
||||||
verticalAlignmentComboBox.currentIndex = 0
|
verticalAlignmentComboBox.currentIndex = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actionIndicator.icon.color: extFuncLogic.color
|
||||||
|
actionIndicator.icon.text: extFuncLogic.glyph
|
||||||
|
actionIndicator.onClicked: extFuncLogic.show()
|
||||||
|
|
||||||
|
actionIndicator.visible: true
|
||||||
|
|
||||||
|
labelColor: horizontalAlignmentComboBox.currentIndex === 0 ? colorLogic.__defaultTextColor : colorLogic.__changedTextColor
|
||||||
|
|
||||||
id: horizontalAlignmentComboBox
|
id: horizontalAlignmentComboBox
|
||||||
|
|
||||||
property bool __isCompleted: false
|
property bool __isCompleted: false
|
||||||
property color textColor: currentIndex === 0 ? colorLogic.__defaultTextColor : colorLogic.__changedTextColor
|
|
||||||
|
|
||||||
model: ["AlignLeft", "AlignHCenter", "AlignRight"]
|
model: ["AlignLeft", "AlignHCenter", "AlignRight"]
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onActivated: {
|
||||||
if (!horizontalAlignmentComboBox.__isCompleted)
|
if (!horizontalAlignmentComboBox.__isCompleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
horizontalAlignmentComboBox.currentIndex = index
|
||||||
composeExpressionString();
|
composeExpressionString();
|
||||||
}
|
}
|
||||||
|
|
||||||
style: CustomComboBoxStyle {
|
|
||||||
textColor: horizontalAlignmentComboBox.textColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
horizontalAlignmentComboBox.__isCompleted = true;
|
horizontalAlignmentComboBox.__isCompleted = true;
|
||||||
}
|
}
|
||||||
@@ -181,36 +185,30 @@ SectionLayout {
|
|||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
|
|
||||||
Controls.ComboBox {
|
StudioControls.ComboBox {
|
||||||
id: verticalAlignmentComboBox
|
id: verticalAlignmentComboBox
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
ExtendedFunctionButton {
|
actionIndicator.icon.color: extFuncLogic.color
|
||||||
x: 2
|
actionIndicator.icon.text: extFuncLogic.glyph
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
actionIndicator.onClicked: extFuncLogic.show()
|
||||||
backendValue: backendValues.Layout_alignment
|
|
||||||
visible: verticalAlignmentComboBox.enabled
|
actionIndicator.visible: true
|
||||||
onReseted: {
|
|
||||||
horizontalAlignmentComboBox.currentIndex = 0
|
labelColor: verticalAlignmentComboBox.currentIndex === 0 ? colorLogic.__defaultTextColor : colorLogic.__changedTextColor
|
||||||
verticalAlignmentComboBox.currentIndex = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool __isCompleted: false
|
property bool __isCompleted: false
|
||||||
property color textColor: currentIndex === 0 ? colorLogic.__defaultTextColor : colorLogic.__changedTextColor
|
|
||||||
|
|
||||||
model: ["AlignVCenter", "AlignTop","AlignBottom","AlignBaseline"]
|
model: ["AlignVCenter", "AlignTop","AlignBottom","AlignBaseline"]
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onActivated: {
|
||||||
if (!verticalAlignmentComboBox.__isCompleted)
|
if (!verticalAlignmentComboBox.__isCompleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
verticalAlignmentComboBox.currentIndex = index
|
||||||
composeExpressionString();
|
composeExpressionString();
|
||||||
}
|
}
|
||||||
|
|
||||||
style: CustomComboBoxStyle {
|
|
||||||
textColor: verticalAlignmentComboBox.textColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
verticalAlignmentComboBox.__isCompleted = true;
|
verticalAlignmentComboBox.__isCompleted = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user