Fixed cursor obstruction issues and hiding main menu popup issues
This commit is contained in:
parent
16c3097534
commit
ed36036aea
21 changed files with 124 additions and 141 deletions
|
|
@ -6,13 +6,19 @@ namespace GUIStuff { namespace ElementHelpers {
|
|||
|
||||
void text_button(GUIManager& gui, const char* id, std::string_view text, const TextButtonOptions& options) {
|
||||
SelectableButton::Data d = selectable_button_options_to_data(options);
|
||||
d.innerContent = [&gui, text] (const SelectableButton::InnerContentCallbackParameters&) {
|
||||
text_label(gui, text);
|
||||
d.innerContent = [&gui, text, centered = options.centered] (const SelectableButton::InnerContentCallbackParameters&) {
|
||||
CLAY_AUTO_ID({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0) },
|
||||
.childAlignment = {.x = centered ? CLAY_ALIGN_X_CENTER : CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_CENTER}
|
||||
}
|
||||
}) {
|
||||
text_label(gui, text);
|
||||
}
|
||||
};
|
||||
CLAY_AUTO_ID({
|
||||
.layout = {
|
||||
.sizing = {.width = options.wide ? CLAY_SIZING_GROW(0) : CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0) },
|
||||
.childAlignment = {.x = options.centered ? CLAY_ALIGN_X_CENTER : CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_CENTER}
|
||||
.sizing = {.width = options.wide ? CLAY_SIZING_GROW(0) : CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0) }
|
||||
}
|
||||
}) {
|
||||
gui.element<SelectableButton>(id, d);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue