Postshaders: Move delete button directly to the items.

This commit is contained in:
Henrik Rydgård 2022-12-07 16:21:53 +01:00
parent cd24d3edf9
commit 8401250a90

View file

@ -329,6 +329,14 @@ void DisplayLayoutScreen::CreateViews() {
});
}
auto removeButton = shaderRow->Add(new Choice(ImageID("I_TRASHCAN"), new LinearLayoutParams(0.0f)));
removeButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
g_Config.vPostShaderNames.erase(g_Config.vPostShaderNames.begin() + i);
NativeMessageReceived("gpu_configChanged", "");
RecreateViews();
return UI::EVENT_DONE;
});
auto moreButton = shaderRow->Add(new Choice(ImageID("I_THREE_DOTS"), new LinearLayoutParams(0.0f)));
moreButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
PopupContextMenuScreen *contextMenu = new UI::PopupContextMenuScreen(postShaderContextMenu, ARRAY_SIZE(postShaderContextMenu), di.get(), moreButton);