QmlDesigner: PropertyEditor cleanup

* Adapt SpinBox ranges and decimals
 * Add missing qsTr() to labels

Change-Id: If85999a22778b6f61e30f7437905354884086596
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2019-09-02 17:33:23 +02:00
committed by Thomas Hartmann
parent 489c9b2e58
commit 428d8f0307
11 changed files with 55 additions and 50 deletions

View File

@@ -53,8 +53,8 @@ Section {
backendValue: backendValues.scale
hasSlider: true
decimals: 2
minimumValue: 0.01
stepSize: 0.1
minimumValue: -10
maximumValue: 10
Layout.preferredWidth: 140
}

View File

@@ -62,7 +62,7 @@ RowLayout {
property alias buttonRow: buttonRow
readonly property color __defaultTextColor: Theme.color(Theme.PanelTextColorLight)
readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor
IconLabel {
id: icon
@@ -135,13 +135,13 @@ RowLayout {
id: group
}
StudioControls.AbstractButton {
AbstractButton {
id: buttonSameEdge
buttonIcon: verticalAnchor ? StudioTheme.Constants.anchorTop : StudioTheme.Constants.anchorLeft
checkable: true
autoExclusive: true
StudioControls.ButtonGroup.group: group
//tooltip: verticalAnchor ? qsTr("Anchor to the top of the target.") : qsTr("Anchor to the left of the target.")
tooltip: verticalAnchor ? qsTr("Anchor to the top of the target.") : qsTr("Anchor to the left of the target.")
onClicked: {
if (!invertRelativeTargets)
sameEdgeButtonClicked();
@@ -149,22 +149,22 @@ RowLayout {
oppositeEdgeButtonClicked();
}
}
StudioControls.AbstractButton {
AbstractButton {
id: buttonCenter
buttonIcon: verticalAnchor ? StudioTheme.Constants.centerVertical : StudioTheme.Constants.centerHorizontal
checkable: true
autoExclusive: true
StudioControls.ButtonGroup.group: group
//tooltip: verticalAnchor ? qsTr("Anchor to the vertical center of the target.") : qsTr("Anchor to the horizontal center of the target.")
tooltip: verticalAnchor ? qsTr("Anchor to the vertical center of the target.") : qsTr("Anchor to the horizontal center of the target.")
onClicked: centerButtonClicked();
}
StudioControls.AbstractButton {
AbstractButton {
id: buttonOppositeEdge
buttonIcon: verticalAnchor ? StudioTheme.Constants.anchorBottom : StudioTheme.Constants.anchorRight
checkable: true
autoExclusive: true
StudioControls.ButtonGroup.group: group
//tooltip: verticalAnchor ? qsTr("Anchor to the bottom of the target.") : qsTr("Anchor to the right of the target.")
tooltip: verticalAnchor ? qsTr("Anchor to the bottom of the target.") : qsTr("Anchor to the right of the target.")
onClicked: {
if (!invertRelativeTargets)
oppositeEdgeButtonClicked();

View File

@@ -158,8 +158,8 @@ Section {
}
SecondColumnLayout {
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
minimumValue: -4000
maximumValue: 4000
decimals: 0
backendValue: backendValues.spacing
Layout.fillWidth: true

View File

@@ -80,8 +80,8 @@ Column {
SpinBox {
backendValue: backendValues.sourceSize_width
minimumValue: -2000
maximumValue: 2000
minimumValue: 0
maximumValue: 8192
decimals: 0
}
@@ -97,8 +97,8 @@ Column {
SpinBox {
backendValue: backendValues.sourceSize_height
minimumValue: -2000
maximumValue: 2000
minimumValue: 0
maximumValue: 8192
decimals: 0
}

View File

@@ -130,8 +130,8 @@ Column {
SectionLayout {
SpinBox {
backendValue: backendValues.spacing
minimumValue: 0
maximumValue: 1000
minimumValue: -4000
maximumValue: 4000
decimals: 0
}
ExpandingSpacer {

View File

@@ -166,6 +166,7 @@ Column {
backendValue: backendValues.preferredHighlightBegin
minimumValue: 0
maximumValue: 1
stepSize: 0.1
decimals: 2
}
ExpandingSpacer {
@@ -182,6 +183,7 @@ Column {
backendValue: backendValues.preferredHighlightEnd
minimumValue: 0
maximumValue: 1
stepSize: 0.1
decimals: 2
}
ExpandingSpacer {

View File

@@ -34,6 +34,7 @@ Section {
id: root
property int labelWidth: 42
property int spinBoxWidth: 96
SectionLayout {
@@ -173,13 +174,13 @@ Section {
Label {
text: "W"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.contentWidth
minimumValue: 0
maximumValue: 8000
maximumValue: 10000
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
}
@@ -191,13 +192,13 @@ Section {
Label {
text: "H"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.contentHeight
minimumValue: 0
maximumValue: 8000
maximumValue: 10000
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
}
@@ -213,12 +214,12 @@ Section {
Label {
text: "X"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.contentX
minimumValue: 0
minimumValue: -8000
maximumValue: 8000
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
@@ -231,12 +232,12 @@ Section {
Label {
text: "Y"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.contentY
minimumValue: 0
minimumValue: -8000
maximumValue: 8000
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
@@ -254,13 +255,13 @@ Section {
Label {
text: "Top"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.topMargin
maximumValue: 0xffff
minimumValue: 0
minimumValue: -10000
maximumValue: 10000
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
@@ -273,13 +274,13 @@ Section {
Label {
text: "Bottom"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.bottomMargin
maximumValue: 0xffff
minimumValue: 0
minimumValue: -10000
maximumValue: 10000
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
@@ -297,13 +298,13 @@ Section {
Label {
text: "Left"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.leftMargin
maximumValue: 0xffff
minimumValue: 0
minimumValue: -10000
maximumValue: 10000
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
@@ -316,13 +317,13 @@ Section {
Label {
text: "Right"
width: 42
width: root.labelWidth
}
SpinBox {
backendValue: backendValues.rightMargin
maximumValue: 0xffff
minimumValue: 0
minimumValue: -10000
maximumValue: 10000
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true

View File

@@ -38,7 +38,7 @@ Controls.Label {
property alias toolTip: toolTipArea.tooltip
width: Math.max(Math.min(240, parent.width - 280), 50)
color: Theme.color(Theme.PanelTextColorLight)
color: StudioTheme.Values.themeTextColor
elide: Text.ElideRight
font.pixelSize: StudioTheme.Values.myFontSize

View File

@@ -45,8 +45,8 @@ Section {
width: 42
}
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
minimumValue: -10000
maximumValue: 10000
decimals: 0
backendValue: backendValues.topMargin
Layout.fillWidth: true
@@ -62,8 +62,8 @@ Section {
width: 42
}
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
minimumValue: -10000
maximumValue: 10000
decimals: 0
backendValue: backendValues.bottomMargin
Layout.fillWidth: true
@@ -80,8 +80,8 @@ Section {
width: 42
}
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
minimumValue: -10000
maximumValue: 10000
decimals: 0
backendValue: backendValues.leftMargin
Layout.fillWidth: true
@@ -97,8 +97,8 @@ Section {
width: 42
}
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
minimumValue: -10000
maximumValue: 10000
decimals: 0
backendValue: backendValues.rightMargin
Layout.fillWidth: true
@@ -111,8 +111,8 @@ Section {
}
SecondColumnLayout {
SpinBox {
maximumValue: 9999999
minimumValue: -9999999
minimumValue: -10000
maximumValue: 10000
decimals: 0
backendValue: backendValues.margins
Layout.fillWidth: true

View File

@@ -24,7 +24,7 @@
****************************************************************************/
import QtQuick 2.1
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls 2.12 as Controls
import QtQuick.Layouts 1.0
import QtQuickDesignerTheme 1.0
import StudioTheme 1.0 as StudioTheme
@@ -52,7 +52,7 @@ Item {
Controls.Label {
id: label
anchors.verticalCenter: parent.verticalCenter
color: Theme.color(Theme.PanelTextColorLight)
color: StudioTheme.Values.themeTextColor
x: 22
font.bold: true
font.pixelSize: StudioTheme.Values.myFontSize
@@ -75,7 +75,7 @@ Item {
}
color: Theme.color(Theme.BackgroundColorDark)
color: StudioTheme.Values.themeSectionHeadBackground
Rectangle {
visible: false

View File

@@ -123,6 +123,8 @@ QtObject {
property string themeTranslationIndicatorBorder: "#7f7f7f"
property string themeSectionHeadBackground: "#191919"
// Taken out of Constants.js
property string themeChangedStateText: "#99ccff"
}