mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 18:17:41 +00:00
ImageViewer: Scale image to window size on image change
This commit is contained in:
parent
5cceae821d
commit
c574b97246
1 changed files with 5 additions and 1 deletions
|
@ -192,7 +192,11 @@ void ViewWidget::load_from_file(DeprecatedString const& path)
|
||||||
|
|
||||||
m_path = Core::DeprecatedFile::real_path_for(path);
|
m_path = Core::DeprecatedFile::real_path_for(path);
|
||||||
GUI::Application::the()->set_most_recently_open_file(String::from_utf8(path).release_value_but_fixme_should_propagate_errors());
|
GUI::Application::the()->set_most_recently_open_file(String::from_utf8(path).release_value_but_fixme_should_propagate_errors());
|
||||||
reset_view();
|
|
||||||
|
if (scaled_for_first_image())
|
||||||
|
scale_image_for_window();
|
||||||
|
else
|
||||||
|
reset_view();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewWidget::drag_enter_event(GUI::DragEvent& event)
|
void ViewWidget::drag_enter_event(GUI::DragEvent& event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue