Fixed dropdown
This commit is contained in:
parent
f944cb8a68
commit
b50cab2d33
11 changed files with 135 additions and 96 deletions
|
|
@ -18,22 +18,22 @@ template <typename T> void ColorPickerButton<T>::layout(const Clay_ElementId& id
|
|||
}
|
||||
});
|
||||
if(isOpen) {
|
||||
gui.zIndex++;
|
||||
ElementHelpers::top_to_bottom_window_popup_layout(gui, "Color Picker", CLAY_SIZING_FIT(300), CLAY_SIZING_FIT(0), [&, val, data = data]() {
|
||||
ElementHelpers::color_picker_items(gui, "c", val, {
|
||||
.hasAlpha = data.hasAlpha,
|
||||
.onEdit = data.onEdit
|
||||
});
|
||||
}, {
|
||||
.mouseButton = [&](const InputManager::MouseButtonCallbackArgs& button, bool mouseHovering) {
|
||||
if(!mouseHovering && button.button == InputManager::MouseButton::LEFT && button.down) {
|
||||
isOpen = false;
|
||||
gui.set_to_layout();
|
||||
gui.set_z_index(gui.get_z_index() + 1, [&] {
|
||||
ElementHelpers::top_to_bottom_window_popup_layout(gui, "Color Picker", CLAY_SIZING_FIT(300), CLAY_SIZING_FIT(0), [&, val, data = data]() {
|
||||
ElementHelpers::color_picker_items(gui, "c", val, {
|
||||
.hasAlpha = data.hasAlpha,
|
||||
.onEdit = data.onEdit
|
||||
});
|
||||
}, {
|
||||
.mouseButton = [&](const InputManager::MouseButtonCallbackArgs& button, bool mouseHovering) {
|
||||
if(!mouseHovering && button.button == InputManager::MouseButton::LEFT && button.down) {
|
||||
isOpen = false;
|
||||
gui.set_to_layout();
|
||||
}
|
||||
return mouseHovering;
|
||||
}
|
||||
return mouseHovering;
|
||||
}
|
||||
});
|
||||
});
|
||||
gui.zIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue