mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
HexEditor: Accept file drops
This commit is contained in:
parent
4eba921d48
commit
7f418a5c6a
2 changed files with 15 additions and 0 deletions
|
@ -372,3 +372,16 @@ void HexEditorWidget::set_search_results_visible(bool visible)
|
||||||
m_layout_search_results_action->set_checked(visible);
|
m_layout_search_results_action->set_checked(visible);
|
||||||
m_search_results_container->set_visible(visible);
|
m_search_results_container->set_visible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HexEditorWidget::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();
|
||||||
|
open_file(urls.first().path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@ private:
|
||||||
void update_title();
|
void update_title();
|
||||||
void set_search_results_visible(bool visible);
|
void set_search_results_visible(bool visible);
|
||||||
|
|
||||||
|
virtual void drop_event(GUI::DropEvent&) override;
|
||||||
|
|
||||||
RefPtr<Core::ConfigFile> m_config;
|
RefPtr<Core::ConfigFile> m_config;
|
||||||
|
|
||||||
RefPtr<HexEditor> m_editor;
|
RefPtr<HexEditor> m_editor;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue