File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ void EditorMenu::DrawFileMenu()
5959 {
6060 }
6161
62+ if (ImGui::MenuItem (ICON_FA_COPY " Copy Preset to Clipboard" ))
63+ {
64+ _presetEditorGUI.CopyToClipboard ();
65+ }
66+
6267 ImGui::Separator ();
6368
6469 if (ImGui::MenuItem (ICON_FA_CIRCLE_XMARK " Exit Preset Editor" ))
Original file line number Diff line number Diff line change 1010#include " notifications/DisplayToastNotification.h"
1111#include " notifications/UpdateWindowTitleNotification.h"
1212
13+ #include < SDL_clipboard.h>
1314#include < imgui.h>
1415
1516#include < Poco/NotificationCenter.h>
@@ -123,6 +124,12 @@ void PresetEditorGUI::UpdatePresetPreview()
123124 }
124125}
125126
127+ void PresetEditorGUI::CopyToClipboard ()
128+ {
129+ _editorPreset.ToParsedFile (_presetFile);
130+ SDL_SetClipboardText (_presetFile.AsString ().c_str ());
131+ }
132+
126133void PresetEditorGUI::HandleGlobalEditorKeys ()
127134{
128135 ImGuiIO& io = ImGui::GetIO ();
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ class PresetEditorGUI
4646 */
4747 void UpdatePresetPreview ();
4848
49+ /* *
50+ * @brief Reloads the rendered preview with the current changes.
51+ */
52+ void CopyToClipboard ();
53+
4954private:
5055 void HandleGlobalEditorKeys ();
5156 void TakeProjectMControl ();
You can’t perform that action at this time.
0 commit comments