From d7c9bea78383b972d473a249bc9e792dff39cc86 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 8 May 2025 14:53:47 -0400 Subject: [PATCH] Add spoiler formatting to the quick format bar --- src/app/qml/QuickFormatBar.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app/qml/QuickFormatBar.qml b/src/app/qml/QuickFormatBar.qml index a11f1a9ce..0e0d8cbdf 100644 --- a/src/app/qml/QuickFormatBar.qml +++ b/src/app/qml/QuickFormatBar.qml @@ -75,6 +75,25 @@ QQC2.Popup { QQC2.ToolTip.visible: hovered QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay } + QQC2.ToolButton { + icon.name: "view-hidden-symbolic" + text: i18n("Spoiler") + display: QQC2.AbstractButton.IconOnly + + onClicked: { + const format = { + start: "||", + end: "||", + extra: "" + }; + formattingSelected(format, selectionStart, selectionEnd); + root.close(); + } + + QQC2.ToolTip.text: text + QQC2.ToolTip.visible: hovered + QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay + } QQC2.ToolButton { icon.name: "format-text-code" text: i18n("Code block")