プロジェクト

全般

プロフィール

提案 #1525 » 0003-repace-deprecated-mastodon_account_viewer.patch

Izumi Tsutsui, 2021-11-27 02:24

差分を表示:

plugin/mastodon_account_viewer/mastodon_account_viewer.rb
55 55
    ::Gtk::Table.new(2, header_columns.size).tap { |table|
56 56
      header_columns.each_with_index do |(key, value), index|
57 57
        table.
58
          attach(::Gtk::Label.new(key.to_s).right, 0, 1, index, index + 1).
58
          attach(::Gtk::Label.new(key.to_s).set_halign(:end), 0, 1, index, index + 1).
59 59
          attach(cell_widget(value), 1, 2, index, index + 1)
60 60
      end
61 61
    }.set_row_spacing(0, 4).
......
78 78
  def relation_bar(user)
79 79
    container = ::Gtk::Box.new(:vertical, 4)
80 80
    Plugin.collect(:mastodon_worlds).each do |me|
81
      container.closeup(Plugin::MastodonAccountViewer::RelationalContainer.new(me, user, self))
81
      container.pack_start(Plugin::MastodonAccountViewer::RelationalContainer.new(me, user, self), expand: false)
82 82
    end
83 83
    container
84 84
  end
plugin/mastodon_account_viewer/relational_container.rb
17 17
      @following = @follower = @blocked = @mute = :unknown
18 18
      @transaction_level = 0
19 19

  
20
      closeup(Gtk::WebIcon.new(my_account.account.icon, ICON_SIZE).tooltip(my_account.title))
21
      closeup(gen_follow_relation)
22
      closeup(Gtk::WebIcon.new(counterpart.icon, ICON_SIZE).tooltip(counterpart.title))
20
      pack_start(Gtk::WebIcon.new(my_account.account.icon, ICON_SIZE).set_tooltip_text(my_account.title), expand: false)
21
      pack_start(gen_follow_relation, expand: false)
22
      pack_start(Gtk::WebIcon.new(counterpart.icon, ICON_SIZE).set_tooltip_text(counterpart.title), expand: false)
23 23
      unless me?
24
        closeup(followbutton)
25
        closeup(menubutton)
24
        pack_start(followbutton, expand: false)
25
        pack_start(menubutton, expand: false)
26 26
        retrieve_relation_status
27 27
      end
28 28
    end
......
119 119
        Gtk::Label.new(_('それはあなたです!'))
120 120
      else
121 121
        Gtk::Box.new(:vertical, 0)
122
          .closeup(gen_following_relation)
123
          .closeup(gen_followed_relation)
122
          .pack_start(gen_following_relation, expand: false)
123
          .pack_start(gen_followed_relation, expand: false)
124 124
      end
125 125
    end
126 126

  
127 127
    def gen_following_relation
128 128
      Gtk::Box.new(:horizontal)
129
        .closeup(following_arrow_widget)
130
        .closeup(following_label)
129
        .pack_start(following_arrow_widget, expand: false)
130
        .pack_start(following_label, expand: false)
131 131
    end
132 132

  
133 133
    def gen_followed_relation
134 134
      Gtk::Box.new(:horizontal)
135
        .closeup(followed_arrow_widget)
136
        .closeup(followed_label)
135
        .pack_start(followed_arrow_widget, expand: false)
136
        .pack_start(followed_label, expand: false)
137 137
    end
138 138

  
139 139
    def followbutton
(3-3/4)