mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
TextEditor: Implement word wrapping
Add a new wrapping mode to the TextEditor that will wrap lines at the spaces between words. Replace the previous menubar checkbox 'Wrapping Mode' in HackStudio and the TextEditor with an exclusive submenu which allows switching between 'No wrapping', 'Wrap anywhere' and 'Wrap at words'. 'Wrap anywhere' (the new 'Wrap lines') is still the default mode. Setting the wrapping mode in the constructors of the TextEditorWidget and HackStudio has been removed, it is now set when constructing the menubar actions.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 22:36:50 +09:00
Author: https://github.com/supex0fan Commit: https://github.com/SerenityOS/serenity/commit/cc2f35badd4 Pull-request: https://github.com/SerenityOS/serenity/pull/4866 Issue: https://github.com/SerenityOS/serenity/issues/4788 Reviewed-by: https://github.com/Dexesttp Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bcoles Reviewed-by: https://github.com/emanuele6
@@ -39,6 +39,7 @@
|
||||
#include "Project.h"
|
||||
#include "ProjectFile.h"
|
||||
#include "TerminalWrapper.h"
|
||||
#include <LibGUI/ActionGroup.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Splitter.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
@@ -169,5 +170,10 @@ private:
|
||||
RefPtr<GUI::Action> m_debug_action;
|
||||
RefPtr<GUI::Action> m_build_action;
|
||||
RefPtr<GUI::Action> m_run_action;
|
||||
|
||||
GUI::ActionGroup m_wrapping_mode_actions;
|
||||
RefPtr<GUI::Action> m_no_wrapping_action;
|
||||
RefPtr<GUI::Action> m_wrap_anywhere_action;
|
||||
RefPtr<GUI::Action> m_wrap_at_words_action;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user