mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-25 05:07:12 +01:00
Reuse CodeEditor's SearchBar class for TextEditor.
This commit is contained in:
parent
196c136181
commit
b70482d246
@ -14,6 +14,8 @@
|
||||
#include "scene/gui/text_edit.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
|
||||
#include "editor/code_editor.h"
|
||||
|
||||
#include "scene/resources/dynamic_font.h"
|
||||
|
||||
String TextEditorVanillaEditor::get_current_path() {
|
||||
@ -177,8 +179,10 @@ void TextEditorVanillaEditor::count_characters() {
|
||||
}
|
||||
|
||||
void TextEditorVanillaEditor::open_search_box() {
|
||||
_find_replace_bar->popup_search();
|
||||
}
|
||||
void TextEditorVanillaEditor::open_replace_box() {
|
||||
_find_replace_bar->popup_replace();
|
||||
}
|
||||
|
||||
TextEditorVanillaEditor::TextEditorVanillaEditor() {
|
||||
@ -229,6 +233,10 @@ TextEditorVanillaEditor::TextEditorVanillaEditor() {
|
||||
text_editor->set("custom_constants/completion_max_width", 20);
|
||||
text_editor->set("custom_constants/completion_scroll_width", 20);
|
||||
|
||||
_find_replace_bar = memnew(FindReplaceBar);
|
||||
_find_replace_bar->set_text_edit(text_editor);
|
||||
add_child(_find_replace_bar);
|
||||
|
||||
HBoxContainer *file_info = memnew(HBoxContainer);
|
||||
add_child(file_info);
|
||||
|
||||
|
@ -17,6 +17,7 @@ class CheckBox;
|
||||
class Button;
|
||||
class TextureRect;
|
||||
class Label;
|
||||
class FindReplaceBar;
|
||||
|
||||
class TextEditorVanillaEditor : public VBoxContainer {
|
||||
GDCLASS(TextEditorVanillaEditor, VBoxContainer);
|
||||
@ -64,6 +65,8 @@ protected:
|
||||
Label *file_info_c_counter;
|
||||
CheckBox *file_info_read_only;
|
||||
|
||||
FindReplaceBar *_find_replace_bar;
|
||||
|
||||
String current_path;
|
||||
String current_filename;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user