summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJummit <jummit@web.de>2021-09-13 18:53:59 +0200
committerJummit <jummit@web.de>2021-09-13 21:35:09 +0200
commit38b312404ba4db8c6b2c804346ab34bdf183ae83 (patch)
tree3a87b2c4b4c7eb815563b3b103dd3a4177403e2e /editor
parent41562b91982074a4ab9c1f151cca1ec0681fc356 (diff)
Highlight hovered inspector categories
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index d3841ad6c0..3834751b8f 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();
}
}