hoverEnabled: true
- // Manually setting this fixes alignment in RTL layouts
- horizontalAlignment: TextInput.AlignLeft
+ horizontalAlignment: Qt.AlignLeft
+ LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
+ LayoutMirroring.childrenInherit: true
- leftPadding: Kirigami.Units.smallSpacing + (root.effectiveHorizontalAlignment === TextInput.AlignRight ? rightActionsRow : leftActionsRow).width
- rightPadding: Kirigami.Units.smallSpacing + (root.effectiveHorizontalAlignment === TextInput.AlignRight ? leftActionsRow : rightActionsRow).width
+ leftPadding: Kirigami.Units.smallSpacing + (LayoutMirroring.enabled ? rightActionsRow : leftActionsRow).width
+ rightPadding: Kirigami.Units.smallSpacing + (LayoutMirroring.enabled ? leftActionsRow : rightActionsRow).width
Behavior on leftPadding {
NumberAnimation {
padding: Kirigami.Units.smallSpacing
spacing: Kirigami.Units.smallSpacing
layoutDirection: Qt.LeftToRight
- LayoutMirroring.enabled: root.effectiveHorizontalAlignment === TextInput.AlignRight
anchors.left: parent.left
anchors.leftMargin: Kirigami.Units.smallSpacing
anchors.top: parent.top
padding: Kirigami.Units.smallSpacing
spacing: Kirigami.Units.smallSpacing
layoutDirection: Qt.RightToLeft
- LayoutMirroring.enabled: root.effectiveHorizontalAlignment === TextInput.AlignRight
anchors.right: parent.right
anchors.rightMargin: Kirigami.Units.smallSpacing
anchors.top: parent.top
property bool delaySearch: false
// padding to accommodate search icon nicely
- leftPadding: if (effectiveHorizontalAlignment === TextInput.AlignRight) {
+ leftPadding: if (Qt.application.layoutDirection === Qt.RightToLeft) {
return _rightActionsRow.width + Kirigami.Units.smallSpacing
} else {
return searchIcon.width + Kirigami.Units.smallSpacing * 3
}
- rightPadding: if (effectiveHorizontalAlignment === TextInput.AlignRight) {
+ rightPadding: if (Qt.application.layoutDirection === Qt.RightToLeft) {
return searchIcon.width + Kirigami.Units.smallSpacing * 3
} else {
return _rightActionsRow.width + Kirigami.Units.smallSpacing
EnterKey.type: Qt.EnterKeySearch
rightActions: [
Kirigami.Action {
- //ltr confusingly refers to the direction of the arrow in the icon, not the text direction which it should be used in
- icon.name: root.effectiveHorizontalAlignment === TextInput.AlignRight ? "edit-clear-locationbar-ltr" : "edit-clear-locationbar-rtl"
+ icon.name: root.LayoutMirroring.enabled ? "edit-clear-locationbar-ltr" : "edit-clear-locationbar-rtl"
visible: root.text.length > 0
text: qsTr("Clear search")
onTriggered: {