Sha256: 0e0fd4ac65cf3e181aad279b8620ce04931ed977e8b2e379f3a46d454c53bd29

Contents?: true

Size: 721 Bytes

Versions: 2

Compression:

Stored size: 721 Bytes

Contents

require 'rabbit/gtk'

require 'rabbit/rabbit'

module Rabbit
  module Stock
    include GetText

    RABBIT = :rabbit_rabbit

    @@loaded = false

    module_function
    def init(canvas)
      return if @@loaded
      @@loaded = true
      Gtk::Stock.add(RABBIT, N_("Rabbit"))
      begin
        image_theme = Theme::Searcher.find_theme("rabbit-images", true)
        file = Theme::Searcher.find_file("lavie-icon.png", [image_theme])
        loader = ImageLoader.new(file)
        loader.resize(32, 32)
        factory = Gtk::IconFactory.new
        factory.add(RABBIT.to_s, Gtk::IconSet.new(loader.pixbuf))
        factory.add_default
      rescue LoadError
        canvas.logger.warn($!)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rabbit-2.1.6 lib/rabbit/stock.rb
rabbit-2.1.5 lib/rabbit/stock.rb