From 8401250a906c1027b85ad51e14e2c01a25e9904d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 7 Dec 2022 16:21:53 +0100 Subject: [PATCH] Postshaders: Move delete button directly to the items. --- UI/DisplayLayoutScreen.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 074c0c8454..432e3b5eaa 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -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);