Sha256: 99d194b9d808b373f8cf30ffffe9ebb07f0e18c54d2dd7afd23c9ee660af871a

Contents?: true

Size: 724 Bytes

Versions: 9

Compression:

Stored size: 724 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.to_sym, 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, Gtk::IconSet.new(loader.pixbuf))
        factory.add_default
      rescue LoadError
        canvas.logger.warn($!)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/stock.rb
rabbit-3.0.2 lib/rabbit/stock.rb
rabbit-3.0.1 lib/rabbit/stock.rb
rabbit-3.0.0 lib/rabbit/stock.rb
rabbit-2.2.1 lib/rabbit/stock.rb
rabbit-2.2.0 lib/rabbit/stock.rb
rabbit-2.1.9 lib/rabbit/stock.rb
rabbit-2.1.8 lib/rabbit/stock.rb
rabbit-2.1.7 lib/rabbit/stock.rb