Sha256: 1e5162e9f3b2e87895df1202c36cdef329a038bb8801236baf219d1cc122260a

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

require "gtk3"

module Mireru
  module Widget
    class Image < Gtk::Image
      def initialize(file, width, height)
        super()
        pixbuf_animation = Gdk::PixbufAnimation.new(file)
        if pixbuf_animation.static_image?
          pixbuf = pixbuf_animation.static_image
          if pixbuf.width > width || pixbuf.height > height
            pixbuf = Gdk::Pixbuf.new(file, width, height)
          end
          self.pixbuf = pixbuf
        else
          self.pixbuf_animation = pixbuf_animation
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mireru-0.9.0 lib/mireru/widget/image.rb