diff --git a/CHANGES.md b/CHANGES.md index 0a0720ee..4b7e1ba5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,9 @@ HEAD: new items added as changes are made Features: +Bug fixes: + * Fix Add Cards toolbar not showing script multi-add functions on initial load (twanvl#153) + ------------------------------------------------------------------------------ version 2.2.0 (Unofficial), 2022-07-16 ------------------------------------------------------------------------------ diff --git a/src/gui/set/cards_panel.cpp b/src/gui/set/cards_panel.cpp index fb9b7202..a70e222b 100644 --- a/src/gui/set/cards_panel.cpp +++ b/src/gui/set/cards_panel.cpp @@ -153,8 +153,10 @@ void CardsPanel::onChangeSet() { menuCard->Remove(ID_CARD_ADD_MULT); ((wxMenu*)menuCard)->Insert(4,insertManyCardsMenu); // HACK: the position is hardcoded // also for the toolbar dropdown menu - if (toolAddCard) { - toolAddCard->SetDropdownMenu(makeAddCardsSubmenu(true)); + if (toolAddCard) { + // Originally this was using the menu directly, but there are compatibility issues apparently. + // At this point it might be possible to just store a reference to the toolbar directly instead. + toolAddCard->GetToolBar()->SetDropdownMenu(ID_CARD_ADD, makeAddCardsSubmenu(true)); } } @@ -186,7 +188,7 @@ void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) { add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK); add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK); tb->AddSeparator(); - add_tool_tr(tb, ID_CARD_ADD, "card_add", "add_card", false, wxITEM_DROPDOWN); + toolAddCard = add_tool_tr(tb, ID_CARD_ADD, "card_add", "add_card", false, wxITEM_DROPDOWN); tb->SetDropdownMenu(ID_CARD_ADD, makeAddCardsSubmenu(true)); add_tool_tr(tb, ID_CARD_REMOVE, "card_del", "remove_card"); tb->AddSeparator(); @@ -492,4 +494,4 @@ void CardsPanel::selectFirstCard() { void CardsPanel::getCardLists(vector& out) { out.push_back(card_list); -} \ No newline at end of file +}