5import QtQuick.Controls as QQC2
6import QtQuick.Templates as T
7import org.kde.plasma.components as PlasmaComponents3
8import org.kde.kirigami as Kirigami
49PlasmaComponents3.TextField {
58 property alias focusSequence: focusShortcut.sequence
67 property list<T.Action> leftActions
76 property list<T.Action> rightActions
78 property alias _leftActionsRow: leftActionsRow
79 property alias _rightActionsRow: rightActionsRow
83 topPadding: __hasBackgroundAndMargins ? background.margins.top : 0
84 bottomPadding: __hasBackgroundAndMargins ? background.margins.bottom : 0
86 leftPadding:
if (root.effectiveHorizontalAlignment === TextInput.AlignRight) {
87 return _rightActionsRow.width + (__hasBackgroundAndMargins ? background.margins.left : 0);
89 return _leftActionsRow.width + (__hasBackgroundAndMargins ? background.margins.left : 0);
91 rightPadding:
if (root.effectiveHorizontalAlignment === TextInput.AlignRight) {
92 return _leftActionsRow.width + (__hasBackgroundAndMargins ? background.margins.right : 0);
94 return _rightActionsRow.width + (__hasBackgroundAndMargins ? background.margins.right : 0);
97 Behavior on leftPadding {
98 enabled:
Kirigami.Units.longDuration > 0
100 duration:
Kirigami.Units.longDuration
101 easing.type: Easing.InOutQuad
105 Behavior on rightPadding {
106 enabled:
Kirigami.Units.longDuration > 0
108 duration:
Kirigami.Units.longDuration
109 easing.type: Easing.InOutQuad
116 root.forceActiveFocus(
Qt.ShortcutFocusReason)
121 component ActionIcon:
Kirigami.Icon {
124 required
property T.Action modelData
126 implicitWidth:
Kirigami.Units.iconSizes.small
127 implicitHeight:
Kirigami.Units.iconSizes.small
129 anchors.verticalCenter: parent.verticalCenter
131 source: modelData.icon.name.length > 0 ? modelData.icon.name : modelData.icon.source
132 visible: !(modelData instanceof
Kirigami.Action) || modelData.visible
134 onClicked: button.modelData.trigger()
141 PlasmaComponents3.
ToolTip.visible: focusShortcut.nativeText.length > 0 && root.text.length === 0 && !rightActionsRow.hovered && !leftActionsRow.hovered && hovered
142 PlasmaComponents3.
ToolTip.text: focusShortcut.nativeText
148 LayoutMirroring.enabled: root.effectiveHorizontalAlignment === TextInput.
AlignRight
151 anchors.verticalCenter: parent.verticalCenter
152 height: root.implicitHeight - 2 *
Kirigami.
Units.smallSpacing
153 visible: root.leftActions.length > 0
155 model: root.leftActions
164 LayoutMirroring.enabled: root.effectiveHorizontalAlignment === TextInput.
AlignRight
167 anchors.verticalCenter: parent.verticalCenter
168 height: root.implicitHeight - 2 *
Kirigami.
Units.smallSpacing
169 visible: root.rightActions.length > 0
171 model: root.rightActions
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)