Small Edits trying to fix Sigsegv

This commit is contained in:
2025-04-29 13:13:04 -05:00
parent 6f7388a27d
commit 543b1f81a4
2 changed files with 4 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ namespace JUI {
/// A vertically-descending list menu of button objects, which supports sub-menus much like class UtilityBar.
/// @see UtilityBar
class ContextMenu : public Rect, public TextStyleInterface {
class ContextMenu : public Rect {
public:
void PropogateTextSize(int value) {
@@ -73,7 +73,7 @@ namespace JUI {
}
/// Sets the TextSize property for the child elements of this widget.
void TextSize(int value) override {
void TextSize(int value) {
// TODO: This works fine for the ContextMenu, where children are assuemed to only by submenus and buttons.
// Some widgets will need to be handled specially, because only some of their children are logically bound to it.
PropogateTextSize(value);

View File

@@ -30,7 +30,8 @@ namespace JUI {
submenu->AnchorPoint({1, 0});
submenu->Position({0_percent, 0_percent});
btn->OnClickEvent += [&] (auto a, auto b) mutable {
btn->OnClickEvent += [this, &submenu] (auto a, auto b) {
submenu->Visible(true);
};