mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
LRF output: Add option to control header separation from body text
This commit is contained in:
parent
8fe381e502
commit
e14b37bad2
@ -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
|
||||
|
@ -6,7 +6,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>866</width>
|
||||
<height>671</height>
|
||||
<height>679</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
@ -115,7 +115,7 @@
|
||||
<item row="0" column="0" >
|
||||
<widget class="QStackedWidget" name="stack" >
|
||||
<property name="currentIndex" >
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="metadata_page" >
|
||||
<layout class="QHBoxLayout" >
|
||||
@ -652,7 +652,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="label_10" >
|
||||
<property name="text" >
|
||||
<string>&Header format:</string>
|
||||
@ -662,9 +662,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLineEdit" name="gui_headerformat" />
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QSpinBox" name="gui_header_separation" >
|
||||
<property name="suffix" >
|
||||
<string> px</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="label_29" >
|
||||
<property name="text" >
|
||||
<string>Header &separation:</string>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>gui_header_separation</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -985,8 +1002,8 @@
|
||||
<string><!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></string>
|
||||
</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></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1078,12 +1095,12 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>650</x>
|
||||
<y>122</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>788</x>
|
||||
<y>140</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1094,12 +1111,12 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>543</x>
|
||||
<y>122</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>544</x>
|
||||
<y>211</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1110,12 +1127,12 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>298</x>
|
||||
<y>398</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>660</x>
|
||||
<y>435</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1126,12 +1143,12 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>330</x>
|
||||
<y>367</y>
|
||||
<x>345</x>
|
||||
<y>363</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>823</x>
|
||||
<y>372</y>
|
||||
<x>837</x>
|
||||
<y>435</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1142,12 +1159,28 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>344</x>
|
||||
<y>107</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>489</x>
|
||||
<y>465</y>
|
||||
<x>308</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>gui_header</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>gui_header_separation</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>261</x>
|
||||
<y>346</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>379</x>
|
||||
<y>378</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
|
Loading…
x
Reference in New Issue
Block a user