Add first line indent switch
This commit is contained in:
@@ -93,6 +93,7 @@ SETTINGS_TEMPLATE = {
|
||||
"odt.addColours": (bool, True),
|
||||
"odt.pageHeader": (str, nwHeadFmt.ODT_AUTO),
|
||||
"odt.pageCountOffset": (int, 0),
|
||||
"odt.firstLineIndent": (bool, False),
|
||||
"md.preserveBreaks": (bool, True),
|
||||
"html.addStyles": (bool, True),
|
||||
"html.preserveTabs": (bool, False),
|
||||
@@ -143,6 +144,7 @@ SETTINGS_LABELS = {
|
||||
"odt.addColours": QT_TRANSLATE_NOOP("Builds", "Add Highlight Colours"),
|
||||
"odt.pageHeader": QT_TRANSLATE_NOOP("Builds", "Page Header"),
|
||||
"odt.pageCountOffset": QT_TRANSLATE_NOOP("Builds", "Page Counter Offset"),
|
||||
"odt.firstLineIndent": QT_TRANSLATE_NOOP("Builds", "First Line Indent"),
|
||||
|
||||
"md": QT_TRANSLATE_NOOP("Builds", "Markdown (.md)"),
|
||||
"md.preserveBreaks": QT_TRANSLATE_NOOP("Builds", "Preserve Hard Line Breaks"),
|
||||
|
||||
@@ -332,6 +332,7 @@ class NWBuildDocument:
|
||||
bldObj.setHeaderFormat(
|
||||
self._build.getStr("odt.pageHeader"), self._build.getInt("odt.pageCountOffset")
|
||||
)
|
||||
bldObj.setFirstLineIndent(self._build.getBool("odt.firstLineIndent"))
|
||||
|
||||
scale = nwLabels.UNIT_SCALE.get(self._build.getStr("format.pageUnit"), 1.0)
|
||||
pW, pH = nwLabels.PAPER_SIZE.get(self._build.getStr("format.pageSize"), (-1.0, -1.0))
|
||||
|
||||
@@ -234,6 +234,11 @@ class ToOdt(Tokenizer):
|
||||
self._pageOffset = offset
|
||||
return
|
||||
|
||||
def setFirstLineIndent(self, state: bool) -> None:
|
||||
"""Enable or disable first line indent."""
|
||||
self._firstIndent = state
|
||||
return
|
||||
|
||||
##
|
||||
# Class Methods
|
||||
##
|
||||
|
||||
@@ -1363,6 +1363,9 @@ class _OutputTab(NScrollableForm):
|
||||
self.odtPageCountOffset.setMinimumWidth(spW)
|
||||
self.addRow(self._build.getLabel("odt.pageCountOffset"), self.odtPageCountOffset)
|
||||
|
||||
self.odtFirstLineIndent = NSwitch(self, height=iPx)
|
||||
self.addRow(self._build.getLabel("odt.firstLineIndent"), self.odtFirstLineIndent)
|
||||
|
||||
# HTML Document
|
||||
self.addGroupLabel(self._build.getLabel("html"))
|
||||
|
||||
@@ -1388,6 +1391,7 @@ class _OutputTab(NScrollableForm):
|
||||
self.odtAddColours.setChecked(self._build.getBool("odt.addColours"))
|
||||
self.odtPageHeader.setText(self._build.getStr("odt.pageHeader"))
|
||||
self.odtPageCountOffset.setValue(self._build.getInt("odt.pageCountOffset"))
|
||||
self.odtFirstLineIndent.setChecked(self._build.getBool("odt.firstLineIndent"))
|
||||
self.htmlAddStyles.setChecked(self._build.getBool("html.addStyles"))
|
||||
self.htmlPreserveTabs.setChecked(self._build.getBool("html.preserveTabs"))
|
||||
self.mdPreserveBreaks.setChecked(self._build.getBool("md.preserveBreaks"))
|
||||
@@ -1398,6 +1402,7 @@ class _OutputTab(NScrollableForm):
|
||||
self._build.setValue("odt.addColours", self.odtAddColours.isChecked())
|
||||
self._build.setValue("odt.pageHeader", self.odtPageHeader.text())
|
||||
self._build.setValue("odt.pageCountOffset", self.odtPageCountOffset.value())
|
||||
self._build.setValue("odt.firstLineIndent", self.odtFirstLineIndent.isChecked())
|
||||
self._build.setValue("html.addStyles", self.htmlAddStyles.isChecked())
|
||||
self._build.setValue("html.preserveTabs", self.htmlPreserveTabs.isChecked())
|
||||
self._build.setValue("md.preserveBreaks", self.mdPreserveBreaks.isChecked())
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
%%~name: Interlude
|
||||
%%~path: 7031beac91f75/ba8a28a246524
|
||||
%%~kind: NOVEL/DOCUMENT
|
||||
%%~hash: df8904011eda90c7b694bed725dc774bf631b348
|
||||
%%~date: Unknown/2023-08-25 16:51:58
|
||||
%%~hash: 721d3d15e0233186354ac6fa61f27db10f38e6bc
|
||||
%%~date: Unknown/2024-03-14 22:55:04
|
||||
##! Interlude
|
||||
|
||||
% Notice that this document has a title with a ‘!’ in it in addition to the two hash symbols. This means it is an unnumbered chapter. Unnumbered chapters can be treated separately from numbered chapters during export. Perfect for when you want to add an interlude, or for a prologue or epilogue.
|
||||
@@ -12,12 +12,12 @@ I've information vegetable, animal, and mineral
|
||||
I know the kings of England, and I quote the fights historical
|
||||
From Marathon to Waterloo, in order categorical
|
||||
|
||||
I'm very well acquainted, too, with matters mathematical
|
||||
I'm very well acquainted, too, with matters mathematical <<
|
||||
I understand equations, both the simple and quadratical
|
||||
About binomial theorem I'm teeming with a lot o’ news
|
||||
With many cheerful facts about the square of the hypotenuse
|
||||
|
||||
With many cheerful facts about the square of the hypotenuse
|
||||
With many cheerful facts about the square of the hypotenuse <<
|
||||
With many cheerful facts about the square of the hypotenuse
|
||||
With many cheerful facts about the square of the hypotepotenuse
|
||||
|
||||
|
||||
Reference in New Issue
Block a user