Skip to content

Commit d839c51

Browse files
committed
Add textFormat property to controls
1 parent 856c894 commit d839c51

10 files changed

+21
-4
lines changed

QMLComponents/components/JASP/Controls/Button.qml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ JASPControl
3434
readonly property alias control: control
3535
property alias text: control.text
3636
property alias label: control.text
37+
property alias textFormat: control.textFormat
3738
property alias iconSource: control.iconSource
3839
readonly property alias pressed: control._pressed
3940

QMLComponents/components/JASP/Controls/CheckBox.qml

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ CheckBoxBase
4242
property alias font: label.font
4343
property alias fontInfo: label.fontInfo
4444
property alias label: control.text
45-
property alias labelTextFormat: label.textFormat
4645
property alias checked: control.checked
46+
property int textFormat: Text.AutoText
4747
property bool childrenOnSameRow: false
4848
property alias columns: childControlsArea.columns
4949
property bool enableChildrenOnChecked: true
@@ -111,6 +111,7 @@ CheckBoxBase
111111
font: jaspTheme.font
112112
leftPadding: checkIndicator.width + control.spacing
113113
verticalAlignment: Text.AlignVCenter
114+
textFormat: checkBox.textFormat
114115
}
115116

116117
background: Rectangle

QMLComponents/components/JASP/Controls/ComboBox.qml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ComboBoxBase
2020
property alias value: comboBox.currentValue
2121
property alias indexDefaultValue: comboBox.currentIndex
2222
property alias fieldWidth: control.width
23+
property int textFormat: Text.AutoText
2324
property bool showVariableTypeIcon: containsVariables
2425
property var enabledOptions: []
2526
property bool setLabelAbove: false
@@ -87,6 +88,7 @@ ComboBoxBase
8788
anchors.verticalCenter: parent.verticalCenter
8889
color: enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
8990
width: implicitWidth
91+
textFormat: comboBox.textFormat
9092
}
9193
}
9294

QMLComponents/components/JASP/Controls/ExpanderButton.qml

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ FocusScope
4646
readonly property string iconsFolder : jaspTheme.iconPath
4747
readonly property string expanderButtonIcon : "expander-arrow-up.png"
4848
property alias columns : expanderArea.columns
49+
property int textFormat : Text.AutoText
4950

5051
states: [
5152
State
@@ -131,6 +132,7 @@ FocusScope
131132
anchors.verticalCenter : parent.verticalCenter
132133
font : jaspTheme.font
133134
color : enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
135+
textFormat : expanderWrapper.textFormat
134136
}
135137
}
136138
}

QMLComponents/components/JASP/Controls/GroupBox.qml

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ GroupBoxBase
3939
property int columnSpacing: jaspTheme.columnGroupSpacing
4040
property int columns: 1
4141
property bool indent: false
42-
property bool alignFields: true
42+
property bool alignFields: true
4343
property alias label: label
4444
property alias preferredWidth: contentArea.width
45+
property int textFormat: Text.AutoText
4546

4647
property var _allAlignableFields: []
4748
property bool _childrenConnected: false
@@ -55,6 +56,7 @@ GroupBoxBase
5556
color: enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
5657
font: jaspTheme.font
5758
visible: groupBox.title ? true : false
59+
textFormat: groupBox.textFormat
5860

5961
property int realHeight: visible ? implicitHeight : 0
6062
property int realWidth: visible ? implicitWidth : 0

QMLComponents/components/JASP/Controls/RadioButton.qml

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ RadioButtonBase
4343
property alias label: control.text
4444
property alias checked: control.checked
4545
property alias value: radioButton.name
46+
property int textFormat: Text.AutoText
4647
property bool childrenOnSameRow: false
4748
property alias columns: childControlsArea.columns
4849
property bool enableChildrenOnChecked: true
@@ -102,6 +103,7 @@ RadioButtonBase
102103
leftPadding: radioIndicator.width + control.spacing
103104
font: jaspTheme.font
104105
color: enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
106+
textFormat: radioButton.textFormat
105107
}
106108

107109
background: Rectangle { color: "transparent" }

QMLComponents/components/JASP/Controls/RadioButtonGroup.qml

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RadioButtonsGroupBase
3535
property alias columns: contentArea.columns
3636
property alias text: control.title
3737
property int leftPadding: jaspTheme.groupContentPadding
38+
property int textFormat: Text.AutoText
3839

3940
implicitWidth: radioButtonsOnSameRow
4041
? contentArea.x + contentArea.implicitWidth
@@ -57,6 +58,7 @@ RadioButtonsGroupBase
5758
verticalAlignment: Text.AlignVCenter
5859
font: jaspTheme.font
5960
color: enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
61+
textFormat: control.textFormat
6062
}
6163

6264

QMLComponents/components/JASP/Controls/RectangularButton.qml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ Rectangle
2424
{
2525
id: filterButtonRoot
2626

27-
28-
27+
property alias textFormat: buttonText.textFormat
2928
property string text: ""
3029
property string toolTip: ""
3130
property string textColor: "default"

QMLComponents/components/JASP/Controls/TextField.qml

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ TextInputBase
3434
property alias control: control
3535
property alias text: textField.label
3636
property alias displayValue: control.text ///< In onEditingFinished this contains the "value" entered by the user
37+
property int textFormat: Text.AutoText
3738
property var lastValidValue: defaultValue
3839
property int fieldWidth: jaspTheme.textFieldWidth
3940
property int fieldHeight: 0
@@ -151,6 +152,7 @@ TextInputBase
151152
color: enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
152153
text: textField.label
153154
width: implicitWidth
155+
textFormat: textField.textFormat
154156
}
155157
}
156158

@@ -279,6 +281,7 @@ TextInputBase
279281
anchors.verticalCenter: parent.verticalCenter
280282
color: enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
281283
text: textField.afterLabel
284+
textFormat: textField.textFormat
282285
}
283286
}
284287
}

QMLComponents/components/JASP/Controls/VariablesList.qml

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ VariablesListBase
4343
property alias itemRectangle : itemRectangle
4444
property alias scrollBar : scrollBar
4545
property alias itemTitle : itemTitle
46+
property int textFormat : Text.AutoText
4647
property string rowComponentTitle : ""
4748
property string itemType : "variables"
4849
property int dropMode : JASP.DropNone
@@ -146,6 +147,7 @@ VariablesListBase
146147
height : title ? jaspTheme.variablesListTitle : 0
147148
font : jaspTheme.font
148149
color : enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
150+
textFormat : variablesList.textFormat
149151
}
150152

151153
Text
@@ -156,6 +158,7 @@ VariablesListBase
156158
height : rowComponentTitle ? jaspTheme.variablesListTitle : 0
157159
font : jaspTheme.font
158160
color : enabled ? jaspTheme.textEnabled : jaspTheme.textDisabled
161+
textFormat : variablesList.textFormat
159162
}
160163

161164
Rectangle

0 commit comments

Comments
 (0)