mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
added tweak for font size increase/decrease in book details panel and book comments
This commit is contained in:
parent
cc0053b42f
commit
48fb94e5f7
@ -496,3 +496,10 @@ gui_view_history_size = 15
|
||||
# prefer HTMLZ to EPUB for tweaking, change this to 'htmlz'
|
||||
tweak_book_prefer = 'epub'
|
||||
|
||||
#: Increase or decrease the font size in book details and book comments
|
||||
# Controls the increase or decrease of the font size in the book details panel and the book
|
||||
# comments. The font size will be increased by the specified numbers of pixels, a negative
|
||||
# number will decrease the font size.
|
||||
# The default value since version 0.8.39 is 1. For the old behavior set this to 0.
|
||||
change_book_details_font_size_by = 1
|
||||
|
||||
|
@ -25,6 +25,7 @@ from calibre.utils.icu import sort_key
|
||||
from calibre.utils.formatter import EvalFormatter
|
||||
from calibre.utils.date import is_date_undefined
|
||||
from calibre.utils.localization import calibre_langcode_to_name
|
||||
from calibre.utils.config import tweaks
|
||||
|
||||
def render_html(mi, css, vertical, widget, all_fields=False): # {{{
|
||||
table = render_data(mi, all_fields=all_fields,
|
||||
@ -39,7 +40,7 @@ def render_html(mi, css, vertical, widget, all_fields=False): # {{{
|
||||
return ans
|
||||
|
||||
fi = QFontInfo(QApplication.font(widget))
|
||||
f = fi.pixelSize()+1
|
||||
f = fi.pixelSize() + tweaks['change_book_details_font_size_by']
|
||||
fam = unicode(fi.family()).strip().replace('"', '')
|
||||
if not fam:
|
||||
fam = 'sans-serif'
|
||||
|
@ -19,6 +19,7 @@ from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre import xml_replace_entities
|
||||
from calibre.gui2 import open_url
|
||||
from calibre.utils.soupparser import fromstring
|
||||
from calibre.utils.config import tweaks
|
||||
|
||||
class PageAction(QAction): # {{{
|
||||
|
||||
@ -252,7 +253,7 @@ class EditorWidget(QWebView): # {{{
|
||||
def fset(self, val):
|
||||
self.setHtml(val)
|
||||
fi = QFontInfo(QApplication.font(self))
|
||||
f = fi.pixelSize()+1
|
||||
f = fi.pixelSize() + tweaks['change_book_details_font_size_by']
|
||||
fam = unicode(fi.family()).strip().replace('"', '')
|
||||
if not fam:
|
||||
fam = 'sans-serif'
|
||||
|
Loading…
x
Reference in New Issue
Block a user