Project

General

Profile

提案 #1258 » 1258-2.patch

topic/1258-pretty-extract-settings(ccda3f8)に対するパッチ - Yuto Tokunaga, 2018-09-19 00:46

View differences:

core/plugin/extract/extract_tab_list.rb
20 20
            GdkPixbuf::Pixbuf, # icon
21 21
            String,            # name
22 22
            Numeric,           # id
23
            GdkPixbuf::Pixbuf, # sound
24
            GdkPixbuf::Pixbuf  # popup
23
            String,            # sound
24
            String             # popup
25 25
          ))
26 26

  
27 27
    append_column Gtk::TreeViewColumn.new(
......
37 37
    append_column Gtk::TreeViewColumn.new(
38 38
                    '',
39 39
                    Gtk::CellRendererPixbuf.new,
40
                    pixbuf: COL_SOUND
40
                    icon_name: COL_SOUND
41 41
                  )
42 42
    append_column Gtk::TreeViewColumn.new(
43 43
                    '',
44 44
                    Gtk::CellRendererPixbuf.new,
45
                    pixbuf: COL_POPUP
45
                    icon_name: COL_POPUP
46 46
                  )
47 47

  
48 48
    extract_tabs.each(&method(:add_record))
......
112 112
  # [record] 参照するレコード (Hash)
113 113
  def setup_iter(iter, record)
114 114
    size = { width: ICON_SIZE, height: ICON_SIZE }
115
    set_icon = lambda { |col, photo|
116
      iter[col] = photo.load_pixbuf(**size) do |pb|
117
        iter[col] = pb unless destroyed?
118
      end
119
    }
120 115

  
121 116
    iter[COL_NAME] = record[:name]
122 117
    iter[COL_ID] = record[:id]
......
124 119
      photo = Enumerator.new do |y|
125 120
        Plugin.filtering :photo_filter, record[:icon], y
126 121
      end.first
127
      set_icon.call COL_ICON, photo
128
    end
129
    if record[:sound].to_s.empty?
130
      # FIXME: 適当なアイコンを標準スキンに入れる
131
      set_icon.call COL_SOUND, Skin['speaker-x.png']
132
    else
133
      set_icon.call COL_SOUND, Skin['speaker-l.png']
134
    end
135
    if record[:popup]
136
      # FIXME: 適当なアイコンを標準スキンに入れる
137
      set_icon.call COL_POPUP, Skin['popup.png']
138
    else
139
      set_icon.call COL_POPUP, Skin['no-popup.png']
122
      iter[COL_ICON] = photo.load_pixbuf(**size) do |pb|
123
        iter[COL_ICON] = pb unless destroyed?
124
      end
140 125
    end
126
    iter[COL_SOUND] = if record[:sound].to_s.empty?
127
                        'audio-volume-muted-symbolic'
128
                      else
129
                        'audio-volume-high-symbolic'
130
                      end
131
    iter[COL_POPUP] = if record[:popup]
132
                        'dialog-information-symbolic'
133
                      else
134
                        ''
135
                      end
141 136
  end
142 137

  
143 138
  def gen_uniq_id(uniq_id = Time.now.to_i)
(2-2/2)