mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:13:27 +02:00
Comments editor: Allow using the Ctrl+Tab key combo to insert a literal tab
This commit is contained in:
parent
650ea67660
commit
edeb8b90bb
1 changed files with 3 additions and 0 deletions
|
|
@ -385,6 +385,9 @@ def set_font_style(self):
|
|||
def event(self, ev):
|
||||
if ev.type() in (ev.KeyPress, ev.KeyRelease, ev.ShortcutOverride) and ev.key() in (
|
||||
Qt.Key_Tab, Qt.Key_Escape, Qt.Key_Backtab):
|
||||
if (ev.key() == Qt.Key_Tab and ev.modifiers() & Qt.ControlModifier and ev.type() == ev.KeyPress):
|
||||
self.exec_command('insertHTML', '<span style="white-space:pre">\t</span>')
|
||||
return True
|
||||
ev.ignore()
|
||||
return False
|
||||
return QWebView.event(self, ev)
|
||||
|
|
|
|||
Loading…
Reference in a new issue