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
StandardTextSection {
showIsWrapping: true
useLineEdit: true
showVerticalAlignment: 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 {
showStyle: false
}

View File

@@ -39,6 +39,16 @@ Section {
rows: 4
columns: 2
Label {
text: qsTr("Mouse selection mode")
}
ComboBox {
Layout.fillWidth: true
backendValue: backendValues.mouseSelectionMode
scope: "TextInput"
model: ["SelectCharacters", "SelectWords"]
}
Label {
visible: textInputSection.isTextInput
text: qsTr("Input mask")
@@ -48,6 +58,7 @@ Section {
visible: textInputSection.isTextInput
backendValue: backendValues.inputMask
Layout.fillWidth: true
showTranslateCheckBox: false
}
Label {
@@ -73,6 +84,33 @@ Section {
visible: textInputSection.isTextInput
backendValue: backendValues.passwordCharacter
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 {
@@ -101,10 +139,36 @@ Section {
}
CheckBox {
visible: textInputSection.isTextInput
Layout.fillWidth: true
text: qsTr("Auto scroll")
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
StandardTextSection {
useLineEdit: false
showIsWrapping: false
showVerticalAlignment: true
}
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 {
showStyle: false
}

View File

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

View File

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