class Gdk::SubPartsQuote

Constants

EDGE_ABSENT_SIZE
EDGE_PRESENT_SIZE

Public Class Methods

new(*args) click to toggle source
Calls superclass method Gdk::SubParts.new
# File core/mui/cairo_sub_parts_quote.rb, line 23
def initialize(*args)
  super
  @edge = show_edge? ? EDGE_PRESENT_SIZE : EDGE_ABSENT_SIZE
  if helper.message.quoting?
    Thread.new(helper.message) { |m|
      m.quoting_messages(true)
    }.next{ |quoting|
      @messages = quoting.freeze
      render_messages
    }.terminate('コメント付きリツイート描画中にエラーが発生しました') end end

Public Instance Methods

background_color(message) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 48
def background_color(message)
  color = Plugin.filtering(:subparts_quote_background_color, message, UserConfig[:quote_background_color]).last
  if color.is_a? Array and 3 == color.size
    color.map{ |c| c.to_f / 65536 }
  else
    [1.0]*3 end end
badge(_message) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 45
def badge(_message)
  Skin['quote.png'].pixbuf(width: @badge_radius*2, height: @badge_radius*2) end
edge() click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 34
def edge
  if show_edge?
    unless @edge == EDGE_PRESENT_SIZE
      @edge = EDGE_PRESENT_SIZE
      helper.reset_height end
  else
    unless @edge == EDGE_ABSENT_SIZE
      @edge = EDGE_ABSENT_SIZE
      helper.reset_height end end
  @edge end
header_left_content(*args) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 64
def header_left_content(*args)
  if show_header?
    super end end
header_right_content(*args) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 68
def header_right_content(*args)
  if show_header?
    super end end
icon_size() click to toggle source
Calls superclass method Gdk::SubPartsMessageBase#icon_size
# File core/mui/cairo_sub_parts_quote.rb, line 72
def icon_size
  if show_icon?
    if UserConfig[:quote_icon_size]
      Gdk::Rectangle.new(0, 0, UserConfig[:quote_icon_size], UserConfig[:quote_icon_size])
    else
      super end end end
main_text_color(message) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 55
def main_text_color(message)
  if UserConfig[:quote_text_color]
    UserConfig[:quote_text_color].map{ |c| c.to_f / 65536 }
  else
    super end end
main_text_font(message) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 61
def main_text_font(message)
  Pango::FontDescription.new(UserConfig[:quote_text_font]) end
messages() click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 10
def messages
  @messages end
on_click(e, message) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 13
def on_click(e, message)
  case e.button
  when 1
    case UserConfig[:quote_clicked_action]
    when :open
      Plugin.call(:open, message)
    when :smartthread
      Plugin.call(:open_smartthread, [message]) end
  end end
render_badge(message, context) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 92
def render_badge(message, context)
  return unless show_edge?
  case UserConfig[:quote_edge]
  when :floating
    render_badge_floating(message, context)
  when :solid
    render_badge_solid(message, context)
  when :flat
    render_badge_flat(message, context) end end
render_outline(message, context, base_y) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 82
def render_outline(message, context, base_y)
  return unless show_edge?
  case UserConfig[:quote_edge]
  when :floating
    render_outline_floating(message, context, base_y)
  when :solid
    render_outline_solid(message, context, base_y)
  when :flat
    render_outline_flat(message, context, base_y) end end
show_edge?() click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 108
def show_edge?
  (UserConfig[:quote_present_policy] || []).include?(:edge) end
show_header?() click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 102
def show_header?
  (UserConfig[:quote_present_policy] || []).include?(:header) end
show_icon?() click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 105
def show_icon?
  (UserConfig[:quote_present_policy] || []).include?(:icon) end
text_max_line_count(message) click to toggle source
# File core/mui/cairo_sub_parts_quote.rb, line 79
def text_max_line_count(message)
  UserConfig[:quote_text_max_line_count] || super end