diff --git a/src/calibre/ebooks/lrf/__init__.py b/src/calibre/ebooks/lrf/__init__.py index 7c195f96e4..73a261b931 100644 --- a/src/calibre/ebooks/lrf/__init__.py +++ b/src/calibre/ebooks/lrf/__init__.py @@ -108,6 +108,8 @@ def option_parser(usage, gui_mode=False): help=_('Add a header to all the pages with title and author.')) laf.add_option('--headerformat', default="%t by %a", dest='headerformat', type='string', help=_('Set the format of the header. %a is replaced by the author and %t by the title. Default is %default')) + laf.add_option('--header-separation', default=0, type='int', + help=_('Add extra spacing below the header. Default is %default px.')) laf.add_option('--override-css', default=None, dest='_override_css', type='string', help=_('Override the CSS. Can be either a path to a CSS stylesheet or a string. If it is a string it is interpreted as CSS.')) laf.add_option('--use-spine', default=False, dest='use_spine', action='store_true', @@ -260,10 +262,11 @@ def Book(options, logger, font_delta=0, header=None, hb.append(header) hdr.PutObj(hb) ps['headheight'] = profile.header_height + ps['headsep'] = options.header_separation ps['header'] = hdr ps['topmargin'] = 0 ps['textheight'] = profile.screen_height - (options.bottom_margin + ps['topmargin']) \ - - ps['headheight'] - profile.fudge + - ps['headheight'] - ps['headsep'] - profile.fudge fontsize = int(10*profile.font_size+font_delta*20) baselineskip = fontsize + 20 diff --git a/src/calibre/gui2/dialogs/lrf_single.ui b/src/calibre/gui2/dialogs/lrf_single.ui index d17725d688..8ed4799342 100644 --- a/src/calibre/gui2/dialogs/lrf_single.ui +++ b/src/calibre/gui2/dialogs/lrf_single.ui @@ -6,7 +6,7 @@ 0 0 866 - 671 + 679 @@ -115,7 +115,7 @@ - 0 + 1 @@ -652,7 +652,7 @@ - + &Header format: @@ -662,9 +662,26 @@ - + + + + + px + + + + + + + Header &separation: + + + gui_header_separation + + + @@ -985,8 +1002,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans';"></p></body></html> @@ -1078,12 +1095,12 @@ p, li { white-space: pre-wrap; } setDisabled(bool) - 650 - 122 + 308 + 74 - 788 - 140 + 308 + 74 @@ -1094,12 +1111,12 @@ p, li { white-space: pre-wrap; } setDisabled(bool) - 543 - 122 + 308 + 74 - 544 - 211 + 308 + 74 @@ -1110,12 +1127,12 @@ p, li { white-space: pre-wrap; } setEnabled(bool) - 298 - 398 + 308 + 74 - 660 - 435 + 308 + 74 @@ -1126,12 +1143,12 @@ p, li { white-space: pre-wrap; } setEnabled(bool) - 330 - 367 + 345 + 363 - 823 - 372 + 837 + 435 @@ -1142,12 +1159,28 @@ p, li { white-space: pre-wrap; } setDisabled(bool) - 344 - 107 + 308 + 74 - 489 - 465 + 308 + 74 + + + + + gui_header + toggled(bool) + gui_header_separation + setEnabled(bool) + + + 261 + 346 + + + 379 + 378