diff --git a/include/plugin/Model.hpp b/include/plugin/Model.hpp index 8e8b0df5..46a21858 100644 --- a/include/plugin/Model.hpp +++ b/include/plugin/Model.hpp @@ -75,7 +75,12 @@ struct Model { std::string getUserPresetDirectory(); /** Returns the module or plugin manual URL, whichever exists. */ std::string getManualUrl(); - void appendContextMenu(ui::Menu* menu); + + /** Appends items to menu with useful Model information. + + Enable `inBrowser` to show Module Browser key commands. + */ + void appendContextMenu(ui::Menu* menu, bool inBrowser = false); bool isFavorite(); void setFavorite(bool favorite); }; diff --git a/src/app/Browser.cpp b/src/app/Browser.cpp index 08096cc1..79496536 100644 --- a/src/app/Browser.cpp +++ b/src/app/Browser.cpp @@ -305,7 +305,7 @@ struct ModelBox : widget::OpaqueWidget { menu->addChild(createMenuLabel(model->name)); menu->addChild(createMenuLabel(model->plugin->brand)); - model->appendContextMenu(menu); + model->appendContextMenu(menu, true); } }; diff --git a/src/plugin/Model.cpp b/src/plugin/Model.cpp index 7bc2c414..ecf0ad0b 100644 --- a/src/plugin/Model.cpp +++ b/src/plugin/Model.cpp @@ -95,7 +95,7 @@ std::string Model::getManualUrl() { } -void Model::appendContextMenu(ui::Menu* menu) { +void Model::appendContextMenu(ui::Menu* menu, bool inBrowser) { // plugin menu->addChild(createMenuItem("Plugin: " + plugin->name, "", [=]() { system::openBrowser(plugin->pluginUrl); @@ -181,12 +181,12 @@ void Model::appendContextMenu(ui::Menu* menu) { } // Favorite - menu->addChild(createBoolMenuItem("Favorite", + std::string favoriteRightText = inBrowser ? (RACK_MOD_CTRL_NAME "+click") : ""; + if (isFavorite()) + favoriteRightText += " " CHECKMARK_STRING; + menu->addChild(createMenuItem("Favorite", favoriteRightText, [=]() { - return isFavorite(); - }, - [=](bool favorite) { - setFavorite(favorite); + setFavorite(!isFavorite()); } )); }