mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Comments editor: Allow using the Ctrl+Tab key combo to insert a literal tab
This commit is contained in:
parent
650ea67660
commit
edeb8b90bb
@ -385,6 +385,9 @@ class EditorWidget(QWebView): # {{{
|
|||||||
def event(self, ev):
|
def event(self, ev):
|
||||||
if ev.type() in (ev.KeyPress, ev.KeyRelease, ev.ShortcutOverride) and ev.key() in (
|
if ev.type() in (ev.KeyPress, ev.KeyRelease, ev.ShortcutOverride) and ev.key() in (
|
||||||
Qt.Key_Tab, Qt.Key_Escape, Qt.Key_Backtab):
|
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()
|
ev.ignore()
|
||||||
return False
|
return False
|
||||||
return QWebView.event(self, ev)
|
return QWebView.event(self, ev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user