diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2021-09-14 18:19:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 18:19:11 +0200 |
commit | ed0a3b29dd7d1b4c3f49915ddf38614058e3b88d (patch) | |
tree | f8e3956094d2a869aa06f1297224092d97b32e10 | |
parent | a9b600bac0a9a8fdd3b217c6d3cb6639ae80c1f8 (diff) | |
parent | 38b312404ba4db8c6b2c804346ab34bdf183ae83 (diff) |
Merge pull request #52636 from Jummit/highlight_categories
Highlight hovered inspector categories
-rw-r--r-- | editor/editor_inspector.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 298c1ed917..6bbf0f965e 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1266,9 +1266,13 @@ void EditorInspectorSection::_notification(int p_what) { } header_height += get_theme_constant(SNAME("vseparation"), SNAME("Tree")); + Rect2 header_rect = Rect2(Vector2(), Vector2(get_size().width, header_height)); Color c = bg_color; c.a *= 0.4; - draw_rect(Rect2(Vector2(), Vector2(get_size().width, header_height)), c); + if (foldable && header_rect.has_point(get_local_mouse_position())) { + c = c.lightened(Input::get_singleton()->is_mouse_button_pressed(MOUSE_BUTTON_LEFT) ? -0.05 : 0.2); + } + draw_rect(header_rect, c); const int arrow_margin = 2; const int arrow_width = arrow.is_valid() ? arrow->get_width() : 0; @@ -1315,12 +1319,14 @@ void EditorInspectorSection::_notification(int p_what) { if (dropping) { dropping_unfold_timer->start(); } + update(); } break; case NOTIFICATION_MOUSE_EXIT: { if (dropping) { dropping_unfold_timer->stop(); } + update(); } break; } } @@ -1395,6 +1401,8 @@ void EditorInspectorSection::gui_input(const Ref<InputEvent> &p_event) { } else { fold(); } + } else if (mb.is_valid() && !mb->is_pressed()) { + update(); } } |