File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import org.deepin.dtk.style 1.0 as DS
1010LineEdit {
1111 id: control
1212 property alias placeholder: centerIndicatorLabel .text
13- property bool editting: control .activeFocus || (text .length !== 0 )
13+ property bool editting: control .activeFocus || control . contextMenuVisible || (text .length !== 0 )
1414 leftPadding: (editting) ? searchIcon .width + DS .Style .searchEdit .iconLeftMargin
1515 + DS .Style .searchEdit .iconRightMargin
1616 : 0
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ T.TextField {
1818 property alias alertText: panel .alertText
1919 property alias alertDuration: panel .alertDuration
2020 property alias showAlert: panel .showAlert
21+ property alias contextMenuVisible: contextMenu .visible
2122
2223 implicitWidth: Math .max (DS .Style .control .implicitWidth (control),
2324 placeholderText ? placeholder .implicitWidth + leftPadding + rightPadding
@@ -52,6 +53,7 @@ T.TextField {
5253 background: EditPanel {
5354 id: panel
5455 control: control
56+ showBorder: control .activeFocus || control .contextMenuVisible
5557 implicitWidth: DS .Style .edit .width
5658 implicitHeight: DS .Style .edit .textFieldHeight
5759 }
@@ -74,6 +76,8 @@ T.TextField {
7476
7577 Menu {
7678 id: contextMenu
79+ // Force the text field to keep focus when the context menu is closed
80+ onClosed: control .forceActiveFocus ()
7781
7882 MenuItem
7983 {
You can’t perform that action at this time.
0 commit comments