aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-30 15:59:20 +0100
committer hop311 <hop3114@gmail.com>2023-12-30 15:59:20 +0100
commitc0cc6e202c33fb3889d0025b1b04148ae66545f2 (patch)
tree65ef49b0d12cf307269defeb0960f25ea442f777 /extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp
parentf2f42d1b65605876a6ec12626be55183b4681b88 (diff)
Added button state textures + block colour progress bars
Diffstat (limited to 'extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp')
-rw-r--r--extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp9
1 files changed, 9 insertions, 0 deletions
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);