Sha256: 00fdc2777ebb31991cf36d9f5618bc788c3841c5c75dce6695b205ecdae4ca7b

Contents?: true

Size: 871 Bytes

Versions: 43

Compression:

Stored size: 871 Bytes

Contents

theme_exit unless display?

proc_name = "clock"

if @clock_auto_update.nil?
  @clock_auto_update = true
end

@clock_props ||= {
  "size" => @xx_small_font_size,
  "font_family" => @font_family,
}
@clock_color ||= "#0009"

match(Slide) do |slides|
  slides.delete_post_draw_proc_by_name(proc_name)
  stop_auto_redraw_timer

  break if @clock_uninstall

  if @clock_auto_update
    start_auto_redraw_timer(1)
  end
  
  slides.add_post_draw_proc(proc_name) do |slide, canvas, x, y, w, h, simulation|
    unless simulation
      text = Text.new(Time.now.strftime('%H:%M:%S'))
      text.font @clock_props
      set_font_family(text)
      text.compile(canvas, x, y, w, h)
      text.layout.set_width(w * Pango::SCALE)
      num_y = canvas.height - @margin_bottom - text.height
      canvas.draw_layout(text.layout, x, num_y, @clock_color)
    end
    [x, y, w, h]
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/theme/clock/clock.rb
rabbit-3.0.2 lib/rabbit/theme/clock/clock.rb
rabbit-3.0.1 lib/rabbit/theme/clock/clock.rb
rabbit-3.0.0 lib/rabbit/theme/clock/clock.rb
rabbit-2.2.1 lib/rabbit/theme/clock/clock.rb
rabbit-2.2.0 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.9 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.8 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.7 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.6 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.5 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.4 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.3 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.2 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.1 lib/rabbit/theme/clock/clock.rb
rabbit-2.1.0 lib/rabbit/theme/clock/clock.rb
rabbit-2.0.9 lib/rabbit/theme/clock/clock.rb
rabbit-2.0.8 lib/rabbit/theme/clock/clock.rb
rabbit-2.0.7 lib/rabbit/theme/clock/clock.rb
rabbit-2.0.6 lib/rabbit/theme/clock/clock.rb