From f10da51517268387b1d10a2a4a278a14e3b807a3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 30 Aug 2023 21:49:22 +0400 Subject: [PATCH] Improve phrases in SendFilesBox drag areas. --- Telegram/SourceFiles/boxes/edit_caption_box.cpp | 5 +++-- Telegram/SourceFiles/boxes/send_files_box.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index 90a989ce71..4a2b53c5fd 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -622,9 +622,10 @@ void EditCaptionBox::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 + return (state == DragState::PhotoFiles || state == DragState::Image) + ? (_asFile ? DragState::Files : DragState::Image) : state; }; const auto areas = DragArea::SetupDragAreaToContainer( diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index dcab2b97cb..46ac4b1111 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -442,8 +442,10 @@ void SendFilesBox::setupDragArea() { auto computeState = [=](const QMimeData *data) { using DragState = Storage::MimeDataState; const auto state = Storage::ComputeMimeDataState(data); - return (state == DragState::PhotoFiles) - ? DragState::Image + return (state == DragState::PhotoFiles || state == DragState::Image) + ? (_sendWay.current().sendImagesAsPhotos() + ? DragState::Image + : DragState::Files) : state; }; const auto areas = DragArea::SetupDragAreaToContainer(