Rename TreeSearch::notify_item_edited

Also: Run clang-format. Remove comment.
This commit is contained in:
Alexander Montag 2024-09-28 15:45:52 +00:00
parent 84b2a60521
commit 329e90dfc6
3 changed files with 10 additions and 12 deletions

View File

@ -112,7 +112,7 @@ void TaskTree::_update_item(TreeItem *p_item) {
if (!warning_text.is_empty()) {
p_item->add_button(0, theme_cache.task_warning_icon, 0, false, warning_text);
}
tree_search->on_item_edited(p_item); // this is necessary to preserve custom drawing from tree search.
tree_search->notify_item_edited(p_item); // this is necessary to preserve custom drawing from tree search.
}
void TaskTree::_update_tree() {
@ -582,8 +582,6 @@ TaskTree::TaskTree() {
editable = true;
updating_tree = false;
// for Tree + TreeSearch, we want a VBoxContainer. For now, rather than changing this classes type, let's do nesting:
// TaskTree -> VBoxContainer -> [Tree, TreeSearchPanel]
VBoxContainer *vbox_container = memnew(VBoxContainer);
add_child(vbox_container);
vbox_container->set_anchors_preset(PRESET_FULL_RECT);

View File

@ -448,7 +448,7 @@ inline bool TreeSearch::_vector_has_bsearch(Vector<T *> p_vec, T *element) {
return in_array && p_vec[idx] == element;
}
void TreeSearch::on_item_edited(TreeItem *item) {
void TreeSearch::notify_item_edited(TreeItem *item) {
if (item->get_cell_mode(0) != TreeItem::CELL_MODE_CUSTOM) {
return;
}
@ -486,7 +486,6 @@ void TreeSearch::update_search(Tree *p_tree) {
if (search_mode == TreeSearchMode::FILTER) {
_filter_tree(search_mask);
}
}
TreeSearch::TreeSearch(TreeSearchPanel *p_search_panel) {

View File

@ -24,12 +24,12 @@
#endif // LIMBOAI_GDEXTENSION
#ifdef LIMBOAI_MODULE
#include "core/templates/hash_map.h"
#include "scene/gui/check_box.h"
#include "scene/gui/flow_container.h"
#include "scene/gui/label.h"
#include "scene/gui/line_edit.h"
#include "scene/gui/tree.h"
#include "core/templates/hash_map.h"
#endif // LIMBOAI_MODULE
using namespace godot;
@ -41,6 +41,7 @@ enum TreeSearchMode {
class TreeSearchPanel : public HFlowContainer {
GDCLASS(TreeSearchPanel, HFlowContainer)
private:
Button *toggle_button_filter_highlight;
Button *close_button;
@ -116,7 +117,7 @@ protected:
public:
void update_search(Tree *p_tree);
void on_item_edited(TreeItem *p_item);
void notify_item_edited(TreeItem *p_item);
TreeSearch() { ERR_FAIL_MSG("TreeSearch needs a TreeSearchPanel to work properly"); }
TreeSearch(TreeSearchPanel *p_search_panel);