mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
ImageViewer: Scale image to window on resize
This commit is contained in:
parent
d8819c2d0e
commit
17eb77cf55
Notes:
sideshowbarker
2024-07-17 05:21:12 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/17eb77cf55 Pull-request: https://github.com/SerenityOS/serenity/pull/17991
2 changed files with 7 additions and 0 deletions
|
@ -213,6 +213,12 @@ void ViewWidget::drop_event(GUI::DropEvent& event)
|
|||
on_drop(event);
|
||||
}
|
||||
|
||||
void ViewWidget::resize_event(GUI::ResizeEvent& event)
|
||||
{
|
||||
event.accept();
|
||||
scale_image_for_window();
|
||||
}
|
||||
|
||||
void ViewWidget::scale_image_for_window()
|
||||
{
|
||||
set_original_rect(m_bitmap->rect());
|
||||
|
|
|
@ -61,6 +61,7 @@ private:
|
|||
virtual void mouseup_event(GUI::MouseEvent&) override;
|
||||
virtual void drag_enter_event(GUI::DragEvent&) override;
|
||||
virtual void drop_event(GUI::DropEvent&) override;
|
||||
virtual void resize_event(GUI::ResizeEvent&) override;
|
||||
|
||||
void set_bitmap(Gfx::Bitmap const* bitmap);
|
||||
void animate();
|
||||
|
|
Loading…
Reference in a new issue