Readded grid menu and fixed grid modify tool

This commit is contained in:
Yousef Khadadeh 2026-04-06 12:23:46 +03:00
parent 19db2a57ea
commit b7bd2efc71
10 changed files with 180 additions and 161 deletions

View file

@ -38,7 +38,7 @@ template <typename T> class DropDown : public Element {
.layoutDirection = CLAY_LEFT_TO_RIGHT,
}
}) {
ElementHelpers::text_label(gui, selections[*data]);
ElementHelpers::text_label(gui, selections[static_cast<size_t>(*data)]);
CLAY_AUTO_ID({.layout = {.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0)}}}) {}
CLAY_AUTO_ID({
.layout = {
@ -121,7 +121,7 @@ template <typename T> class DropDown : public Element {
update_hovering_over(i, l->mouseHovering);
if(l->mouseHovering && button.button == InputManager::MouseButton::LEFT && button.down) {
gui.set_post_callback_func([&, i] {
*d = i;
*d = static_cast<T>(i);
isOpen = false;
if(opts.onClick) opts.onClick();
});