Skip to content

Commit

Permalink
Improve phrases in SendFilesBox drag areas.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 30, 2023
1 parent 3dc0e38 commit f10da51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Telegram/SourceFiles/boxes/edit_caption_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/boxes/send_files_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f10da51

Please sign in to comment.