summary refs log tree commit diff stats
path: root/code
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-06-13 05:02:59 +0200
committerhut <hut@lavabit.com>2009-06-13 05:02:59 +0200
commit236fef23c8269a776c18378f66c1fd2d7d818eee (patch)
treea3e315d303c2c37557cbfa320aeadb1b3a28915c /code
parent92f17aeca4389141d780a67dd76a85dc8f1dc704 (diff)
downloadranger-236fef23c8269a776c18378f66c1fd2d7d818eee.tar.gz
extended colorschemes to statusbar
Diffstat (limited to 'code')
-rw-r--r--code/color.rb7
-rw-r--r--code/fm/draw.rb17
2 files changed, 19 insertions, 5 deletions
diff --git a/code/color.rb b/code/color.rb
index 3eb30977..3968207d 100644
--- a/code/color.rb
+++ b/code/color.rb
@@ -91,6 +91,13 @@ module Color
 	use %w{currentdir top}
 	use %w{currentfile top}
 
+	use %w{butt}
+	use %w{permissions butt}
+	use %w{allowed permissions butt}
+	use %w{denied permissions butt}
+	use %w{date butt}
+	use %w{info butt}
+
 	use %w{media file}
 	use %w{video media file}
 	use %w{sound media file}
diff --git a/code/fm/draw.rb b/code/fm/draw.rb
index 0b5b520a..f326ab23 100644
--- a/code/fm/draw.rb
+++ b/code/fm/draw.rb
@@ -266,9 +266,7 @@ module Fm
 				end
 			end
 
-#			bold false
 			attr_set(Color.base)
-#			color(-1, -1)
 			btm = lines - 1
 
 			case @buffer
@@ -279,19 +277,28 @@ module Fm
 			else
 #				log(@pwd)
 #				log "Buffer: #{@buffer}"
+				attr_set(Color.base)
+				attr_set(Color.info)
 				puti btm, "#@buffer    #{@pwd.file_size.bytes(false)},#{@pwd.size},#{@pwd.pos+1}    ".rjust(cols)
 				more = ''
 				if cf.symlink?
 					more = "#{cf.readlink}"
 				end
-				puti btm, "  #{Time.now.strftime("%H:%M:%S %a %b %d")}  #{cf.rights} #{more}"
 
-#				color_at btm, 23, 10, (cf.writable? ? 6 : 5), -1
+				attr_set(Color.date)
+				left = "  #{Time.now.strftime("%H:%M:%S %a %b %d")}  "
+				puti btm, left
+
+				attr_set(cf.writable? ? Color.allowed : Color.denied)
+				second = "#{cf.rights} "
+				puti btm, left.size, second
 				if more
-#					color_at btm, 34, more.size, (cf.exists? ? 6 : 1), -1
+					attr_set(cf.exists? ? Color.allowed : Color.denied)
+					puti btm, left.size + second.size, "#{more} "
 				end
 			end
 
+			attr_set(Color.base)
 			draw_bars unless @bars.empty?
 
 			movi(@pwd.pos + 1 - get_offset(@pwd, lines), @cur_y)
vious revision' href='/smlckz/zadania/blame/java/prelude.typ?h=main&id=13f9553a26a51b95ab194e5328ad302b35d7b118'>^
ac7aba2 ^
36873dd ^
ac7aba2 ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45





                                                                        











                                                                                  
     



                                                                                         
                                                                     
                                                
                                                                                                     



                                    
   
                                                             
           
                                          
                         
                                                                                                                      
                                                                                                                                                                    
                                                                      






                        
#import "@preview/tablex:0.0.7": tablex, cellx
#import "/template.typ": *

#apply(page-numbering: "(i)" , [
  #align(center, [== Contents])
  #let heading-format(content) = cellx(align: center + horizon, content)
  #let column-alignments = (right, auto, center + horizon, center + horizon, auto)
  #let preprocess-alist(assignment-list, last-page-number) = {
    let index = 0
    let last-index = assignment-list.len() - 1
    let page-number-list = ()
    while index < last-index {
      let item = assignment-list.at(index)
      let next-item = assignment-list.at(index + 1)
      let starting-page-number = item.page-number
      let finishing-page-number = next-item.page-number - 1
      page-number-list.push((starting-page-number, finishing-page-number))
      index = index + 1
    }
    page-number-list.push((assignment-list.at(last-index).page-number, last-page-number))
    let new-assignment-list = ()
    index = 0
    for (start, end) in page-number-list {
      let page-number = if start == end [#start] else [#start - #end]
      let assignment = assignment-list.at(index)
      let item = ([#{assignment.number}. ], assignment.description, page-number, assignment.date, [])
      new-assignment-list.push(item)
      index = index + 1
    }
    new-assignment-list
  }
  #list-of-assignments((assignment-list, last-page-number) =>
    tablex(
      columns: (3em, 1fr, 4em, 6em, 11em),
      stroke: 1pt + gray,
      map-cols: (i, cells) => (cells.first(), ..cells.slice(1).map(cell => (..cell, align: column-alignments.at(i)))),
      heading-format[*Sl.* \ *No.*], heading-format[*Description*], heading-format[*Page No.*], heading-format[*Date*], heading-format[*Teacher’s* \ *Signature*],
      ..preprocess-alist(assignment-list, last-page-number).flatten(),
    ))
])

#colbreak()

#counter(page).update(0)