2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added ability to drag'n'drop videos in SendFilesBox.

This commit is contained in:
23rd
2020-07-30 10:50:12 +03:00
committed by John Preston
parent 2576312cd4
commit b71062561a
4 changed files with 30 additions and 26 deletions

View File

@@ -1865,12 +1865,13 @@ void SendFilesBox::prepare() {
void SendFilesBox::setupDragArea() {
// Avoid both drag areas appearing at one time.
auto computeState = [=](const QMimeData *data) {
using DragState = Storage::MimeDataState;
const auto state = Storage::ComputeMimeDataState(data);
return (state == Storage::MimeDataState::PhotoFiles)
? Storage::MimeDataState::Image
: (state == Storage::MimeDataState::Files)
// Temporary enable drag'n'drop only for images. TODO.
? Storage::MimeDataState::None
return (state == DragState::PhotoFiles)
? DragState::Image
: (state == DragState::Files
&& !Storage::ValidateDragData(data, true))
? DragState::None
: state;
};
const auto areas = DragArea::SetupDragAreaToContainer(