プロジェクト

全般

プロフィール

機能 #612 » 0001-role-window-icon-Proc.patch

developに対するformat-patch - Satoshi Okuno, 2013-09-14 01:14

差分を表示:

core/plugin/gtk/toolbar_generator.rb
18 18
          face = command[:show_face] || command[:name] || command[:slug].to_s
19 19
          name = if defined? face.call then lambda{ |x| face.call(event) } else face end
20 20
          toolitem = ::Gtk::Button.new
21
          toolitem.add(::Gtk::WebIcon.new(command[:icon], 16, 16))
21

  
22
          icon = nil
23

  
24
          if command[:icon].is_a?(Proc)
25
            icon = command[:icon].call(*[nil, container][0, (command[:icon].arity == -1 ? 1 : command[:icon].arity)])
26
          else
27
            icon = command[:icon]
28
          end
29

  
30
          toolitem.add(::Gtk::WebIcon.new(icon, 16, 16))
22 31
          toolitem.tooltip(name)
23 32
          toolitem.relief = ::Gtk::RELIEF_NONE
24 33
          toolitem.ssc(:clicked){
    (1-1/1)