mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
TextEditorWidget: Whitespace related options
This commit is contained in:
parent
6d3d097832
commit
115348147d
Notes:
sideshowbarker
2024-07-18 21:05:53 +09:00
Author: https://github.com/lucastarche Commit: https://github.com/SerenityOS/serenity/commit/115348147d4 Pull-request: https://github.com/SerenityOS/serenity/pull/5859
@ -500,6 +500,12 @@ void TextEditorWidget::initialize_menubar(GUI::MenuBar& menubar)
|
||||
m_editor->set_soft_tab_width(16);
|
||||
});
|
||||
|
||||
m_soft_tab_width_actions.add_action(*m_soft_tab_1_width_action);
|
||||
m_soft_tab_width_actions.add_action(*m_soft_tab_2_width_action);
|
||||
m_soft_tab_width_actions.add_action(*m_soft_tab_4_width_action);
|
||||
m_soft_tab_width_actions.add_action(*m_soft_tab_8_width_action);
|
||||
m_soft_tab_width_actions.add_action(*m_soft_tab_16_width_action);
|
||||
|
||||
soft_tab_width_menu.add_action(*m_soft_tab_1_width_action);
|
||||
soft_tab_width_menu.add_action(*m_soft_tab_2_width_action);
|
||||
soft_tab_width_menu.add_action(*m_soft_tab_4_width_action);
|
||||
@ -508,6 +514,20 @@ void TextEditorWidget::initialize_menubar(GUI::MenuBar& menubar)
|
||||
|
||||
m_soft_tab_4_width_action->set_checked(true);
|
||||
|
||||
view_menu.add_separator();
|
||||
|
||||
m_visualize_trailing_whitespace_action = GUI::Action::create_checkable("Visualize trailing whitespace", [&](auto&) {
|
||||
m_editor->set_visualize_trailing_whitespace(m_visualize_trailing_whitespace_action->is_checked());
|
||||
});
|
||||
m_visualize_leading_whitespace_action = GUI::Action::create_checkable("Visualize leading whitespace", [&](auto&) {
|
||||
m_editor->set_visualize_leading_whitespace(m_visualize_leading_whitespace_action->is_checked());
|
||||
});
|
||||
|
||||
m_visualize_trailing_whitespace_action->set_checked(true);
|
||||
|
||||
view_menu.add_action(*m_visualize_trailing_whitespace_action);
|
||||
view_menu.add_action(*m_visualize_leading_whitespace_action);
|
||||
|
||||
view_menu.add_separator();
|
||||
view_menu.add_action(*m_no_preview_action);
|
||||
view_menu.add_action(*m_markdown_preview_action);
|
||||
|
@ -114,6 +114,9 @@ private:
|
||||
RefPtr<GUI::Action> m_wrap_anywhere_action;
|
||||
RefPtr<GUI::Action> m_wrap_at_words_action;
|
||||
|
||||
RefPtr<GUI::Action> m_visualize_trailing_whitespace_action;
|
||||
RefPtr<GUI::Action> m_visualize_leading_whitespace_action;
|
||||
|
||||
GUI::ActionGroup m_soft_tab_width_actions;
|
||||
RefPtr<GUI::Action> m_soft_tab_1_width_action;
|
||||
RefPtr<GUI::Action> m_soft_tab_2_width_action;
|
||||
|
Loading…
Reference in New Issue
Block a user