Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Last active February 15, 2018 15:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akkiesoft/5974480 to your computer and use it in GitHub Desktop.
Save Akkiesoft/5974480 to your computer and use it in GitHub Desktop.
display_requirements.rbでアレされたmikutterに少しだけ自分好みの設定を取り戻すプラグイン。
# -*- coding: utf-8 -*-
class ::Gdk::MiraclePainter
# 名前のあとにスクリーンネームを表示たい。
# また、スクリーンネームの前には @ をつけておきたい。
def header_left_markup
user = message.user
if user.respond_to?(:idname)
Pango.parse_markup("<b>#{Pango.escape(user.name || '')}</b> @#{Pango.escape(user.idname)}")
else
Pango.parse_markup(Pango.escape(user.name || ''))
end
end
# アイコン上にカーソルが来てもボタンっぽくしない
def render_icon_over_button(context)
end
# アイコン上のボタンを認証済みと鍵だけにする
def iob_icon_pixbuf
[
[ if message.user.verified?; then "verified.png".freeze end ],
[ if message.user.protected?; then "protected.png".freeze end ] ] end
# アイコン上のボタンを認証済みと鍵だけにする
def iob_icon_pixbuf_off
[
[ UserConfig[:show_verified_icon] && message.user.verified? && "verified.png", nil ],
[ if UserConfig[:show_protected_icon] and message.user.protected?
"protected.png".freeze end , nil ] ] end
# アイコンをクリックしたらプロフィールを表示したい
# def iob_clicked
# if(current_icon_pos)
def iob_clicked(gx, gy)
if globalpos2iconpos(gx, gy)
Plugin.call(:open, message.user) end end
# タイムスタンプにツイートのパーマリンクへのリンクを設定したい(名前はとくに要らない)
alias __clicked_l7eOfD__ clicked
def clicked(x, y, e)
if defined?(@hr_region) and @hr_region.point_in?(x, y)
Plugin.call(:open, message)
else
__clicked_l7eOfD__(x, y, e)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment