Mail: Accept dropped files on window

Currently only files dropped on the mail contents view are added as
attachments. Since dropped text files get inserted into the contents,
it only worked for non-text files.

With this change, the header area and the empty space of the tool bar
react to file drops as well.

* Accept dropped files on the whole window area
* Forward dropped files on the address text controls to the
  main window (if they aren't people files)

Change-Id: Ia92f1e34aaf98a3089b318947668f3df41af00ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6697
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Humdinger 2023-07-06 09:26:58 +02:00 committed by waddlesplash
parent 899e0ef82b
commit a8030ecec6
2 changed files with 10 additions and 6 deletions

View File

@ -689,12 +689,15 @@ THeaderView::MessageReceived(BMessage *msg)
{
BTextView* textView = dynamic_cast<BTextView*>(Window()->CurrentFocus());
if (dynamic_cast<AddressTextControl *>(textView->Parent()) != NULL)
textView->Parent()->MessageReceived(msg);
else {
BMessage message(*msg);
message.what = REFS_RECEIVED;
Window()->PostMessage(&message, Window());
}
BMessage message(*msg);
textView->Parent()->MessageReceived(msg);
break;
}
case B_REFS_RECEIVED:
{
BMessage message(*msg);
message.what = REFS_RECEIVED;
Window()->PostMessage(&message, Window());
break;
}

View File

@ -1580,6 +1580,7 @@ TMailWindow::MessageReceived(BMessage* msg)
break;
}
case B_SIMPLE_DATA:
case REFS_RECEIVED:
AddEnclosure(msg);
break;