mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
NK-113 - Open Wren Script File with Double Click
This commit is contained in:
@@ -27,7 +27,7 @@ public:
|
||||
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("_Script"))
|
||||
{
|
||||
char* file = (char*)payload->Data;
|
||||
|
||||
|
||||
std::string fullPath = std::string(file, 512);
|
||||
path = Nuake::FileSystem::AbsoluteToRelative(std::move(fullPath));
|
||||
|
||||
@@ -37,6 +37,16 @@ public:
|
||||
}
|
||||
|
||||
component.Script = path;
|
||||
|
||||
// Double click on file
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0))
|
||||
{
|
||||
if(!component.Script.empty())
|
||||
{
|
||||
Nuake::OS::OpenIn(component.mWrenScript->GetFile()->GetAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ComponentTableReset(component.Script, "");
|
||||
|
||||
@@ -39,7 +39,10 @@ namespace Nuake
|
||||
if (j.contains("Script"))
|
||||
{
|
||||
Script = j["Script"];
|
||||
LoadScript(Script);
|
||||
if(!Script.empty())
|
||||
{
|
||||
LoadScript(Script);
|
||||
}
|
||||
}
|
||||
|
||||
if (j.contains("mModule"))
|
||||
|
||||
Reference in New Issue
Block a user