QmlDesigner: PropertyEditor TextSection cleanup

Change-Id: I042f38303aad016d939a39c7a638d330fca2ba58
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2019-11-12 18:04:40 +01:00
committed by Henning Gründl
parent 8722836b44
commit d9981135c1
5 changed files with 97 additions and 8 deletions

View File

@@ -32,8 +32,7 @@ Column {
anchors.right: parent.right anchors.right: parent.right
StandardTextSection { StandardTextSection {
showIsWrapping: true showVerticalAlignment: true
useLineEdit: true
showFormatProperty: true showFormatProperty: true
} }
@@ -62,6 +61,18 @@ Column {
} }
} }
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Selected Text Color")
ColorEditor {
caption: qsTr("Selected Text Color")
backendValue: backendValues.selectedTextColor
supportGradient: false
}
}
FontSection { FontSection {
showStyle: false showStyle: false
} }

View File

@@ -39,6 +39,16 @@ Section {
rows: 4 rows: 4
columns: 2 columns: 2
Label {
text: qsTr("Mouse selection mode")
}
ComboBox {
Layout.fillWidth: true
backendValue: backendValues.mouseSelectionMode
scope: "TextInput"
model: ["SelectCharacters", "SelectWords"]
}
Label { Label {
visible: textInputSection.isTextInput visible: textInputSection.isTextInput
text: qsTr("Input mask") text: qsTr("Input mask")
@@ -48,6 +58,7 @@ Section {
visible: textInputSection.isTextInput visible: textInputSection.isTextInput
backendValue: backendValues.inputMask backendValue: backendValues.inputMask
Layout.fillWidth: true Layout.fillWidth: true
showTranslateCheckBox: false
} }
Label { Label {
@@ -73,6 +84,33 @@ Section {
visible: textInputSection.isTextInput visible: textInputSection.isTextInput
backendValue: backendValues.passwordCharacter backendValue: backendValues.passwordCharacter
Layout.fillWidth: true Layout.fillWidth: true
showTranslateCheckBox: false
}
Label {
visible: !textInputSection.isTextInput
text: qsTr("Tab stop distance")
tooltip: qsTr("Sets the default distance, in device units, between tab stops.")
}
SpinBox {
visible: !textInputSection.isTextInput
Layout.fillWidth: true
backendValue: backendValues.tabStopDistance
maximumValue: 200
minimumValue: 0
}
Label {
visible: !textInputSection.isTextInput
text: qsTr("Text margin")
tooltip: qsTr("Sets the margin, in pixels, around the text in the TextEdit..")
}
SpinBox {
visible: !textInputSection.isTextInput
Layout.fillWidth: true
backendValue: backendValues.textMargin
maximumValue: 200
minimumValue: -200
} }
Label { Label {
@@ -101,10 +139,36 @@ Section {
} }
CheckBox { CheckBox {
visible: textInputSection.isTextInput
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Auto scroll") text: qsTr("Auto scroll")
backendValue: backendValues.autoScroll backendValue: backendValues.autoScroll
} }
CheckBox {
Layout.fillWidth: true
text: qsTr("Overwrite mode")
backendValue: backendValues.overwriteMode
}
CheckBox {
Layout.fillWidth: true
text: qsTr("Persistent selection")
backendValue: backendValues.persistentSelection
}
CheckBox {
Layout.fillWidth: true
text: qsTr("Select by mouse")
backendValue: backendValues.selectByMouse
}
CheckBox {
visible: !textInputSection.isTextInput
Layout.fillWidth: true
text: qsTr("Select by keyboard")
backendValue: backendValues.selectByKeyboard
}
} }
} }
} }

View File

@@ -32,8 +32,7 @@ Column {
anchors.right: parent.right anchors.right: parent.right
StandardTextSection { StandardTextSection {
useLineEdit: false showVerticalAlignment: true
showIsWrapping: false
} }
Section { Section {
@@ -61,6 +60,18 @@ Column {
} }
} }
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Selected Text Color")
ColorEditor {
caption: qsTr("Selected Text Color")
backendValue: backendValues.selectedTextColor
supportGradient: false
}
}
FontSection { FontSection {
showStyle: false showStyle: false
} }

View File

@@ -32,12 +32,11 @@ Column {
anchors.right: parent.right anchors.right: parent.right
StandardTextSection { StandardTextSection {
useLineEdit: true
showIsWrapping: true
showVerticalAlignment: true showVerticalAlignment: true
showFormatProperty: true showFormatProperty: true
showElide: true showElide: true
showFontSizeMode: true showFontSizeMode: true
showLineHeight: true
} }
Section { Section {

View File

@@ -35,9 +35,10 @@ Section {
property bool showIsWrapping: false property bool showIsWrapping: false
property bool showElide: false property bool showElide: false
property bool showVerticalAlignment: false property bool showVerticalAlignment: false
property bool useLineEdit: true
property bool showFormatProperty: false property bool showFormatProperty: false
property bool showFontSizeMode: false property bool showFontSizeMode: false
property bool showLineHeight: false
SectionLayout { SectionLayout {
columns: 2 columns: 2
@@ -46,7 +47,6 @@ Section {
text: qsTr("Text") text: qsTr("Text")
} }
LineEdit { LineEdit {
//visible: useLineEdit
backendValue: backendValues.text backendValue: backendValues.text
Layout.fillWidth: true Layout.fillWidth: true
} }
@@ -119,10 +119,12 @@ Section {
} }
Label { Label {
visible: showFontSizeMode
text: qsTr("Font size mode") text: qsTr("Font size mode")
toolTip: qsTr("Specifies how the font size of the displayed text is determined.") toolTip: qsTr("Specifies how the font size of the displayed text is determined.")
} }
ComboBox { ComboBox {
visible: showFontSizeMode
scope: "Text" scope: "Text"
model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"] model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"]
backendValue: backendValues.fontSizeMode backendValue: backendValues.fontSizeMode
@@ -131,11 +133,13 @@ Section {
Label { Label {
visible: showLineHeight
text: qsTr("Line height") text: qsTr("Line height")
tooltip: qsTr("Sets the line height for the text.") tooltip: qsTr("Sets the line height for the text.")
} }
SpinBox { SpinBox {
visible: showLineHeight
Layout.fillWidth: true Layout.fillWidth: true
backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight
maximumValue: 500 maximumValue: 500