From 7dfbab418f18f1803606bffdbbbffdcc5faf3362 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 5 Jul 2024 13:25:21 +0200 Subject: [PATCH] TextEditor: fix toggle visualize whitespace and text wrapping Fixes: QTCREATORBUG-31202 Change-Id: I9d601dfb9d9b00e2c92525b55874c8314051ae02 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 2 ++ src/plugins/texteditor/texteditorplugin.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 30657f1741b..33ec2ed7e42 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4125,6 +4125,7 @@ void TextEditorWidgetPrivate::registerActions() .contextAction(); m_visualizeWhitespaceAction = ActionBuilder(this, VISUALIZE_WHITESPACE) .setContext(m_editorContext) + .setCheckable(true) .addOnToggled( this, [this](bool checked) { @@ -4140,6 +4141,7 @@ void TextEditorWidgetPrivate::registerActions() .contextAction(); m_textWrappingAction = ActionBuilder(this, TEXT_WRAPPING) .setContext(m_editorContext) + .setCheckable(true) .addOnToggled( this, [this](bool checked) { diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 5df9de54701..c774fed0438 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -453,7 +453,8 @@ void TextEditorPlugin::createEditorCommands() TextActionBuilder(this, VISUALIZE_WHITESPACE) .setText(Tr::tr("&Visualize Whitespace")) .setDefaultKeySequence(Tr::tr("Meta+E, Meta+V"), Tr::tr("Ctrl+E, Ctrl+V")) - .addToContainer(M_EDIT_ADVANCED, G_EDIT_FORMAT); + .addToContainer(M_EDIT_ADVANCED, G_EDIT_FORMAT) + .setCheckable(true); TextActionBuilder(this, CLEAN_WHITESPACE) .setText(Tr::tr("Clean Whitespace")) .addToContainer(M_EDIT_ADVANCED, G_EDIT_FORMAT);