class Gdk::ReplyViewer

Constants

EDGE_ABSENT_SIZE
EDGE_PRESENT_SIZE

Attributes

messages[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Gdk::SubParts.new
# File core/mui/cairo_replyviewer.rb, line 22
def initialize(*args)
  super
  @edge = show_edge? ? EDGE_PRESENT_SIZE : EDGE_ABSENT_SIZE
  if helper.message.has_receive_message?
    helper.message.replyto_source_d(true).next{ |reply|
      @messages = [reply].freeze
      render_messages
    }.terminate('リプライ描画中にエラーが発生しました') end end

Public Instance Methods

background_color(message) click to toggle source
# File core/mui/cairo_replyviewer.rb, line 46
def background_color(message)
  color = Plugin.filtering(:subparts_replyviewer_background_color, message, nil).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_replyviewer.rb, line 42
def badge(_message)
  Skin['reply.png'].pixbuf(width: badge_radius*2, height: badge_radius*2)
end
edge() click to toggle source
# File core/mui/cairo_replyviewer.rb, line 31
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_replyviewer.rb, line 59
def header_left_content(*args)
  if show_header?
    super end end
header_right_content(*args) click to toggle source
# File core/mui/cairo_replyviewer.rb, line 63
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_replyviewer.rb, line 67
def icon_size
  if show_icon?
    if UserConfig[:reply_icon_size]
      Gdk::Rectangle.new(0, 0, UserConfig[:reply_icon_size], UserConfig[:reply_icon_size])
    else
      super end end end
main_text_color(message) click to toggle source
# File core/mui/cairo_replyviewer.rb, line 53
def main_text_color(message)
  UserConfig[:reply_text_color].map{ |c| c.to_f / 65536 } end
main_text_font(message) click to toggle source
# File core/mui/cairo_replyviewer.rb, line 56
def main_text_font(message)
  Pango::FontDescription.new(UserConfig[:reply_text_font]) end
on_click(e, message) click to toggle source
# File core/mui/cairo_replyviewer.rb, line 12
def on_click(e, message)
  case e.button
  when 1
    case UserConfig[:reply_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_replyviewer.rb, line 87
def render_badge(message, context)
  return unless show_edge?
  case UserConfig[:reply_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_replyviewer.rb, line 77
def render_outline(message, context, base_y)
  return unless show_edge?
  case UserConfig[:reply_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_replyviewer.rb, line 103
def show_edge?
  (UserConfig[:reply_present_policy] || []).include?(:edge) end
show_header?() click to toggle source
# File core/mui/cairo_replyviewer.rb, line 97
def show_header?
  (UserConfig[:reply_present_policy] || []).include?(:header) end
show_icon?() click to toggle source
# File core/mui/cairo_replyviewer.rb, line 100
def show_icon?
  (UserConfig[:reply_present_policy] || []).include?(:icon) end
text_max_line_count(message) click to toggle source
# File core/mui/cairo_replyviewer.rb, line 74
def text_max_line_count(message)
  UserConfig[:reply_text_max_line_count] || super end