Rename TreeSearch::notify_item_edited
Also: Run clang-format. Remove comment.
This commit is contained in:
parent
84b2a60521
commit
329e90dfc6
|
@ -112,7 +112,7 @@ void TaskTree::_update_item(TreeItem *p_item) {
|
||||||
if (!warning_text.is_empty()) {
|
if (!warning_text.is_empty()) {
|
||||||
p_item->add_button(0, theme_cache.task_warning_icon, 0, false, warning_text);
|
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() {
|
void TaskTree::_update_tree() {
|
||||||
|
@ -582,8 +582,6 @@ TaskTree::TaskTree() {
|
||||||
editable = true;
|
editable = true;
|
||||||
updating_tree = false;
|
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);
|
VBoxContainer *vbox_container = memnew(VBoxContainer);
|
||||||
add_child(vbox_container);
|
add_child(vbox_container);
|
||||||
vbox_container->set_anchors_preset(PRESET_FULL_RECT);
|
vbox_container->set_anchors_preset(PRESET_FULL_RECT);
|
||||||
|
|
|
@ -448,7 +448,7 @@ inline bool TreeSearch::_vector_has_bsearch(Vector<T *> p_vec, T *element) {
|
||||||
return in_array && p_vec[idx] == 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) {
|
if (item->get_cell_mode(0) != TreeItem::CELL_MODE_CUSTOM) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,6 @@ void TreeSearch::update_search(Tree *p_tree) {
|
||||||
if (search_mode == TreeSearchMode::FILTER) {
|
if (search_mode == TreeSearchMode::FILTER) {
|
||||||
_filter_tree(search_mask);
|
_filter_tree(search_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeSearch::TreeSearch(TreeSearchPanel *p_search_panel) {
|
TreeSearch::TreeSearch(TreeSearchPanel *p_search_panel) {
|
||||||
|
|
|
@ -24,12 +24,12 @@
|
||||||
#endif // LIMBOAI_GDEXTENSION
|
#endif // LIMBOAI_GDEXTENSION
|
||||||
|
|
||||||
#ifdef LIMBOAI_MODULE
|
#ifdef LIMBOAI_MODULE
|
||||||
|
#include "core/templates/hash_map.h"
|
||||||
#include "scene/gui/check_box.h"
|
#include "scene/gui/check_box.h"
|
||||||
#include "scene/gui/flow_container.h"
|
#include "scene/gui/flow_container.h"
|
||||||
#include "scene/gui/label.h"
|
#include "scene/gui/label.h"
|
||||||
#include "scene/gui/line_edit.h"
|
#include "scene/gui/line_edit.h"
|
||||||
#include "scene/gui/tree.h"
|
#include "scene/gui/tree.h"
|
||||||
#include "core/templates/hash_map.h"
|
|
||||||
#endif // LIMBOAI_MODULE
|
#endif // LIMBOAI_MODULE
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
@ -41,6 +41,7 @@ enum TreeSearchMode {
|
||||||
|
|
||||||
class TreeSearchPanel : public HFlowContainer {
|
class TreeSearchPanel : public HFlowContainer {
|
||||||
GDCLASS(TreeSearchPanel, HFlowContainer)
|
GDCLASS(TreeSearchPanel, HFlowContainer)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Button *toggle_button_filter_highlight;
|
Button *toggle_button_filter_highlight;
|
||||||
Button *close_button;
|
Button *close_button;
|
||||||
|
@ -116,7 +117,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void update_search(Tree *p_tree);
|
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() { ERR_FAIL_MSG("TreeSearch needs a TreeSearchPanel to work properly"); }
|
||||||
TreeSearch(TreeSearchPanel *p_search_panel);
|
TreeSearch(TreeSearchPanel *p_search_panel);
|
||||||
|
|
Loading…
Reference in New Issue