|
@@ -5750,7 +5750,7 @@ String Tree::get_tooltip(const Point2 &p_pos) const {
|
|
|
|
|
|
if (it) {
|
|
if (it) {
|
|
const String item_tooltip = it->get_tooltip_text(col);
|
|
const String item_tooltip = it->get_tooltip_text(col);
|
|
- if (item_tooltip.is_empty()) {
|
|
|
|
|
|
+ if (enable_auto_tooltip && item_tooltip.is_empty()) {
|
|
return it->get_text(col);
|
|
return it->get_text(col);
|
|
}
|
|
}
|
|
return item_tooltip;
|
|
return item_tooltip;
|
|
@@ -5832,6 +5832,14 @@ bool Tree::get_allow_search() const {
|
|
return allow_search;
|
|
return allow_search;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void Tree::set_auto_tooltip(bool p_enable) {
|
|
|
|
+ enable_auto_tooltip = p_enable;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool Tree::is_auto_tooltip_enabled() const {
|
|
|
|
+ return enable_auto_tooltip;
|
|
|
|
+}
|
|
|
|
+
|
|
void Tree::_bind_methods() {
|
|
void Tree::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("clear"), &Tree::clear);
|
|
ClassDB::bind_method(D_METHOD("clear"), &Tree::clear);
|
|
ClassDB::bind_method(D_METHOD("create_item", "parent", "index"), &Tree::create_item, DEFVAL(Variant()), DEFVAL(-1));
|
|
ClassDB::bind_method(D_METHOD("create_item", "parent", "index"), &Tree::create_item, DEFVAL(Variant()), DEFVAL(-1));
|
|
@@ -5915,6 +5923,9 @@ void Tree::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("set_allow_search", "allow"), &Tree::set_allow_search);
|
|
ClassDB::bind_method(D_METHOD("set_allow_search", "allow"), &Tree::set_allow_search);
|
|
ClassDB::bind_method(D_METHOD("get_allow_search"), &Tree::get_allow_search);
|
|
ClassDB::bind_method(D_METHOD("get_allow_search"), &Tree::get_allow_search);
|
|
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_auto_tooltip", "enable"), &Tree::set_auto_tooltip);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("is_auto_tooltip_enabled"), &Tree::is_auto_tooltip_enabled);
|
|
|
|
+
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "columns"), "set_columns", "get_columns");
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "columns"), "set_columns", "get_columns");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "column_titles_visible"), "set_column_titles_visible", "are_column_titles_visible");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "column_titles_visible"), "set_column_titles_visible", "are_column_titles_visible");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_reselect"), "set_allow_reselect", "get_allow_reselect");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_reselect"), "set_allow_reselect", "get_allow_reselect");
|
|
@@ -5927,6 +5938,7 @@ void Tree::_bind_methods() {
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "select_mode", PROPERTY_HINT_ENUM, "Single,Row,Multi"), "set_select_mode", "get_select_mode");
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "select_mode", PROPERTY_HINT_ENUM, "Single,Row,Multi"), "set_select_mode", "get_select_mode");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_horizontal_enabled"), "set_h_scroll_enabled", "is_h_scroll_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_horizontal_enabled"), "set_h_scroll_enabled", "is_h_scroll_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_vertical_enabled"), "set_v_scroll_enabled", "is_v_scroll_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_vertical_enabled"), "set_v_scroll_enabled", "is_v_scroll_enabled");
|
|
|
|
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "auto_tooltip"), "set_auto_tooltip", "is_auto_tooltip_enabled");
|
|
|
|
|
|
ADD_SIGNAL(MethodInfo("item_selected"));
|
|
ADD_SIGNAL(MethodInfo("item_selected"));
|
|
ADD_SIGNAL(MethodInfo("cell_selected"));
|
|
ADD_SIGNAL(MethodInfo("cell_selected"));
|