[studio] Complete drag/drop support for files

This commit is contained in:
2025-01-19 11:41:08 -06:00
parent 500b93562c
commit 1cbc576286
5 changed files with 34 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
#include <ox/std/string.hpp>
#include <ox/model/def.hpp>
namespace studio {
struct FileRef {
static constexpr auto TypeName = "net.drinkingtea.studio.FileRef";
static constexpr auto TypeVersion = 1;
ox::String path;
};
OX_MODEL_BEGIN(FileRef)
OX_MODEL_FIELD(path)
OX_MODEL_END()
}

View File

@@ -63,6 +63,7 @@ auto dragDropSource(auto const&cb) noexcept {
if (ig::DragDropSource const tgt; tgt) [[unlikely]] {
return cb();
}
return ox::Error{};
} else {
if (ig::DragDropSource const tgt; tgt) [[unlikely]] {
cb();

View File

@@ -6,6 +6,7 @@
#include <studio/configio.hpp>
#include <studio/context.hpp>
#include <studio/dragdrop.hpp>
#include <studio/editor.hpp>
#include <studio/filedialog.hpp>
#include <studio/imguiutil.hpp>