[studio] Add acceptsClipboardPayload to Editor
This commit is contained in:
@@ -22,4 +22,9 @@ struct StudioContext {
|
||||
ui(pUi), tctx(pTctx) {}
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr keel::Context &keelCtx(StudioContext &ctx) noexcept {
|
||||
return keelCtx(ctx.tctx);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -43,6 +43,9 @@ class BaseEditor: public Widget {
|
||||
|
||||
virtual void paste();
|
||||
|
||||
[[nodiscard]]
|
||||
virtual bool acceptsClipboardPayload() const noexcept;
|
||||
|
||||
virtual void exportFile();
|
||||
|
||||
virtual void keyStateChanged(turbine::Key key, bool down);
|
||||
|
@@ -23,6 +23,10 @@ void BaseEditor::copy() {
|
||||
void BaseEditor::paste() {
|
||||
}
|
||||
|
||||
bool BaseEditor::acceptsClipboardPayload() const noexcept {
|
||||
return {};
|
||||
}
|
||||
|
||||
void BaseEditor::exportFile() {
|
||||
}
|
||||
|
||||
@@ -95,7 +99,7 @@ void BaseEditor::setPasteEnabled(bool v) {
|
||||
}
|
||||
|
||||
bool BaseEditor::pasteEnabled() const noexcept {
|
||||
return m_pasteEnabled;
|
||||
return m_pasteEnabled && acceptsClipboardPayload();
|
||||
}
|
||||
|
||||
ox::Error BaseEditor::saveItem() noexcept {
|
||||
|
Reference in New Issue
Block a user