|
@@ -2241,10 +2241,18 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
|
|
|
}
|
|
|
|
|
|
if (p_item->cells[0].selected) {
|
|
|
- if (has_focus()) {
|
|
|
- theme_cache.selected_focus->draw(ci, row_rect);
|
|
|
+ if (is_row_hovered) {
|
|
|
+ if (has_focus()) {
|
|
|
+ theme_cache.hovered_selected_focus->draw(ci, row_rect);
|
|
|
+ } else {
|
|
|
+ theme_cache.hovered_selected->draw(ci, row_rect);
|
|
|
+ }
|
|
|
} else {
|
|
|
- theme_cache.selected->draw(ci, row_rect);
|
|
|
+ if (has_focus()) {
|
|
|
+ theme_cache.selected_focus->draw(ci, row_rect);
|
|
|
+ } else {
|
|
|
+ theme_cache.selected->draw(ci, row_rect);
|
|
|
+ }
|
|
|
}
|
|
|
} else if (!drop_mode_flags) {
|
|
|
if (is_cell_button_hovered) {
|
|
@@ -2281,10 +2289,18 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
|
|
|
r.position.x = get_size().width - r.position.x - r.size.x;
|
|
|
}
|
|
|
if (p_item->cells[i].selected) {
|
|
|
- if (has_focus()) {
|
|
|
- theme_cache.selected_focus->draw(ci, r);
|
|
|
+ if (is_cell_hovered) {
|
|
|
+ if (has_focus()) {
|
|
|
+ theme_cache.hovered_selected_focus->draw(ci, r);
|
|
|
+ } else {
|
|
|
+ theme_cache.hovered_selected->draw(ci, r);
|
|
|
+ }
|
|
|
} else {
|
|
|
- theme_cache.selected->draw(ci, r);
|
|
|
+ if (has_focus()) {
|
|
|
+ theme_cache.selected_focus->draw(ci, r);
|
|
|
+ } else {
|
|
|
+ theme_cache.selected->draw(ci, r);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -2347,7 +2363,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
|
|
|
} else {
|
|
|
bool draw_as_hover = !drop_mode_flags && (select_mode == SELECT_ROW ? is_row_hovered : is_cell_hovered);
|
|
|
bool draw_as_hover_dim = draw_as_hover && is_cell_button_hovered;
|
|
|
- cell_color = p_item->cells[i].selected ? theme_cache.font_selected_color : (draw_as_hover_dim ? theme_cache.font_hovered_dimmed_color : (draw_as_hover ? theme_cache.font_hovered_color : theme_cache.font_color));
|
|
|
+ cell_color = p_item->cells[i].selected && draw_as_hover ? theme_cache.font_hovered_selected_color : (p_item->cells[i].selected ? theme_cache.font_selected_color : (draw_as_hover_dim ? theme_cache.font_hovered_dimmed_color : (draw_as_hover ? theme_cache.font_hovered_color : theme_cache.font_color)));
|
|
|
}
|
|
|
|
|
|
Color font_outline_color = theme_cache.font_outline_color;
|
|
@@ -5989,6 +6005,8 @@ void Tree::_bind_methods() {
|
|
|
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, hovered);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, hovered_dimmed);
|
|
|
+ BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, hovered_selected);
|
|
|
+ BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, hovered_selected_focus);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, selected);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, selected_focus);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, Tree, cursor);
|
|
@@ -6016,6 +6034,7 @@ void Tree::_bind_methods() {
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, font_color);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, font_hovered_color);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, font_hovered_dimmed_color);
|
|
|
+ BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, font_hovered_selected_color);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, font_selected_color);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, font_disabled_color);
|
|
|
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, Tree, drop_position_color);
|