diff options
author | Henning Gruendl <henning.gruendl@qt.io> | 2021-07-29 15:00:56 +0200 |
---|---|---|
committer | Henning Gruendl <henning.gruendl@qt.io> | 2021-07-29 15:02:11 +0200 |
commit | 73b955890b76275724dcfe29cd610da80e1c28fc (patch) | |
tree | 044c979aa4f837ce4e85d0d99bafd770123c34a7 /src | |
parent | 57ac8b13654796256e6a20913d74e6bca2965a14 (diff) |
PropertyEditor: Update MultiText specifics
Task-number: QDS-4754
Change-Id: Ia5481bb3e6e785aa626a40dbb8fe016ae05b4dc4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src')
3 files changed, 115 insertions, 216 deletions
diff --git a/src/imports/multitext/designer/MultiTextElementSpecifics.qml b/src/imports/multitext/designer/MultiTextElementSpecifics.qml index 2bcdf6c..a3febee 100644 --- a/src/imports/multitext/designer/MultiTextElementSpecifics.qml +++ b/src/imports/multitext/designer/MultiTextElementSpecifics.qml @@ -27,9 +27,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 import HelperWidgets 2.0 -import QtQuick.Layouts 1.0 +import StudioTheme 1.0 as StudioTheme Column { anchors.left: parent.left @@ -39,15 +40,18 @@ Column { anchors.left: parent.left anchors.right: parent.right caption: qsTr("Multi Text") + SectionLayout { - rows: 1 - columns: 1 - Label { - text: qsTr("Baseline offset") - tooltip: qsTr("") - } - SpinBox { - backendValue: backendValues.baselineOffset + PropertyLabel { text: qsTr("Baseline offset") } + + SecondColumnLayout { + SpinBox { + backendValue: backendValues.baselineOffset + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} } } } @@ -61,37 +65,9 @@ Column { richTextEditorAvailable: true } - Section { - anchors.left: parent.left - anchors.right: parent.right - caption: qsTr("Text Color") - - ColorEditor { - caption: qsTr("Text Color") - backendValue: backendValues.color - supportGradient: false - } - - } - - Section { - anchors.left: parent.left - anchors.right: parent.right - caption: qsTr("Style Color") - visible: backendValues.styleColor.isAvailable - - ColorEditor { - caption: qsTr("Style Color") - backendValue: backendValues.styleColor - supportGradient: false - } + FontSection { + showStyle: true } - FontSection { - showStyle: true - } - - PaddingSection { - visible: minorQtQuickVersion > 5 - } + PaddingSection {} } diff --git a/src/imports/multitext/designer/MultiTextExceptionSpecifics.qml b/src/imports/multitext/designer/MultiTextExceptionSpecifics.qml index 13fb954..f20d59c 100644 --- a/src/imports/multitext/designer/MultiTextExceptionSpecifics.qml +++ b/src/imports/multitext/designer/MultiTextExceptionSpecifics.qml @@ -27,9 +27,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 import HelperWidgets 2.0 -import QtQuick.Layouts 1.0 +import StudioTheme 1.0 as StudioTheme Column { anchors.left: parent.left @@ -39,75 +40,77 @@ Column { anchors.left: parent.left anchors.right: parent.right caption: qsTr("Multi Text Exception") - SectionLayout { - rows: 2 - columns: 2 - Label { - text: qsTr("Language exception") + SectionLayout { + PropertyLabel { text: qsTr("Language exception") } + + SecondColumnLayout { + ComboBox { + id: textComboBox + valueType: ComboBox.ValueType.Integer + manualMapping: true + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + model: [ + "[None]", + "Arabic-Egypt (ar)", + "Chinese-China (zh)", + "Czech-Czech Republic (cs)", + "Danish-Denmark (da)", + "Dutch-Netherlands (nl)", + "English-Australia (en-AU)", + "English-United Kingdom (en-GB)", + "English-United States (en)", + "Finnish-Finland (fi)", + "Hebrew-Israel (he)", + "Hindi-India (hi)", + "Hungarian-Hungary (hu)", + "French-France (fr)", + "French-Canada (fr-CA)", + "German-Germany (de)", + "Italian-Italy (it)", + "Japanese-Japan (ja)", + "Korean-South Korea (ko)", + "Norwegian Bokmal-Norway (nb)", + "Persian-Iran (fa)", + "Polish-Poland (pl)", + "Portuguese-Brazil (pt)", + "Portuguese-Portugal (pt-PT)", + "Romanian-Romania (ro)", + "Russian-Russia (ru)", + "Slovak-Slovakia (sk)", + "Slovenian-Slovenia (sl)", + "Swedish-Sweden (sv)", + "Spanish-Spain (es)", + "Spanish-Mexico (es-MX)", + "Turkish-Turkey (tr)", + "Ukrainian-Ukraine (uk)" ] + + onCurrentTextChanged: { + if (textComboBox.currentText === "[None]") { + backendValues.languageCode.resetValue() + return + } + + var myReg = /\(([^()]*)\)/g; + var result = myReg.exec(textComboBox.currentText); + backendValues.languageCode.value = result[1] + } + } + ExpandingSpacer {} } - ComboBox { - id: textComboBox - visible: showElide - Layout.fillWidth: true - valueType: ComboBox.ValueType.Integer - manualMapping: true - - model: [ - "[None]", - "Arabic-Egypt (ar)", - "Chinese-China (zh)", - "Czech-Czech Republic (cs)", - "Danish-Denmark (da)", - "Dutch-Netherlands (nl)", - "English-Australia (en-AU)", - "English-United Kingdom (en-GB)", - "English-United States (en)", - "Finnish-Finland (fi)", - "Hebrew-Israel (he)", - "Hindi-India (hi)", - "Hungarian-Hungary (hu)", - "French-France (fr)", - "French-Canada (fr-CA)", - "German-Germany (de)", - "Italian-Italy (it)", - "Japanese-Japan (ja)", - "Korean-South Korea (ko)", - "Norwegian Bokmal-Norway (nb)", - "Persian-Iran (fa)", - "Polish-Poland (pl)", - "Portuguese-Brazil (pt)", - "Portuguese-Portugal (pt-PT)", - "Romanian-Romania (ro)", - "Russian-Russia (ru)", - "Slovak-Slovakia (sk)", - "Slovenian-Slovenia (sl)", - "Swedish-Sweden (sv)", - "Spanish-Spain (es)", - "Spanish-Mexico (es-MX)", - "Turkish-Turkey (tr)", - "Ukrainian-Ukraine (uk)" ] - - onCurrentTextChanged: { - if (textComboBox.currentText === "[None]") { - backendValues.languageCode.resetValue() - return - } + PropertyLabel { text: qsTr("Exception active") } - var myReg = /\(([^()]*)\)/g; - var result = myReg.exec(textComboBox.currentText); - backendValues.languageCode.value = result[1] + SecondColumnLayout { + CheckBox { + backendValue: backendValues.exceptionAcive + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth } - } - Label { - text: qsTr("Exception active") - tooltip: qsTr("") - } - CheckBox { - backendValue: backendValues.exceptionAcive + ExpandingSpacer {} } } } @@ -121,37 +124,9 @@ Column { richTextEditorAvailable: true } - Section { - anchors.left: parent.left - anchors.right: parent.right - caption: qsTr("Text Color") - - ColorEditor { - caption: qsTr("Text Color") - backendValue: backendValues.color - supportGradient: false - } - + FontSection { + showStyle: true } - Section { - anchors.left: parent.left - anchors.right: parent.right - caption: qsTr("Style Color") - visible: backendValues.styleColor.isAvailable - - ColorEditor { - caption: qsTr("Style Color") - backendValue: backendValues.styleColor - supportGradient: false - } - } - - FontSection { - showStyle: true - } - - PaddingSection { - visible: minorQtQuickVersion > 5 - } + PaddingSection {} } diff --git a/src/imports/multitext/designer/MultiTextItemSpecifics.qml b/src/imports/multitext/designer/MultiTextItemSpecifics.qml index 122e227..1bb7e30 100644 --- a/src/imports/multitext/designer/MultiTextItemSpecifics.qml +++ b/src/imports/multitext/designer/MultiTextItemSpecifics.qml @@ -27,9 +27,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 import HelperWidgets 2.0 -import QtQuick.Layouts 1.0 +import StudioTheme 1.0 as StudioTheme Column { anchors.left: parent.left @@ -39,92 +40,39 @@ Column { anchors.left: parent.left anchors.right: parent.right caption: qsTr("Multi Text") - SectionLayout { - rows: 3 - columns: 2 - - Label { - text: qsTr("Text element") - - } - ComboBox { - id: textComboBox - visible: showElide - Layout.fillWidth: true - valueType: ComboBox.ValueType.Integer - manualMapping: true - currentIndex: backendValues.stringIndex.value - - model: { - backendValues.textModel.value.split('e\u001f' + 'e\u001d') + SectionLayout { + PropertyLabel { text: qsTr("Text element") } + + SecondColumnLayout { + ComboBox { + id: textComboBox + valueType: ComboBox.ValueType.Integer + manualMapping: true + currentIndex: backendValues.stringIndex.value + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + model: backendValues.textModel.value.split('e\u001f' + 'e\u001d') + + onCurrentIndexChanged: { + backendValues.currentIndex.value = textComboBox.currentIndex + } } - onCurrentIndexChanged: { - backendValues.currentIndex.value = textComboBox.currentIndex - } + ExpandingSpacer {} } - Label { - text: qsTr("String index") - tooltip: qsTr("") - } - SpinBox { - backendValue: backendValues.currentIndex - } + PropertyLabel { text: qsTr("String index") } + SecondColumnLayout { + SpinBox { + backendValue: backendValues.currentIndex + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } - /* - Label { - text: qsTr("BaseLine Offset") - tooltip: qsTr("") + ExpandingSpacer {} } - SpinBox { - backendValue: backendValues.baselineOffset - }*/ - } - - } - /* - StandardTextSection { - showVerticalAlignment: true - showFormatProperty: true - showElide: true - showFontSizeMode: true - showLineHeight: true - } - - Section { - anchors.left: parent.left - anchors.right: parent.right - caption: qsTr("Text Color") - - ColorEditor { - caption: qsTr("Text Color") - backendValue: backendValues.color - supportGradient: false } - } - - Section { - anchors.left: parent.left - anchors.right: parent.right - caption: qsTr("Style Color") - visible: backendValues.styleColor.isAvailable - - ColorEditor { - caption: qsTr("Style Color") - backendValue: backendValues.styleColor - supportGradient: false - } - } - - FontSection { - showStyle: true - } - - PaddingSection { - visible: minorQtQuickVersion > 5 - }*/ } |