mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
96f791daf1
See also: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/ https://hynek.me/til/copyright-years/
43 lines
867 B
C++
43 lines
867 B
C++
// SPDX-FileCopyrightText: Nheko Contributors
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "NhekoDropArea.h"
|
|
|
|
#include <QMimeData>
|
|
|
|
#include "ChatPage.h"
|
|
#include "timeline/InputBar.h"
|
|
#include "timeline/TimelineModel.h"
|
|
#include "timeline/TimelineViewManager.h"
|
|
|
|
#include "Logging.h"
|
|
|
|
NhekoDropArea::NhekoDropArea(QQuickItem *parent)
|
|
: QQuickItem(parent)
|
|
{
|
|
setFlags(ItemAcceptsDrops);
|
|
}
|
|
|
|
void
|
|
NhekoDropArea::dragEnterEvent(QDragEnterEvent *event)
|
|
{
|
|
event->acceptProposedAction();
|
|
}
|
|
|
|
void
|
|
NhekoDropArea::dragMoveEvent(QDragMoveEvent *event)
|
|
{
|
|
event->acceptProposedAction();
|
|
}
|
|
|
|
void
|
|
NhekoDropArea::dropEvent(QDropEvent *event)
|
|
{
|
|
if (event) {
|
|
auto model = ChatPage::instance()->timelineManager()->rooms()->getRoomById(roomid_);
|
|
if (model) {
|
|
model->input()->insertMimeData(event->mimeData());
|
|
}
|
|
}
|
|
}
|