mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
5ec4e24b00
commit
2d966ee328
@ -167,6 +167,8 @@ class EditorWidget(QWebView): # {{{
|
||||
self.action_remove_format.trigger()
|
||||
self.exec_command('delete')
|
||||
us.endMacro()
|
||||
self.set_font_style()
|
||||
self.setFocus(Qt.OtherFocusReason)
|
||||
|
||||
def link_clicked(self, url):
|
||||
open_url(url)
|
||||
@ -266,6 +268,10 @@ class EditorWidget(QWebView): # {{{
|
||||
|
||||
def fset(self, val):
|
||||
self.setHtml(val)
|
||||
self.set_font_style()
|
||||
return property(fget=fget, fset=fset)
|
||||
|
||||
def set_font_style(self):
|
||||
fi = QFontInfo(QApplication.font(self))
|
||||
f = fi.pixelSize() + 1 + int(tweaks['change_book_details_font_size_by'])
|
||||
fam = unicode(fi.family()).strip().replace('"', '')
|
||||
@ -278,8 +284,6 @@ class EditorWidget(QWebView): # {{{
|
||||
body.setAttribute('style', style)
|
||||
self.page().setContentEditable(True)
|
||||
|
||||
return property(fget=fget, fset=fset)
|
||||
|
||||
def keyPressEvent(self, ev):
|
||||
if ev.key() in (Qt.Key_Tab, Qt.Key_Escape, Qt.Key_Backtab):
|
||||
ev.ignore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user