From 4ae788561b33f257ac78c77ef72e4c740bca6755 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Jun 2019 09:08:30 +0530 Subject: [PATCH] ... --- src/calibre/gui2/comments_editor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 64b00c604d..1617a58531 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -128,6 +128,9 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{ def set_readonly(self, what): self.readonly = what + def focus_self(self): + self.setFocus(Qt.TabFocusReason) + def do_clear(self, *args): c = self.textCursor() c.beginEditBlock() @@ -135,7 +138,7 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{ c.movePosition(QTextCursor.End, QTextCursor.KeepAnchor) c.removeSelectedText() c.endEditBlock() - self.setFocus(Qt.OtherFocusReason) + self.focus_self() clear_text = do_clear def do_bold(self):