Class: Rfd::HeaderLeftWindow

Inherits:
Window
  • Object
show all
Defined in:
lib/rfd/windows.rb

Instance Attribute Summary

Attributes inherited from Window

#window

Instance Method Summary collapse

Methods inherited from Window

#begx, #begy, #draw_border, #maxx, #maxy, #mvwaddstr, #subwin, #waddstr, #wclear, #wclrtoeol, #wmove, #wrefresh

Constructor Details

#initializeHeaderLeftWindow

Returns a new instance of HeaderLeftWindow.



58
59
60
61
# File 'lib/rfd/windows.rb', line 58

def initialize
  @window = subwin 3, Curses.COLS - 32, 1, 1
  draw_border 0, 0, 0, 0, 0, 0, Curses::ACS_LTEE, 0
end

Instance Method Details

#draw_current_file_info(current_file) ⇒ Object



70
71
72
73
# File 'lib/rfd/windows.rb', line 70

def draw_current_file_info(current_file)
  draw_current_filename current_file.full_display_name
  draw_stat current_file
end

#draw_current_filename(current_file_name) ⇒ Object



75
76
77
78
79
# File 'lib/rfd/windows.rb', line 75

def draw_current_filename(current_file_name)
  @current_file_name = "File: #{current_file_name}"
  wmove 1
  waddstr @current_file_name, clear_to_eol_before_add: true
end

#draw_path_and_page_number(path: nil, current: 1, total: nil) ⇒ Object



63
64
65
66
67
68
# File 'lib/rfd/windows.rb', line 63

def draw_path_and_page_number(path: nil, current: 1, total: nil)
  @path_and_page_number = %Q[Page: #{"#{current}/ #{total}".ljust(11)}  Path: #{path}]
  wmove 0
  waddstr @path_and_page_number, clear_to_eol_before_add: true
  wrefresh
end

#draw_stat(item) ⇒ Object



81
82
83
84
85
# File 'lib/rfd/windows.rb', line 81

def draw_stat(item)
  @stat = "      #{item.size_or_dir.ljust(13)}#{item.mtime} #{item.mode}"
  wmove 2
  waddstr @stat, clear_to_eol_before_add: true
end