プロジェクト

全般

プロフィール

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

Izumi Tsutsui, 2021-11-27 02:24

差分を表示:

plugin/mastodon_account_viewer/mastodon_account_viewer.rb
::Gtk::Table.new(2, header_columns.size).tap { |table|
header_columns.each_with_index do |(key, value), index|
table.
attach(::Gtk::Label.new(key.to_s).right, 0, 1, index, index + 1).
attach(::Gtk::Label.new(key.to_s).set_halign(:end), 0, 1, index, index + 1).
attach(cell_widget(value), 1, 2, index, index + 1)
end
}.set_row_spacing(0, 4).
......
def relation_bar(user)
container = ::Gtk::Box.new(:vertical, 4)
Plugin.collect(:mastodon_worlds).each do |me|
container.closeup(Plugin::MastodonAccountViewer::RelationalContainer.new(me, user, self))
container.pack_start(Plugin::MastodonAccountViewer::RelationalContainer.new(me, user, self), expand: false)
end
container
end
plugin/mastodon_account_viewer/relational_container.rb
@following = @follower = @blocked = @mute = :unknown
@transaction_level = 0
closeup(Gtk::WebIcon.new(my_account.account.icon, ICON_SIZE).tooltip(my_account.title))
closeup(gen_follow_relation)
closeup(Gtk::WebIcon.new(counterpart.icon, ICON_SIZE).tooltip(counterpart.title))
pack_start(Gtk::WebIcon.new(my_account.account.icon, ICON_SIZE).set_tooltip_text(my_account.title), expand: false)
pack_start(gen_follow_relation, expand: false)
pack_start(Gtk::WebIcon.new(counterpart.icon, ICON_SIZE).set_tooltip_text(counterpart.title), expand: false)
unless me?
closeup(followbutton)
closeup(menubutton)
pack_start(followbutton, expand: false)
pack_start(menubutton, expand: false)
retrieve_relation_status
end
end
......
Gtk::Label.new(_('それはあなたです!'))
else
Gtk::Box.new(:vertical, 0)
.closeup(gen_following_relation)
.closeup(gen_followed_relation)
.pack_start(gen_following_relation, expand: false)
.pack_start(gen_followed_relation, expand: false)
end
end
def gen_following_relation
Gtk::Box.new(:horizontal)
.closeup(following_arrow_widget)
.closeup(following_label)
.pack_start(following_arrow_widget, expand: false)
.pack_start(following_label, expand: false)
end
def gen_followed_relation
Gtk::Box.new(:horizontal)
.closeup(followed_arrow_widget)
.closeup(followed_label)
.pack_start(followed_arrow_widget, expand: false)
.pack_start(followed_label, expand: false)
end
def followbutton
(3-3/4)