Add GridModify tool, and visibility flag to grids

This commit is contained in:
Yousef Khadadeh 2025-09-10 15:03:06 +03:00
parent 2325d84c22
commit 76dcd4eac5
15 changed files with 271 additions and 16 deletions

View file

@ -348,7 +348,7 @@ void GUIManager::svg_icon(const std::string& id, const std::string& svgPath, boo
pop_id();
}
bool GUIManager::svg_icon_button(const std::string& id, const std::string& svgPath, bool isSelected, float size, const std::function<void()>& elemUpdate) {
bool GUIManager::svg_icon_button(const std::string& id, const std::string& svgPath, bool isSelected, float size, bool hasBorder, const std::function<void()>& elemUpdate) {
bool toRet = false;
push_id(id);
CLAY ({.layout = {.sizing = {.width = CLAY_SIZING_FIXED(size), .height = CLAY_SIZING_FIXED(size) } } }) {
@ -356,7 +356,7 @@ bool GUIManager::svg_icon_button(const std::string& id, const std::string& svgPa
svg_icon("1", svgPath, is || s.held || s.hovered);
if(elemUpdate)
elemUpdate();
}, true, true, isSelected);
}, hasBorder, true, isSelected);
}
pop_id();
return toRet;

View file

@ -51,7 +51,7 @@ class GUIManager {
bool text_button_sized(const std::string& id, const std::string& text, Clay_SizingAxis x, Clay_SizingAxis y, bool isSelected = false, const std::function<void()>& elemUpdate = nullptr);
void svg_icon(const std::string& id, const std::string& svgPath, bool isHighlighted = false, const std::function<void()>& elemUpdate = nullptr);
bool svg_icon_button(const std::string& id, const std::string& svgPath, bool isSelected = false, float size = 40.0f, const std::function<void()>& elemUpdate = nullptr);
bool svg_icon_button(const std::string& id, const std::string& svgPath, bool isSelected = false, float size = 40.0f, bool hasBorder = true, const std::function<void()>& elemUpdate = nullptr);
void top_to_bottom_window_popup_layout(Clay_SizingAxis x, Clay_SizingAxis y, const std::function<void()>& elemUpdate);
void left_to_right_layout(Clay_SizingAxis x, Clay_SizingAxis y, const std::function<void()>& elemUpdate);