module Gtk::TimelineDarkMatterPurification

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File core/mui/gtk_dark_matter_prification.rb, line 17
def initialize(*args)
  super(*args)
  refresh_timer
end

Public Instance Methods

refresh() click to toggle source

InnerTLをすげ替える。

# File core/mui/gtk_dark_matter_prification.rb, line 23
def refresh
  notice "timeline refresh"
  scroll = @tl.vadjustment.value
  oldtl = @tl
  @tl = Gtk::TimeLine::InnerTL.new(oldtl)
  remove(@shell)
  @shell = init_tl
  @tl.vadjustment.value = scroll
  pack_start(@shell.show_all)
  @exposing_miraclepainter = []
  oldtl.destroy if not oldtl.destroyed?
end
refresh_timer() click to toggle source

ある条件を満たしたらInnerTLを捨てて、全く同じ内容の新しいInnerTLにすげ替えるためのイベントを定義する。

# File core/mui/gtk_dark_matter_prification.rb, line 37
def refresh_timer
  Reserver.new(60) {
    Delayer.new {
      if !@tl.destroyed?
        window_active = Plugin.filtering(:get_windows, []).first.any?(&:has_toplevel_focus?)
        @tl.collect_counter -= 1 if not window_active
        refresh if not(Gtk::TimeLine::InnerTL.current_tl == @tl and window_active and Plugin.filtering(:get_idle_time, nil).first < 3600) and @tl.collect_counter <= (window_active ? -HYDE : 0)
        refresh_timer end } } end
tl_model_remove(iter) click to toggle source
# File core/mui/gtk_dark_matter_prification.rb, line 46
def tl_model_remove(iter)
  iter[Gtk::TimeLine::InnerTL::MIRACLE_PAINTER].destroy
  @tl.model.remove(iter)
  @tl.collect_counter -= 1
end