2013-10-23 13:34:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2021-06-21 16:48:19 +02:00
|
|
|
** Copyright (C) 2021 The Qt Company Ltd.
|
2016-01-15 14:59:14 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-10-23 13:34:08 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:59:14 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-10-23 13:34:08 +02:00
|
|
|
**
|
2015-09-18 11:34:48 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
2016-01-15 14:59:14 +01:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-10-23 13:34:08 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
2013-10-23 13:34:08 +02:00
|
|
|
import HelperWidgets 2.0
|
2021-06-21 16:48:19 +02:00
|
|
|
import StudioTheme 1.0 as StudioTheme
|
2013-10-23 13:34:08 +02:00
|
|
|
|
|
|
|
|
Section {
|
2021-06-21 16:48:19 +02:00
|
|
|
id: textInputSection
|
2013-10-23 13:34:08 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
caption: qsTr("Text Input")
|
|
|
|
|
|
2014-04-16 09:59:28 +02:00
|
|
|
property bool isTextInput: false
|
2014-03-25 15:53:55 +01:00
|
|
|
|
2013-10-23 13:34:08 +02:00
|
|
|
SectionLayout {
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel { text: qsTr("Selection color") }
|
2013-10-23 13:34:08 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
ColorEditor {
|
|
|
|
|
backendValue: backendValues.selectionColor
|
|
|
|
|
supportGradient: false
|
2019-11-12 18:04:40 +01:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Selected text color") }
|
|
|
|
|
|
|
|
|
|
ColorEditor {
|
|
|
|
|
backendValue: backendValues.selectedTextColor
|
|
|
|
|
supportGradient: false
|
2019-11-12 18:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel { text: qsTr("Selection mode") }
|
|
|
|
|
|
|
|
|
|
SecondColumnLayout {
|
|
|
|
|
ComboBox {
|
|
|
|
|
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
width: implicitWidth
|
|
|
|
|
backendValue: backendValues.mouseSelectionMode
|
|
|
|
|
scope: "TextInput"
|
|
|
|
|
model: ["SelectCharacters", "SelectWords"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyLabel {
|
2014-04-16 09:59:28 +02:00
|
|
|
visible: textInputSection.isTextInput
|
2013-10-23 13:34:08 +02:00
|
|
|
text: qsTr("Input mask")
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
SecondColumnLayout {
|
2014-04-16 09:59:28 +02:00
|
|
|
visible: textInputSection.isTextInput
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
LineEdit {
|
|
|
|
|
backendValue: backendValues.inputMask
|
|
|
|
|
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
width: implicitWidth
|
|
|
|
|
showTranslateCheckBox: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel {
|
2014-04-16 09:59:28 +02:00
|
|
|
visible: textInputSection.isTextInput
|
2014-03-25 15:53:55 +01:00
|
|
|
text: qsTr("Echo mode")
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
SecondColumnLayout {
|
2014-04-16 09:59:28 +02:00
|
|
|
visible: textInputSection.isTextInput
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
|
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
width: implicitWidth
|
|
|
|
|
backendValue: backendValues.echoMode
|
|
|
|
|
scope: "TextInput"
|
|
|
|
|
model: ["Normal", "Password", "PasswordEchoOnEdit", "NoEcho"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel {
|
2014-04-16 09:59:28 +02:00
|
|
|
visible: textInputSection.isTextInput
|
2021-03-18 13:55:35 +01:00
|
|
|
text: qsTr("Password character")
|
2014-10-30 14:45:56 +01:00
|
|
|
tooltip: qsTr("Character displayed when users enter passwords.")
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
SecondColumnLayout {
|
2014-04-16 09:59:28 +02:00
|
|
|
visible: textInputSection.isTextInput
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
LineEdit {
|
|
|
|
|
backendValue: backendValues.passwordCharacter
|
|
|
|
|
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
width: implicitWidth
|
|
|
|
|
showTranslateCheckBox: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
2019-11-12 18:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel {
|
2019-11-12 18:04:40 +01:00
|
|
|
visible: !textInputSection.isTextInput
|
|
|
|
|
text: qsTr("Tab stop distance")
|
2020-07-01 16:33:23 +02:00
|
|
|
tooltip: qsTr("Default distance between tab stops in device units.")
|
2019-11-12 18:04:40 +01:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
SecondColumnLayout {
|
2019-11-12 18:04:40 +01:00
|
|
|
visible: !textInputSection.isTextInput
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
SpinBox {
|
|
|
|
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
backendValue: backendValues.tabStopDistance
|
|
|
|
|
maximumValue: 200
|
|
|
|
|
minimumValue: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
|
|
|
|
|
|
|
|
|
|
ControlLabel { text: "px" }
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
2019-11-12 18:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel {
|
2019-11-12 18:04:40 +01:00
|
|
|
visible: !textInputSection.isTextInput
|
|
|
|
|
text: qsTr("Text margin")
|
2020-07-01 16:33:23 +02:00
|
|
|
tooltip: qsTr("Margin around the text in the Text Edit in pixels.")
|
2019-11-12 18:04:40 +01:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
SecondColumnLayout {
|
2019-11-12 18:04:40 +01:00
|
|
|
visible: !textInputSection.isTextInput
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
SpinBox {
|
|
|
|
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
backendValue: backendValues.textMargin
|
|
|
|
|
maximumValue: 200
|
|
|
|
|
minimumValue: -200
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
|
|
|
|
|
|
|
|
|
|
ControlLabel { text: "px" }
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel {
|
2020-04-24 13:22:55 +02:00
|
|
|
visible: textInputSection.isTextInput
|
|
|
|
|
text: qsTr("Maximum length")
|
2021-03-18 13:55:35 +01:00
|
|
|
tooltip: qsTr("Maximum permitted length of the text in the Text Input.")
|
2020-04-24 13:22:55 +02:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
SecondColumnLayout {
|
2020-04-24 13:22:55 +02:00
|
|
|
visible: textInputSection.isTextInput
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
SpinBox {
|
|
|
|
|
implicitWidth: StudioTheme.Values.singleControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
backendValue: backendValues.maximumLength
|
|
|
|
|
minimumValue: 0
|
|
|
|
|
maximumValue: 32767
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
component FlagItem : SecondColumnLayout {
|
|
|
|
|
property alias backendValue: checkBox.backendValue
|
|
|
|
|
CheckBox {
|
|
|
|
|
id: checkBox
|
|
|
|
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
|
|
|
|
+ StudioTheme.Values.actionIndicatorWidth
|
|
|
|
|
text: backendValue.valueToString
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
|
|
|
|
|
ExpandingSpacer {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Read only") }
|
|
|
|
|
|
|
|
|
|
FlagItem { backendValue: backendValues.readOnly }
|
|
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Cursor visible") }
|
|
|
|
|
|
|
|
|
|
FlagItem { backendValue: backendValues.cursorVisible }
|
|
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Focus on press") }
|
|
|
|
|
|
|
|
|
|
FlagItem { backendValue: backendValues.activeFocusOnPress }
|
|
|
|
|
|
|
|
|
|
PropertyLabel {
|
|
|
|
|
visible: textInputSection.isTextInput
|
|
|
|
|
text: qsTr("Auto scroll")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FlagItem {
|
|
|
|
|
visible: textInputSection.isTextInput
|
|
|
|
|
backendValue: backendValues.autoScroll
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Overwrite mode") }
|
|
|
|
|
|
|
|
|
|
FlagItem { backendValue: backendValues.overwriteMode }
|
|
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Persistent selection") }
|
|
|
|
|
|
|
|
|
|
FlagItem { backendValue: backendValues.persistentSelection }
|
|
|
|
|
|
|
|
|
|
PropertyLabel { text: qsTr("Select by mouse") }
|
|
|
|
|
|
|
|
|
|
FlagItem { backendValue: backendValues.selectByMouse }
|
|
|
|
|
|
|
|
|
|
PropertyLabel {
|
|
|
|
|
visible: !textInputSection.isTextInput
|
|
|
|
|
text: qsTr("Select by keyboard")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FlagItem {
|
|
|
|
|
visible: !textInputSection.isTextInput
|
|
|
|
|
backendValue: backendValues.selectByKeyboard
|
2013-10-23 13:34:08 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|