lib/termnote/pane.rb in termnote-1.0.0 vs lib/termnote/pane.rb in termnote-1.1.0
- old
+ new
@@ -1,17 +1,19 @@
require_relative 'pane/chapter'
require_relative 'pane/code'
require_relative 'pane/list'
require_relative 'pane/text'
+require_relative 'pane/console'
+
module TermNote
module Pane
attr_accessor :show, :height, :width, :rows
def call(window_size)
window_height, window_width = window_size
- @width = window_width - (window_width * 0.2)
- @height = window_height / 2
+ @width = window_width
+ @height = window_height
clear
render
end
private
@@ -19,25 +21,21 @@
def clear
system("clear")
end
def render
- puts space + formated_rows + space + footer
+ puts show.header + space + formated_rows + space
end
- def gutter
- " " * (width * 0.1)
- end
-
def space
- "\n" * (height - rows.size)
+ "\n" * (height / 2)
end
- def footer
- "[#{show.panes.index(self) + 1}/#{show.panes.size}]".bold
- end
-
def formated_rows
rows.map { |row| gutter + row }.join("\n")
+ end
+
+ def gutter
+ " " * (width / 10)
end
end
end