mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
QuickShow: Animate animated images :^)
With a little help (read: copy & paste) from ImageWidget, QuickShow will now cycle through the frames of animated images - enjoy the cat GIFs! Future improvement: cache decoded images like LibWeb's ImageResource to waste less CPU - the same applies to LibGUI though, maybe we can put something shared in LibGfx. Closes #5837.
This commit is contained in:
parent
41e5155467
commit
10843a2c8c
3 changed files with 68 additions and 9 deletions
|
@ -71,6 +71,7 @@ void ImageWidget::set_auto_resize(bool value)
|
|||
set_fixed_size(m_bitmap->size());
|
||||
}
|
||||
|
||||
// Same as QSWidget::animate(), you probably want to keep any changes in sync
|
||||
void ImageWidget::animate()
|
||||
{
|
||||
m_current_frame_index = (m_current_frame_index + 1) % m_image_decoder->frame_count();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue