1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

HackStudio: Add FindWidget

The find widget appears on Ctrl+F.

It uses the GUI::TextEditor search API to search for text, which also
takes care of highlighting the search results.
This commit is contained in:
Itamar 2022-03-29 16:45:26 +03:00 committed by Andreas Kling
parent de902ab659
commit d9d299f884
8 changed files with 186 additions and 4 deletions

View file

@ -8,6 +8,7 @@
#pragma once
#include "Debugger/BreakpointCallback.h"
#include "FindWidget.h"
#include "Git/GitRepo.h"
#include "LanguageClient.h"
#include <AK/Function.h>
@ -52,6 +53,9 @@ public:
Function<void()> on_change;
Function<void(EditorWrapper&)> on_tab_close_request;
void search_action();
FindWidget const& find_widget() const { return *m_find_widget; }
private:
static constexpr auto untitled_label = "(Untitled)";
@ -62,6 +66,7 @@ private:
String m_filename;
String m_filename_title;
RefPtr<Editor> m_editor;
RefPtr<FindWidget> m_find_widget;
Optional<String> m_project_root;
RefPtr<GitRepo> m_git_repo;