Skip to content

Commit 6c66262

Browse files
committed
#2126 editor: allow header folding
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent 7774177 commit 6c66262

File tree

10 files changed

+1411
-882
lines changed

10 files changed

+1411
-882
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 26.3.13
44

5+
- Added Markdown heading folding in the note editor with clickable gutter
6+
toggles, fold/unfold-all actions, and a new Editor setting to enable or
7+
disable the feature (for [#2126](https://github.com/pbek/QOwnNotes/issues/2126))
58
- Added a new "Files" tab to the Navigation panel that lists linked media files
69
and attachments under separate root items, jumps to the selected link in the
710
current note, and offers a context menu action to open the file externally

src/dialogs/settingsdialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ void SettingsDialog::storeSettings() {
629629
ui->showLineNumbersInEditorCheckBox->isChecked());
630630
settings.setValue(QStringLiteral("Editor/highlightCurrentLine"),
631631
ui->highlightCurrentLineCheckBox->isChecked());
632+
settings.setValue(QStringLiteral("Editor/headingFolding"),
633+
ui->headingFoldingCheckBox->isChecked());
632634
settings.setValue(QStringLiteral("Editor/hideFormattingSyntax"),
633635
ui->hideFormattingSyntaxCheckBox->isChecked());
634636
settings.setValue(QStringLiteral("Editor/hangingIndent"),
@@ -1038,6 +1040,8 @@ void SettingsDialog::readSettings() {
10381040
settings.value(QStringLiteral("Editor/showLineNumbers")).toBool());
10391041
ui->highlightCurrentLineCheckBox->setChecked(
10401042
settings.value(QStringLiteral("Editor/highlightCurrentLine"), true).toBool());
1043+
ui->headingFoldingCheckBox->setChecked(
1044+
settings.value(QStringLiteral("Editor/headingFolding"), false).toBool());
10411045
ui->hideFormattingSyntaxCheckBox->setChecked(
10421046
settings.value(QStringLiteral("Editor/hideFormattingSyntax"), false).toBool());
10431047
ui->hangingIndentCheckBox->setChecked(

src/dialogs/settingsdialog.ui

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,15 +5664,25 @@ li.checked::marker { content: &quot;\2612&quot;; }
56645664
</property>
56655665
</widget>
56665666
</item>
5667-
<item row="10" column="0" colspan="4">
5668-
<widget class="QCheckBox" name="showMarkdownImagePreviewsCheckBox">
5669-
<property name="text">
5670-
<string>Show small Markdown preview images in the editor, if there is no text after the image</string>
5671-
</property>
5672-
</widget>
5673-
</item>
5674-
<item row="7" column="1">
5675-
<widget class="QSpinBox" name="cursorWidthSpinBox">
5667+
<item row="10" column="0" colspan="4">
5668+
<widget class="QCheckBox" name="showMarkdownImagePreviewsCheckBox">
5669+
<property name="text">
5670+
<string>Show small Markdown preview images in the editor, if there is no text after the image</string>
5671+
</property>
5672+
</widget>
5673+
</item>
5674+
<item row="11" column="0" colspan="4">
5675+
<widget class="QCheckBox" name="headingFoldingCheckBox">
5676+
<property name="toolTip">
5677+
<string>Shows fold buttons for Markdown headings and allows collapsing their contents</string>
5678+
</property>
5679+
<property name="text">
5680+
<string>Enable heading folding in the editor</string>
5681+
</property>
5682+
</widget>
5683+
</item>
5684+
<item row="7" column="1">
5685+
<widget class="QSpinBox" name="cursorWidthSpinBox">
56765686
<property name="suffix">
56775687
<string notr="true">px</string>
56785688
</property>
@@ -5702,10 +5712,10 @@ li.checked::marker { content: &quot;\2612&quot;; }
57025712
</property>
57035713
</widget>
57045714
</item>
5705-
<item row="11" column="0" colspan="4">
5706-
<widget class="QCheckBox" name="hideFormattingSyntaxCheckBox">
5707-
<property name="toolTip">
5708-
<string>Hides markdown formatting syntax (like **, *, #) on lines that are not being edited</string>
5715+
<item row="12" column="0" colspan="4">
5716+
<widget class="QCheckBox" name="hideFormattingSyntaxCheckBox">
5717+
<property name="toolTip">
5718+
<string>Hides markdown formatting syntax (like **, *, #) on lines that are not being edited</string>
57095719
</property>
57105720
<property name="text">
57115721
<string>Hide markdown formatting syntax on inactive lines</string>
@@ -7854,7 +7864,8 @@ Just test yourself if you get sync conflicts and set a higher value if so.</stri
78547864
<tabstop>autoBracketRemovalCheckBox</tabstop>
78557865
<tabstop>editorWidthInDFMOnlyCheckBox</tabstop>
78567866
<tabstop>highlightCurrentLineCheckBox</tabstop>
7857-
<tabstop>hideFormattingSyntaxCheckBox</tabstop>
7867+
<tabstop>headingFoldingCheckBox</tabstop>
7868+
<tabstop>hideFormattingSyntaxCheckBox</tabstop>
78587869
<tabstop>disableCursorBlinkingCheckBox</tabstop>
78597870
<tabstop>gitCommitIntervalTime</tabstop>
78607871
<tabstop>gitLogCommandLineEdit</tabstop>

0 commit comments

Comments
 (0)