mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
FontEditor: Accept file drops
This commit is contained in:
parent
a0cb8cfefd
commit
0a54a86a8b
2 changed files with 19 additions and 0 deletions
|
@ -714,3 +714,20 @@ void FontEditorWidget::update_preview()
|
|||
if (m_font_preview_window)
|
||||
m_font_preview_window->update();
|
||||
}
|
||||
|
||||
void FontEditorWidget::drop_event(GUI::DropEvent& event)
|
||||
{
|
||||
event.accept();
|
||||
|
||||
if (event.mime_data().has_urls()) {
|
||||
auto urls = event.mime_data().urls();
|
||||
if (urls.is_empty())
|
||||
return;
|
||||
|
||||
window()->move_to_front();
|
||||
if (!request_close())
|
||||
return;
|
||||
|
||||
open_file(urls.first().path());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue