mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
ThemeEditor: Fully load files on drop events
Previously, only the preview frame was updated without changing any values in the right panel or even a file path in the window title.
This commit is contained in:
parent
93a2b2a02d
commit
5157a6f6b3
Notes:
sideshowbarker
2024-07-17 01:49:47 +09:00
Author: https://github.com/krkk
Commit: 5157a6f6b3
Pull-request: https://github.com/SerenityOS/serenity/pull/16952
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/drunderscore ✅
1 changed files with 4 additions and 4 deletions
|
@ -667,13 +667,13 @@ void MainWidget::drop_event(GUI::DropEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
auto response = FileSystemAccessClient::Client::the().try_request_file_deprecated(window(), urls.first().path(), Core::OpenMode::ReadOnly);
|
||||
auto response = FileSystemAccessClient::Client::the().request_file(window(), urls.first().path(), Core::Stream::OpenMode::Read);
|
||||
if (response.is_error())
|
||||
return;
|
||||
|
||||
auto set_theme_from_file_result = m_preview_widget->set_theme_from_file(response.release_value());
|
||||
if (set_theme_from_file_result.is_error())
|
||||
GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Setting theme from file has failed: {}", set_theme_from_file_result.error()));
|
||||
auto load_from_file_result = load_from_file(response.value().filename(), response.value().release_stream());
|
||||
if (load_from_file_result.is_error())
|
||||
GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Can't open file named {}: {}", response.value().filename(), load_from_file_result.error()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue