mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #70410 from Maran23/4-x-search-result-theme-update
Rebuild search result tree when the theme is changed
This commit is contained in:
commit
f1b23e8c39
@ -569,8 +569,6 @@ FindInFilesPanel::FindInFilesPanel() {
|
||||
hbc->add_child(find_label);
|
||||
|
||||
_search_text_label = memnew(Label);
|
||||
_search_text_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_search_text_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
hbc->add_child(_search_text_label);
|
||||
|
||||
_progress_bar = memnew(ProgressBar);
|
||||
@ -598,8 +596,6 @@ FindInFilesPanel::FindInFilesPanel() {
|
||||
}
|
||||
|
||||
_results_display = memnew(Tree);
|
||||
_results_display->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_results_display->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
_results_display->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
_results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected));
|
||||
_results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited));
|
||||
@ -688,13 +684,20 @@ void FindInFilesPanel::stop_search() {
|
||||
|
||||
void FindInFilesPanel::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_PROCESS: {
|
||||
_progress_bar->set_as_ratio(_finder->get_progress());
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_search_text_label->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_search_text_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
_results_display->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
|
||||
_results_display->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
|
||||
|
||||
// Rebuild search tree.
|
||||
if (!_finder->get_search_text().is_empty()) {
|
||||
start_search();
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_PROCESS: {
|
||||
_progress_bar->set_as_ratio(_finder->get_progress());
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user