Working on getting GUI functional again

This commit is contained in:
Yousef Khadadeh 2026-03-31 17:33:09 +03:00
parent f3fde56dcf
commit 16c3097534
49 changed files with 178 additions and 104 deletions

View file

@ -13,7 +13,7 @@ struct ColorPickerItemsOptions {
template <typename T> void color_picker_items(GUIManager& gui, const char* id, T* val, const ColorPickerItemsOptions& options = {}) {
gui.new_id(id, [&] {
auto fullOnEdit = [&gui, oE = options.onEdit, val]() {
oE();
if(oE) oE();
gui.set_to_layout();
};
gui.element<ColorPicker<T>>("c", val, options.hasAlpha, fullOnEdit);

View file

@ -4,8 +4,8 @@
namespace GUIStuff { namespace ElementHelpers {
void top_to_bottom_window_popup_layout(GUIManager& gui, const char* id, Clay_SizingAxis x, Clay_SizingAxis y, const std::function<void()>& innerContent, const LayoutElement::Callbacks& callbacks) {
gui.element<LayoutElement>(id, [&] {
CLAY_AUTO_ID({
gui.element<LayoutElement>(id, [&] (const Clay_ElementId& lId) {
CLAY(lId, {
.layout = {
.sizing = {.width = x, .height = y },
.padding = CLAY_PADDING_ALL(gui.io.theme->padding1),

View file

@ -7,7 +7,7 @@ namespace GUIStuff { namespace ElementHelpers {
template <typename T> void slider_scalar_field(GUIManager& gui, const char* id, std::string_view name, T* val, T min, T max, TextBoxScalarOptions options = {}) {
gui.new_id(id, [&] {
options.onEdit = [&, oE = options.onEdit] {
oE();
if(oE) oE();
gui.set_to_layout();
};
left_to_right_line_layout(gui, [&]() {

View file

@ -5,8 +5,8 @@ namespace GUIStuff { namespace ElementHelpers {
void paint_circle_popup_menu(GUIManager& gui, const char* id, const Vector2f& centerPos, const PaintCircleMenu::Data& val) {
constexpr float size = 300.0f;
gui.element<LayoutElement>(id, [&] {
CLAY_AUTO_ID({.layout = {
gui.element<LayoutElement>(id, [&] (const Clay_ElementId& lId) {
CLAY(lId, {.layout = {
.sizing = {.width = CLAY_SIZING_FIXED(size), .height = CLAY_SIZING_FIXED(size)}
},
.floating = {