Class: Rfd::HeaderLeftWindow

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

Constant Summary

Constants inherited from Window

Window::ACS_BTEE, Window::ACS_HLINE, Window::ACS_LLCORNER, Window::ACS_LRCORNER, Window::ACS_LTEE, Window::ACS_RTEE, Window::ACS_TTEE, Window::ACS_ULCORNER, Window::ACS_URCORNER, Window::ACS_VLINE

Instance Attribute Summary

Attributes inherited from Window

#window

Instance Method Summary collapse

Methods inherited from Window

#begx, #begy, draw_borders, #maxx, #maxy, #waddstr, #wclear, #wmove, #wrefresh

Constructor Details

#initializeHeaderLeftWindow

Returns a new instance of HeaderLeftWindow.



84
85
86
# File 'lib/rfd/windows.rb', line 84

def initialize
  @window = Curses.stdscr.subwin 3, Curses.cols - 32, 1, 1
end

Instance Method Details

#draw_current_file_info(current_file) ⇒ Object



95
96
97
98
# File 'lib/rfd/windows.rb', line 95

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



100
101
102
103
104
# File 'lib/rfd/windows.rb', line 100

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



88
89
90
91
92
93
# File 'lib/rfd/windows.rb', line 88

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



106
107
108
109
110
# File 'lib/rfd/windows.rb', line 106

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