From c0cc6e202c33fb3889d0025b1b04148ae66545f2 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 30 Dec 2023 14:59:20 +0000 Subject: Added button state textures + block colour progress bars --- .../src/openvic-extension/classes/GUIOverlappingElementsBox.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp') diff --git a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp index ff88781..921f633 100644 --- a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp +++ b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp @@ -120,6 +120,15 @@ Error GUIOverlappingElementsBox::set_child_count(int32_t new_count) { name, child_count, new_count ) ); + + static const StringName set_z_index_func_name = "set_z_index"; + static const StringName mouse_entered_signal_name = "mouse_entered"; + static const StringName mouse_exited_signal_name = "mouse_exited"; + + /* Move the child element in front of its neighbours when moused-over. */ + child->connect(mouse_entered_signal_name, Callable { child, set_z_index_func_name }.bind(1), CONNECT_PERSIST); + child->connect(mouse_exited_signal_name, Callable { child, set_z_index_func_name }.bind(0), CONNECT_PERSIST); + add_child(child); child_count++; } while (child_count < new_count); -- cgit v1.2.3-56-ga3b1