@@ -1222,6 +1222,12 @@ int TreeItem::get_button_by_id(int p_column, int p_id) const {
12221222 return -1 ;
12231223}
12241224
1225+ Color TreeItem::get_button_color (int p_column, int p_index) const {
1226+ ERR_FAIL_INDEX_V (p_column, cells.size (), Color ());
1227+ ERR_FAIL_INDEX_V (p_index, cells[p_column].buttons .size (), Color ());
1228+ return cells[p_column].buttons [p_index].color ;
1229+ }
1230+
12251231void TreeItem::set_button_tooltip_text (int p_column, int p_index, const String &p_tooltip) {
12261232 ERR_FAIL_INDEX (p_column, cells.size ());
12271233 ERR_FAIL_INDEX (p_index, cells[p_column].buttons .size ());
@@ -1662,6 +1668,7 @@ void TreeItem::_bind_methods() {
16621668 ClassDB::bind_method (D_METHOD (" get_button_tooltip_text" , " column" , " button_index" ), &TreeItem::get_button_tooltip_text);
16631669 ClassDB::bind_method (D_METHOD (" get_button_id" , " column" , " button_index" ), &TreeItem::get_button_id);
16641670 ClassDB::bind_method (D_METHOD (" get_button_by_id" , " column" , " id" ), &TreeItem::get_button_by_id);
1671+ ClassDB::bind_method (D_METHOD (" get_button_color" , " column" , " id" ), &TreeItem::get_button_color);
16651672 ClassDB::bind_method (D_METHOD (" get_button" , " column" , " button_index" ), &TreeItem::get_button);
16661673 ClassDB::bind_method (D_METHOD (" set_button_tooltip_text" , " column" , " button_index" , " tooltip" ), &TreeItem::set_button_tooltip_text);
16671674 ClassDB::bind_method (D_METHOD (" set_button" , " column" , " button_index" , " button" ), &TreeItem::set_button);
0 commit comments